:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6978;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --line: #d7dee8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --amber: #b45309;
  --rose: #be123c;
  --blue: #2563eb;
  --shadow: 0 18px 50px rgba(23, 32, 42, 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: 16px clamp(18px, 4vw, 44px);
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  position: sticky;
  top: 0;
  z-index: 10;
  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.82rem;
}

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(1380px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
}

.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) 220px;
  gap: 24px;
  align-items: center;
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 18px;
}

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

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

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

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

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  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: #f9fbfc;
}

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

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

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.input-panel,
.path-panel,
.results-grid .panel {
  padding: 18px;
}

.path-panel {
  grid-column: 1 / -1;
}

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

textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #fbfdff;
  font: 0.92rem/1.48 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.path-panel textarea {
  min-height: 128px;
}

textarea:focus,
button:focus-visible,
.report-output:focus {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-strong);
}

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

.secondary-button:hover,
.small-button:hover {
  border-color: var(--blue);
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
}

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

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

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

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

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

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

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

.issue h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.issue p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

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

dt {
  color: var(--muted);
  font-size: 0.82rem;
}

dd {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 900;
}

.report-output {
  min-height: 308px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17202a;
  color: #f7fafc;
  white-space: pre-wrap;
  font: 0.88rem/1.52 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

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

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

  textarea {
    min-height: 260px;
  }
}
