:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1a1917;
  --muted: #6b6760;
  --line: #e4e0d8;
  --accent: #8a6d3b;
  --accent-ink: #ffffff;
  --warn-bg: #fdf0ec;
  --warn: #9a3412;
  --ok-bg: #edf7ef;
  --ok: #1f6b35;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e;
    --surface: #1a1918;
    --ink: #f0ede8;
    --muted: #a39e95;
    --line: #2e2c29;
    --accent: #c9a96e;
    --accent-ink: #111111;
    --warn-bg: #3a1d14;
    --warn: #f4a88a;
    --ok-bg: #16301e;
    --ok: #8fd6a2;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 26px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
h3 { font-size: 14px; margin: 16px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .04em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); font-weight: 500; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { padding: 6px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.top nav a.on { background: var(--bg); font-weight: 600; }
.pill { margin-left: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.who { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }

button, .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
  padding: 8px 14px; text-decoration: none;
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 100%;
}
textarea { width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); }
label > input, label > select, label > textarea { display: block; margin-top: 4px; color: var(--ink); }
form.inline { display: inline; margin-left: 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 8px; }
.flash { background: var(--ok-bg); color: var(--ok); padding: 8px 12px; border-radius: 8px; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stats > * { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; color: var(--muted); text-decoration: none; }
.stats b { color: var(--ink); font-size: 20px; margin-right: 4px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 320px; }
.filters .clear { font-size: 13px; }
.count { margin: 12px 0 6px; font-size: 13px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.list .name { font-weight: 600; text-decoration: none; color: var(--ink); }
.list .name:hover { color: var(--accent); }
.fit { font-size: 13px; white-space: nowrap; }
.score { color: var(--accent); letter-spacing: 1px; font-size: 10px; margin-left: 4px; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); text-transform: capitalize; white-space: nowrap; }
.st-new { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.st-interview { background: var(--ok-bg); color: var(--ok); }
.st-hired { background: var(--ok); color: var(--surface); }
.st-pass { color: var(--muted); }

.pager { display: flex; gap: 16px; justify-content: center; margin-top: 16px; }

.detail .head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.contact { display: flex; gap: 16px; flex-wrap: wrap; margin: 0; }
.status-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.status-form input[name=tags] { width: 260px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.fits, .exp, .files, .history { margin: 0; padding-left: 18px; }
.fits li { margin-bottom: 8px; }
.resume iframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
pre.email { white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--bg); padding: 12px; border-radius: 8px; max-height: 400px; overflow: auto; }
details summary { cursor: pointer; padding: 4px 0; }
.note { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.note p { margin: 4px 0 0; white-space: pre-wrap; }
.note-form button { margin-top: 8px; }

.bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 1; }
.reply { display: flex; gap: 12px; }
.reply .pick { padding-top: 2px; }
.reply > div { flex: 1; min-width: 0; }
.reply textarea { margin: 8px 0; }

.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row input[type=email] { flex: 1 1 260px; }

.login { max-width: 420px; margin: 12vh auto; text-align: center; }
.login h1 { font-size: 32px; }
