:root {
  color-scheme: light;
  --background: #f7f7f4;
  --surface: #ffffff;
  --surface-muted: #f0f1ed;
  --border: #d8dbd2;
  --text: #1f241f;
  --muted: #667064;
  --primary: #26614f;
  --primary-hover: #1f503f;
  --danger: #a33a2a;
  --mapped: #dcecdf;
  --mapped-text: #1f5f30;
  --review: #fff0c2;
  --review-text: #765313;
  --unknown: #e9e9e5;
  --unknown-text: #4e544d;
  --invalid: #f3d5cf;
  --invalid-text: #8a2f25;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 15px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 650;
  min-height: 38px;
  padding: 0 14px;
}

button:hover:not(:disabled) {
  background: var(--primary-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 16px 24px;
}

.topbar h1 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.topbar p {
  color: var(--muted);
  margin: 0;
}

.health-ok {
  color: var(--primary);
}

.health-error {
  color: var(--danger);
}

.workspace {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 0;
}

.input-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
}

.results-panel {
  min-width: 0;
  overflow: auto;
  padding: 24px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label,
legend {
  color: var(--text);
  font-weight: 650;
}

textarea,
input[type="file"] {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  min-width: 0;
  padding: 10px 11px;
  width: 100%;
}

textarea:focus,
input[type="file"]:focus,
button:focus-visible {
  outline: 3px solid rgba(38, 97, 79, 0.22);
  outline-offset: 1px;
}

.filters {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
}

.filters label {
  align-items: center;
  display: flex;
  font-weight: 500;
  gap: 8px;
}

.error {
  background: #fff5f2;
  border: 1px solid #e3b7ad;
  border-radius: 8px;
  color: var(--danger);
  margin-bottom: 14px;
  padding: 12px;
}

table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  color: var(--text);
}

.status {
  border-radius: 6px;
  display: inline-block;
  font-size: 13px;
  font-weight: 650;
  padding: 3px 7px;
}

.status-Mapped {
  background: var(--mapped);
  color: var(--mapped-text);
}

.status-NeedsReview {
  background: var(--review);
  color: var(--review-text);
}

.status-Unknown {
  background: var(--unknown);
  color: var(--unknown-text);
}

.status-Invalid {
  background: var(--invalid);
  color: var(--invalid-text);
}

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

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

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .results-panel {
    padding: 16px;
  }
}
