:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --ink: #152033;
  --muted: #617089;
  --line: #d8e0eb;
  --panel: #ffffff;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b91c1c;
  --green: #15803d;
  --shadow: 0 18px 45px rgba(24, 37, 56, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a {
  color: inherit;
}

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

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

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

.brand small,
.eyebrow,
.subcopy,
.status-line,
.risk,
.footer,
.support-grid p {
  color: var(--muted);
}

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

.navlinks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navlinks a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  font-size: 14px;
}

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

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 28px;
  align-items: start;
}

.tool-copy {
  padding: 20px 0;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 740px;
  margin-bottom: 16px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .98;
  letter-spacing: 0;
}

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

h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.subcopy {
  max-width: 720px;
  font-size: 18px;
}

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

.scanner-panel {
  padding: 18px;
}

.tabs,
.snippet-tabs,
.action-row,
.panel-head,
.input-row,
.score-row,
.counts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f9;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: wait;
  opacity: .68;
}

.tab,
.mini-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab {
  flex: 1;
  padding: 10px 12px;
}

.tab.is-active,
.mini-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(31, 45, 67, .12);
}

.scan-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.input-row {
  align-items: stretch;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  min-height: 190px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.primary,
.ghost,
.small {
  border-radius: 8px;
  font-weight: 800;
}

.primary {
  border: 0;
  padding: 0 22px;
  background: var(--teal);
  color: #fff;
}

.ghost {
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
}

.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
}

.status-line {
  margin: 14px 0 0;
  min-height: 24px;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.results {
  margin-top: 28px;
}

.score-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  margin-bottom: 18px;
}

.grade {
  display: inline-grid;
  place-items: center;
  min-width: 78px;
  height: 72px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.score {
  font-size: 28px;
  font-weight: 900;
}

.counts {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.counts span {
  display: grid;
  place-items: center;
  min-width: 82px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.counts strong {
  color: var(--ink);
  font-size: 24px;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.findings-list,
.headers-list {
  display: grid;
  gap: 12px;
}

.finding,
.header-item {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 13px;
  background: #fbfdff;
}

.finding.pass {
  border-left-color: var(--green);
}

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

.finding.fail {
  border-left-color: var(--red);
}

.badge {
  display: inline-block;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2ff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.fix {
  margin-bottom: 8px;
  font-weight: 700;
}

code,
.snippet {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  background: #101827;
  color: #e2ecff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  display: block;
  padding: 9px;
  font-size: 12px;
}

.header-item {
  border-left-color: var(--blue);
}

.header-item strong {
  display: block;
  margin-bottom: 8px;
}

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

.snippet-tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-tab {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
}

.snippet {
  min-height: 220px;
  max-height: 420px;
  margin: 0;
  padding: 16px;
  white-space: pre;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.support-grid article {
  padding: 18px;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px 16px 34px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

@media (max-width: 860px) {
  .topbar,
  .score-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-shell,
  .grid-two,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .navlinks {
    justify-content: flex-start;
  }

  .input-row,
  .action-row,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .primary {
    min-height: 48px;
  }

  h1 {
    font-size: 42px;
  }
}

@media (max-width: 480px) {
  main {
    width: min(100% - 20px, 1180px);
    padding-top: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .brand {
    min-width: 0;
  }

  .counts {
    width: 100%;
    justify-content: stretch;
  }

  .counts span {
    flex: 1;
  }
}
