/* FillFinder — utilitarian-industrial, no build step */
:root {
  --bg: #f4f2ec;
  --paper: #fffdf8;
  --ink: #22201b;
  --ink-2: #6b675c;
  --rule: #ddd8ca;
  --brand: #a04b12;       /* rust — excavated earth */
  --brand-2: #c96a2a;
  --ok: #2c6e49;
  --warn: #9a6a00;
  --bad: #8c2f39;
  --mono-num: 'Public Sans', monospace;
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: 'Public Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3, .brand { font-family: 'Zilla Slab', Georgia, serif; letter-spacing: -0.01em; }
main { flex: 1; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; background: var(--ink); color: #f4f2ec;
}
.brand { font-size: 22px; font-weight: 700; color: #f4f2ec; text-decoration: none; }
.brand span { color: var(--brand-2); }
.topbar nav { display: flex; gap: 18px; align-items: center; font-size: 13px; }
.topbar a { color: #cfcabb; text-decoration: none; }
.topbar a:hover { color: #fff; }
.nav-user { color: #8f8a7c; }

.page { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
footer {
  border-top: 1px solid var(--rule); padding: 18px 28px; font-size: 12px;
  color: var(--ink-2); background: var(--paper);
}
.disclaimer { margin-top: 6px; }

/* Auth */
.auth-wrap { display: grid; place-items: center; padding: 48px 20px; }
.auth-card { max-width: 860px; width: 100%; }
.auth-card h1 { font-size: 44px; line-height: 1.05; margin-bottom: 12px; }
.lede { color: var(--ink-2); max-width: 560px; margin-bottom: 32px; font-size: 16px; }
.auth-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel {
  background: var(--paper); border: 1px solid var(--rule); padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 3px 3px 0 var(--rule);
}
.panel h2 { font-size: 19px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.hint { font-weight: 400; color: var(--ink-2); }
input, select {
  font: inherit; padding: 9px 11px; border: 1.5px solid var(--rule);
  background: #fff; border-radius: 2px;
}
input:focus, select:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand); }
button {
  font: inherit; font-weight: 700; padding: 11px 18px; cursor: pointer;
  background: var(--brand); color: #fff; border: none; border-radius: 2px;
  transition: background .15s;
}
button:hover { background: var(--brand-2); }
button.secondary { background: var(--ink); }
button.secondary:hover { background: #3b382f; }
button:disabled { opacity: .55; cursor: default; }

/* Search form */
.search-panel {
  background: var(--paper); border: 1px solid var(--rule);
  padding: 26px; box-shadow: 3px 3px 0 var(--rule); margin-bottom: 36px;
}
.search-panel h1 { margin-bottom: 18px; font-size: 26px; }
.search-form {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  align-items: end;
}
.search-form .wide { grid-column: span 3; }
.search-form button { grid-column: span 3; justify-self: start; }
.note { margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.data-admin { margin-top: 16px; font-size: 13px; }
.data-admin summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.data-admin ul { margin: 8px 0 10px 18px; }
.data-admin button { margin-top: 4px; font-size: 13px; padding: 8px 14px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  padding: 10px 12px; background: var(--ink); color: #e9e5d8; font-weight: 600;
}
.table td { padding: 11px 12px; border-top: 1px solid var(--rule); vertical-align: top; font-size: 13.5px; }
.table tbody tr:nth-child(even) { background: #faf8f1; }
.table a { color: var(--brand); font-weight: 600; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { color: var(--ink-2); font-size: 12px; }
.notes { font-style: italic; }
.score {
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--ink); color: #f4f2ec; padding: 2px 8px; border-radius: 2px;
}

/* Results head */
.results-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.results-head h1 { font-size: 28px; }
.req-line { color: var(--ink-2); margin-top: 4px; }
.btn-link { color: var(--brand); font-weight: 700; text-decoration: none; white-space: nowrap; padding-top: 8px; }

/* Brief */
.brief {
  background: #fbf6ea; border: 1px solid #e8ddc2; border-left: 4px solid var(--brand);
  padding: 20px 22px; margin-bottom: 32px;
}
.brief h2 { font-size: 18px; margin-bottom: 10px; }
.brief-body { font-size: 14px; }

/* Quality chips */
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.chip-strong_t1 { background: #d9ead9; color: var(--ok); }
.chip-possible_t1 { background: #f2e6c5; color: var(--warn); }
.chip-unknown { background: #e8e5db; color: var(--ink-2); }
.chip-unlikely_t1 { background: #f0d9dc; color: var(--bad); }

.error-card { background: var(--paper); border: 1px solid var(--rule); padding: 40px; text-align: center; }

@media (max-width: 760px) {
  .auth-forms, .search-form { grid-template-columns: 1fr; }
  .search-form .wide, .search-form button { grid-column: span 1; }
}

/* Results map */
.map-section { margin-bottom: 28px; }
#results-map {
  height: 420px; border: 1px solid var(--rule);
  box-shadow: 3px 3px 0 var(--rule); background: #eee;
}
.rank-pin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  color: #fff; font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Public Sans', sans-serif;
}
.head-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.alert-toggle button { font-size: 13px; padding: 9px 14px; }
.check-label { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500; grid-column: span 3; }
.check-label input { width: auto; }
