:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #23372e;
  background: #f6f8f6;
  accent-color: #4e9500;
  --green: #4e9500;
  --border: #d8e1da;
  --muted: #58675e;
}

* { box-sizing: border-box; }

body { margin: 0; }

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  line-height: 1.5;
}

header { margin-bottom: 2rem; }
h1 { margin: 0; font-size: 2rem; letter-spacing: -0.04em; }
h2 { margin: 0.5rem 0; font-size: 1.25rem; }
p { margin: 0.5rem 0; }
header p, #result-description { color: var(--muted); }

.workspace { display: grid; gap: 2rem; align-items: start; }
form, #result { min-width: 0; }
.field-label { display: block; font-weight: 600; }
.url-row { display: flex; gap: 0.5rem; margin-top: 6px; margin-bottom: 6px; }

input, button { font: inherit; }
input[type="text"], input[type="password"] {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  color: inherit;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  margin-top: 6px;
  margin-bottom: 6px;
}

button {
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  color: white;
  background: var(--green);
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: #1b5c3a; }
button:disabled { cursor: wait; opacity: 0.65; }
.secondary { color: var(--green); background: transparent; border-color: var(--border); }
.secondary:hover { background: #eaf2ec; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

details { margin: 1.25rem 0 1.75rem; }
summary { width: fit-content; color: var(--green); cursor: pointer; }
details .field-label { margin-top: 1rem; }
details > .checkbox-label { margin-top: 0.75rem; }
details fieldset { margin-top: 1rem; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-weight: 600; }
.selection-controls { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
#categories { display: grid; }
.checkbox-label { display: flex; align-items: start; gap: 0.65rem; padding: 0.15rem 0; cursor: pointer; }
input[type="checkbox"] { flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0.25rem 0 0; }

#result {
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}
.eyebrow { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
#matched-categories, #matched-records { padding-left: 1.25rem; margin: 1rem 0 0; }
li + li { margin-top: 0.5rem; }
#result[data-state="match"] { border-top-color: #9a6515; }
#result[data-state="error"] { border-top-color: #b33d35; }
#result[data-state="clean"] h2 { color: var(--green); }

@media (min-width: 48rem) {
  .workspace { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  #result { position: sticky; top: 2rem; }
}
