:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66737d;
  --line: #d8dee3;
  --paper: #f6f3ed;
  --panel: #ffffff;
  --amber: #c47b27;
  --red: #a43b36;
  --green: #2f7b5f;
  --blue: #315f8c;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(196, 123, 39, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(49, 95, 140, 0.12), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px) 18px;
  border-bottom: 1px solid rgba(23, 32, 38, 0.12);
}

.eyebrow,
.promise,
.fine-print,
footer {
  color: var(--muted);
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.promise {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  padding: 18px clamp(14px, 4vw, 48px) 24px;
}

.input-pane,
.results-pane {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.input-pane {
  display: flex;
  flex-direction: column;
  min-height: 640px;
  padding: 18px;
}

.pane-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.pane-head p,
.fine-print {
  margin-bottom: 14px;
  font-size: 0.94rem;
}

.local-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(47, 123, 95, 0.35);
  color: var(--green);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: #fbfaf7;
}

textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(49, 95, 140, 0.24);
  outline-offset: 2px;
}

.actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions {
  margin-top: 12px;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: #aab4bc;
}

button.primary,
.filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

button:disabled:hover {
  border-color: var(--line);
}

.file-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.file-status:empty {
  display: none;
}

.file-status.error {
  color: var(--red);
}

.input-pane.dragover textarea {
  border-color: var(--blue);
  background: #eef3f8;
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.results-pane {
  padding: 0;
  overflow: hidden;
}

.summary {
  border-bottom: 1px solid var(--line);
  padding: 18px;
  background: #fdfcf8;
}

.summary-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-value {
  margin-bottom: 0;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
}

.filters {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.filter {
  padding: 8px 10px;
  font-size: 0.84rem;
}

.results {
  display: grid;
  gap: 12px;
  max-height: 565px;
  overflow: auto;
  padding: 18px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfaf7;
}

.finding {
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

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

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

.finding.watch {
  border-left-color: var(--blue);
}

.finding-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.finding h3 {
  margin: 0;
  font-size: 1rem;
}

.level {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.snippet {
  border-radius: 6px;
  background: #f6f3ed;
  padding: 10px;
  color: #38444d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.finding ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 48px) 28px;
  font-size: 0.9rem;
}

footer p {
  margin-bottom: 0;
}

.founding {
  max-width: 520px;
  text-align: right;
}

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

  .workspace {
    grid-template-columns: 1fr;
  }

  .input-pane {
    min-height: 520px;
  }

  .founding {
    text-align: left;
  }
}
