:root {
  color-scheme: light;
  --ink: #151a21;
  --muted: #5c6977;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --line: #d7e0ea;
  --teal: #0f766e;
  --teal-soft: #e6f7f3;
  --indigo: #3730a3;
  --amber: #b45309;
  --red: #be123c;
  --shadow: 0 14px 40px rgba(21, 26, 33, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.brand,
nav,
.footer {
  font-size: 0.94rem;
}

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

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

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

nav a,
.footer a {
  text-decoration: none;
}

nav a:hover,
.footer a:hover {
  text-decoration: underline;
}

.workspace {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}

.intro,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
  align-items: center;
  padding: clamp(22px, 4vw, 36px);
  margin-bottom: 18px;
}

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

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.lede {
  max-width: 800px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.55;
}

.score-box {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  background: #fbfcfe;
}

.score-label,
#score-caption,
.pill,
.hint {
  color: var(--muted);
  font-size: 0.86rem;
}

#score-value {
  font-size: 3rem;
  line-height: 1;
}

.directory-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 18px;
}

.directory-strip a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.directory-strip a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  min-height: 42px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

textarea,
select,
button {
  font: inherit;
}

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

textarea {
  min-height: 430px;
  padding: 14px;
  resize: vertical;
  line-height: 1.45;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

select {
  padding: 10px 12px;
  margin-bottom: 12px;
}

.controls {
  display: grid;
  gap: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.secondary-button,
.small-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.small-button {
  min-height: 34px;
  padding: 6px 10px;
}

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

.issue-list {
  display: grid;
  gap: 10px;
}

.issue {
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.issue.high {
  border-left-color: var(--red);
}

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

.issue.low {
  border-left-color: var(--indigo);
}

.issue strong {
  display: block;
  margin-bottom: 5px;
}

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

.stats div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.stats dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats dd {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.report-output {
  max-height: 380px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #101820;
  color: #f2f5f7;
  line-height: 1.45;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.source-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  flex-wrap: wrap;
}

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  textarea {
    min-height: 320px;
  }
}
