:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --text: #1d1c1a;
  --muted: #6b6965;
  --line: #e2e0d8;
  --accent: #2d6a4f;
  --accent-ink: #ffffff;
  --new: #c2410c;
  --p1: #b91c1c;
  --p2: #b45309;
  --p3: #4b5563;
  --p1-bg: #fee2e2;
  --p2-bg: #fef3c7;
  --p3-bg: #e5e7eb;
  --li: #0a66c2;
  --ff: #7c3aed;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412; --surface: #1e1e1b; --surface-2: #272723; --text: #ebe9e3; --muted: #a09d96;
    --line: #34332e; --accent: #5cb48a; --accent-ink: #0d1f17; --new: #fb923c;
    --p1: #fca5a5; --p2: #fcd34d; --p3: #cbd5e1; --p1-bg: #3f1d1d; --p2-bg: #3f2e0f; --p3-bg: #2f353d;
    --li: #6cb3f2; --ff: #b391ff; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  overflow-x: hidden; overflow-wrap: anywhere;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  padding: 0 16px 64px;
}
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 2px; line-height: 1.3; }
a { color: inherit; }
.hidden { display: none !important; }

.top { max-width: 1040px; margin: 0 auto; padding: 22px 0 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.runinfo { color: var(--muted); font-size: 12.5px; }

.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 13px; border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; }

.progress { max-width: 1040px; margin: 6px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.progress pre { margin: 0; font-size: 12px; color: var(--muted); white-space: pre-wrap; max-height: 120px; overflow: auto; flex: 1; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-top: 2px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.filters { max-width: 1040px; margin: 14px auto 0; display: flex; flex-direction: column; gap: 10px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.controls > * { min-width: 0; max-width: 100%; }
.controls input[type=search] { flex: 1 1 220px; min-width: 180px; }
.controls input, .controls select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }

.list { max-width: 1040px; margin: 14px auto 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.empty { max-width: 1040px; margin: 40px auto; text-align: center; color: var(--muted); }

.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); }
.card.is-p1 { border-left: 4px solid var(--p1); }
.card.is-p2 { border-left: 4px solid var(--p2); }
.card.is-p3 { border-left: 4px solid var(--p3); }
.card.is-skipped { opacity: .6; }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.head-main { min-width: 0; flex: 1; }
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.badges { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.new { background: var(--new); color: #fff; }
.badge.prio { background: var(--accent); color: var(--accent-ink); }
.badge.remote { background: var(--surface-2); color: var(--accent); border: 1px solid var(--accent); }
.badge.conn { background: var(--li); color: #fff; }
.conns { margin: 6px 0 0; font-size: 13.5px; color: var(--fg); }
.conns .who { font-weight: 600; color: var(--li); }
.conns a { color: var(--li); text-decoration: none; }
.conns a:hover { text-decoration: underline; }
.conns .pos { color: var(--muted); }
.card.is-prio { box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.meta .salary:not(:empty)::before { content: " · "; }
.meta .salary.ok { color: var(--accent); font-weight: 600; }
.meta .salary.none { font-style: italic; }
.meta .req:not(:empty)::before { content: " · "; }
.meta .req.fit { color: var(--accent); }
.meta .loc.sf { color: var(--accent); font-weight: 600; }
.badge.source.linkedin { color: var(--li); }
.badge.source.fastforward { color: var(--ff); }
.badge.tier { display: none; }
.badge.tier.p1 { display: inline; background: var(--p1-bg); color: var(--p1); }
.badge.tier.p2 { display: inline; background: var(--p2-bg); color: var(--p2); }
.badge.tier.p3 { display: inline; background: var(--p3-bg); color: var(--p3); }
.title { text-decoration: none; }
.title:hover { text-decoration: underline; }
.meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.meta .loc:not(:empty)::before { content: " · "; }
.posted { font-size: 13px; color: var(--muted); white-space: nowrap; }
.posted.fresh { color: var(--accent); font-weight: 600; }
.btn.apply { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

.summary { margin: 12px 0 6px; color: var(--text); font-size: 14.5px; }
.summary:empty { display: none; }
.full summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.full .desc { white-space: pre-wrap; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface-2); border-radius: 8px; padding: 12px 14px; margin: 8px 0 0; max-height: 420px; overflow: auto; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 10px 0 0; }
.tags span { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }

.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.prio { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.prio button { background: var(--surface); border: 0; border-right: 1px solid var(--line); padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.prio button:last-child { border-right: 0; }
.prio button:hover { background: var(--surface-2); }
.prio button.active.p1 { background: var(--p1-bg); color: var(--p1); font-weight: 700; }
.prio button.active.p2 { background: var(--p2-bg); color: var(--p2); font-weight: 700; }
.prio button.active.p3 { background: var(--p3-bg); color: var(--p3); font-weight: 700; }
.prio button.active.skip { background: var(--surface-2); color: var(--text); font-weight: 700; }
.saved { font-size: 12px; color: var(--muted); min-height: 1em; }
.notes { width: 100%; margin-top: 10px; font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); resize: vertical; }
.notes:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }

@media (max-width: 640px) {
  .card-head { flex-direction: column; }
  .head-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}
