:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c2330;
  --muted: #6a7382;
  --line: #e3e6eb;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --strong: #1f8a4c;
  --consider: #b7791f;
  --marginal: #6a7382;
  --bad: #c0392b;
  --chip: #eef1f6;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --panel: #1a1f27;
    --text: #e6e9ee;
    --muted: #98a1ae;
    --line: #2a313c;
    --accent: #6d8ff0;
    --accent-text: #0e1116;
    --chip: #232a35;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.mainnav { display: flex; gap: 0.3rem; flex: 1; }
.mainnav a, .tabs a {
  padding: 0.35rem 0.75rem; border-radius: 999px; color: var(--muted);
}
.mainnav a[aria-current="page"], .tabs a[aria-current="page"] {
  background: var(--chip); color: var(--text); font-weight: 600;
}
main { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1.5rem 3rem; }

button, .button, select, input[type="search"], input[type="text"] {
  font: inherit; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text);
  padding: 0.35rem 0.75rem;
}
button, .button { cursor: pointer; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button:disabled { opacity: 0.6; cursor: progress; }
.inline { display: inline; }

.flash {
  background: var(--chip); border-left: 4px solid var(--accent);
  padding: 0.6rem 0.9rem; border-radius: 6px; margin: 0 0 1rem;
}
.empty, .muted { color: var(--muted); }
.count {
  display: inline-block; min-width: 1.5em; text-align: center;
  font-size: 0.8rem; color: var(--muted); font-weight: 400;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.filter { display: flex; gap: 0.4rem; }
.filter input[type="search"] { width: 14rem; }
.filter select[name="company"] { max-width: 13rem; }

.badge {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; background: var(--chip); color: var(--muted);
  white-space: nowrap;
}
.tier-strong_apply { background: color-mix(in srgb, var(--strong) 18%, transparent); color: var(--strong); }
.tier-consider { background: color-mix(in srgb, var(--consider) 20%, transparent); color: var(--consider); }
.tier-marginal { color: var(--marginal); }
.tier-dismiss { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.badge.new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); vertical-align: middle; }
.badge.app { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge.ok { background: color-mix(in srgb, var(--strong) 18%, transparent); color: var(--strong); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.score { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 0.3rem; }
.score.big { font-size: 1.2rem; }

.jobs, .apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.job, .card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.job { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 1rem; align-items: start; }
.job .fit { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.title { font-weight: 600; font-size: 1.02rem; color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; color: var(--muted); font-size: 0.88rem; margin-top: 0.15rem; }
.note { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-end; }
.actions form { display: flex; gap: 0.35rem; }
.dismiss summary {
  list-style: none; cursor: pointer; font-size: 0.9rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.75rem;
}
.dismiss summary::-webkit-details-marker { display: none; }
.dismiss[open] summary { border-color: var(--bad); color: var(--bad); }
.dismiss .reasons {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem;
  max-width: 22rem; margin-top: 0.4rem;
}
.dismiss .reasons button { font-size: 0.8rem; padding: 0.2rem 0.6rem; }

.crumbs { margin: 0 0 0.5rem; }
.job-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; margin-bottom: 1rem; }
.head-actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.badges { display: flex; gap: 0.5rem; align-items: center; margin: 0.3rem 0 0; }
.grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; margin-bottom: 1rem; }
.card { margin-bottom: 1rem; }
.grid .card { margin-bottom: 0; }
.summary { font-size: 1rem; }
.scores { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 0.8rem; align-items: center; margin: 0.6rem 0; }
.scores dt { color: var(--muted); font-size: 0.88rem; }
.scores dd { margin: 0; display: flex; gap: 0.5rem; align-items: center; font-variant-numeric: tabular-nums; }
.scores meter { width: 12rem; height: 0.7rem; }
.evidence { padding-left: 1.1rem; }
.evidence li { margin-bottom: 0.5rem; }
.evidence .arrow { color: var(--muted); font-size: 0.8rem; margin: 0 0.4rem; }
.gaps li { margin-bottom: 0.2rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.description { white-space: pre-wrap; font-size: 0.92rem; max-height: 36rem; overflow: auto; }
.history { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }

.group { margin-bottom: 1.5rem; }
.app { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.move { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.move input[type="text"] { width: 12rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
pre.profile { white-space: pre-wrap; background: var(--chip); padding: 0.8rem; border-radius: 8px; max-height: 24rem; overflow: auto; }

@media (max-width: 800px) {
  .job { grid-template-columns: 1fr; }
  .actions { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; }
  .job-head, .app { flex-direction: column; }
  .filter input[type="search"] { width: 100%; }
}

/* account, sign-in and profile editor */
.topbar .account { display: flex; align-items: center; gap: .5rem; margin-left: .75rem; }
.card.narrow { max-width: 34rem; margin: 3rem auto; }
textarea.yaml { width: 100%; box-sizing: border-box; white-space: pre; overflow-wrap: normal; overflow-x: auto; font: .85rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.flash.error { border-color: #c0392b; }
