:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #dde1e6;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --ok-bg: #e3f4e8;  --ok-text: #1d6b35;
  --warn-bg: #fdf1dc; --warn-text: #8a5300;
  --no-bg: #fbe4e4; --no-text: #9b1c1c;
  --tag-bg: #eef1f5;
  --direct-bg: #e4ecfb; --direct-text: #1f4f99;
  --t1: #6b3fd4; --t2: #1f7a8c; --t3: #6b7280;
  --radius: 10px;
  color-scheme: light;
}
/* Dark palette: follows the OS unless a page explicitly sets data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418; --surface: #1a1e24; --text: #e7eaee; --muted: #9aa4b1; --border: #2d333b;
    --accent: #6ea3f5; --accent-text: #0c1320;
    --ok-bg: #173522; --ok-text: #8fdca6; --warn-bg: #3a2a0f; --warn-text: #f3c77a;
    --no-bg: #3d1717; --no-text: #f2a0a0;
    --tag-bg: #252b33; --direct-bg: #1b2a44; --direct-text: #9cc0ff; --t1: #b69cff; --t2: #6fcadb; --t3: #a3abb6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #111418; --surface: #1a1e24; --text: #e7eaee; --muted: #9aa4b1; --border: #2d333b;
    --accent: #6ea3f5; --accent-text: #0c1320;
    --ok-bg: #173522; --ok-text: #8fdca6; --warn-bg: #3a2a0f; --warn-text: #f3c77a;
    --no-bg: #3d1717; --no-text: #f2a0a0;
    --tag-bg: #252b33; --direct-bg: #1b2a44; --direct-text: #9cc0ff; --t1: #b69cff; --t2: #6fcadb; --t3: #a3abb6;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
code { font-size: .9em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 20px 0; }
.site-header .wrap { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
h1 { margin: 0; font-size: 1.6rem; }
.tagline { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }
.updated { margin: 0; text-align: right; }
.updated.stale { color: var(--warn-text); }

.layout { display: grid; grid-template-columns: 270px 1fr; gap: 24px; padding-top: 24px; padding-bottom: 48px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.results, .filters { min-width: 0; }

.filters form { position: sticky; top: 16px; display: grid; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; max-height: calc(100vh - 32px); overflow: auto; }
#filter-panel > summary { display: none; }
@media (max-width: 860px) {
  .filters form { position: static; max-height: none; margin-top: 8px; }
  #filter-panel > summary { display: block; list-style: none; text-align: center; }
  .updated { text-align: left; }
}
.field { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
input[type=search], select {
  font: inherit; font-weight: 400; padding: 7px 9px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%;
}
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 3px; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
fieldset label { display: flex; gap: 6px; align-items: center; font-size: .9rem; }
.count { margin-left: auto; color: var(--muted); font-size: .8rem; }
.info { border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 50%;
  width: 20px; height: 20px; font-size: .75rem; cursor: pointer; padding: 0; }
.actions { display: flex; gap: 8px; }

.btn { display: inline-block; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 7px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.more { display: block; margin: 16px auto; }

.views { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.view { font: inherit; font-size: .88rem; font-weight: 600; white-space: nowrap; cursor: pointer; padding: 6px 12px;
  border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: flex; gap: 6px; align-items: center; }
.view .count { margin-left: 0; }
.view.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.view.active .count { color: inherit; opacity: .85; }

.directory { margin-top: 8px; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.directory table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.directory th, .directory td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.directory th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; }
.stat-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .8rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; gap: 12px; flex-wrap: wrap; }
.toolbar p { margin: 0; color: var(--muted); }
.toolbar label { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.toolbar select { width: auto; }

.small-btn { padding: 3px 10px; font-size: .82rem; margin-left: 6px; border-color: currentColor; color: inherit; }
.notice { background: var(--warn-bg); color: var(--warn-text); padding: 12px 14px; border-radius: var(--radius); margin: 8px 0; }

.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.job { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.job-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.job h2 { font-size: 1.08rem; margin: 0; }
.job h2 a { color: var(--text); text-decoration: none; }
.job h2 a:hover { color: var(--accent); text-decoration: underline; }
.posted { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.job p { margin: 4px 0; }
.employer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tier { font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 1px solid currentColor; }
.tier.t1 { color: var(--t1); } .tier.t2 { color: var(--t2); } .tier.t3 { color: var(--t3); }
.meta { color: var(--muted); font-size: .9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--tag-bg); color: var(--muted); font-size: .78rem; padding: 2px 8px; border-radius: 99px; text-decoration: none; }
.tag.ok { background: var(--ok-bg); color: var(--ok-text); }
.tag.direct { background: var(--direct-bg); color: var(--direct-text); }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.tag.no { background: var(--no-bg); color: var(--no-text); }
.desc { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.evidence { font-size: .88rem; font-style: italic; border-left: 3px solid var(--ok-text); padding-left: 8px; margin: 6px 0; overflow-wrap: anywhere; }
.evidence.maybe { border-left-color: var(--warn-text); }
.evidence.no { border-left-color: var(--no-text); }
.job-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 10px;
  border-top: 1px solid var(--border); padding-top: 10px; flex-wrap: wrap; }
.contact-block h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
.contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; overflow-wrap: anywhere; }
.contact-block { min-width: 0; flex: 1; }
optgroup { font-weight: 600; }
.source { margin-top: 8px !important; }

.sources { margin-top: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.sources summary { cursor: pointer; font-weight: 600; }
.sources table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .88rem; }
.sources th, .sources td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.ok { background: #2e9e57; } .dot.error { background: #d64545; } .dot.skipped, .dot.partial { background: #d9a13b; }
.fineprint { color: var(--muted); font-size: .82rem; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 560px; }
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog dt { font-weight: 700; margin-top: 8px; }
dialog dd { margin: 2px 0 0; color: var(--muted); }

.apply { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.apply .small { font-size: .82rem; }
@media (max-width: 640px) { .apply { align-items: stretch; text-align: left; } }
