/* career-ops portal — cream surface, hairline rules, no card chrome.
   Colour is spent twice: plum on the score, muted semantics on status. */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Always reserve the scrollbar gutter — otherwise filtering the table down to
   a few rows removes the scrollbar and the whole layout shifts sideways. */
html { scrollbar-gutter: stable; overflow-y: scroll; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: var(--space-5) var(--space-6) var(--space-6);
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────── */
.head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--hairline);
}
.head-left, .head-right { display: flex; align-items: center; gap: var(--space-5); }

.wordmark {
  font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.02em;
}

/* Tabs carry the person switch — the most-used control, so they read clearly. */
.tabs { display: flex; gap: var(--space-1); }
.tab {
  font: inherit; font-size: var(--fs-body);
  background: none; border: 0; cursor: pointer;
  color: var(--mute);
  padding: var(--space-2) var(--space-3);
  border-radius: 4px;
}
.tab:hover { background: var(--raised); color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); font-weight: 500; background: var(--raised); }

.queue { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--mute); }

.btn {
  font: inherit; font-size: var(--fs-small); font-weight: 500;
  background: var(--fg); color: var(--bg);
  border: 0; border-radius: 4px; cursor: pointer;
  padding: var(--space-2) var(--space-4);
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-quiet {
  background: none; color: var(--mute);
  border: 1px solid var(--hairline);
}
.btn-quiet:hover { background: var(--raised); color: var(--fg); }

/* ── Summary ────────────────────────────────────────────── */
.summary {
  display: flex; gap: var(--space-6);
  padding: var(--space-5) 0 var(--space-4);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-n {
  font-family: var(--font-mono); font-size: var(--fs-stat);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
}
.stat-l {
  font-size: var(--fs-micro); color: var(--mute);
  text-transform: uppercase; letter-spacing: .07em;
}
/* The one stat that means "act on this" carries the accent. */
.stat.is-key .stat-n { color: var(--accent); }

/* ── Controls ───────────────────────────────────────────── */
.controls {
  display: flex; align-items: center; gap: var(--space-3);
  padding-bottom: var(--space-4);
}
.search, .select {
  font: inherit; font-size: var(--fs-small);
  background: transparent; color: var(--fg);
  border: 1px solid var(--hairline); border-radius: 4px;
  padding: var(--space-2) var(--space-3);
}
.search { min-width: 260px; }
.search::placeholder { color: var(--mute); }
.search:focus, .select:focus { outline: 1px solid var(--accent); outline-offset: -1px; }

.toggle {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-small); color: var(--mute); cursor: pointer;
}
.toggle input { accent-color: var(--accent); cursor: pointer; }
.count { margin-left: auto; font-size: var(--fs-small); color: var(--mute); font-family: var(--font-mono); }

/* ── Table ──────────────────────────────────────────────── */
/* Below the widest breakpoint the table scrolls sideways inside this wrapper.
   Every column keeps its full width — nothing is hidden or merged. */
.table-wrap { overflow-x: auto; }

.jobs { width: 100%; border-collapse: collapse; }

.jobs th {
  text-align: left; font-weight: 500;
  font-size: var(--fs-micro); color: var(--mute);
  text-transform: uppercase; letter-spacing: .07em;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  /* 193 rows scroll the column meanings away instantly. */
  position: sticky; top: 0; z-index: 1; background: var(--bg);
}

/* Sorting was already wired but invisible — every sortable header now carries a
   resting mark, so the affordance exists before you think to click it. The
   glyph box is a fixed width in all three states so nothing shifts on click. */
.jobs th[data-sort] { cursor: pointer; user-select: none; }
.jobs th[data-sort]::after {
  content: "↕";
  display: inline-block; width: 1em; margin-left: var(--space-1);
  text-align: center; opacity: .35;
}
.jobs th[data-sort]:hover { color: var(--fg); }
.jobs th[data-sort]:hover::after { opacity: 1; }
.jobs th[aria-sort] { color: var(--fg); }
.jobs th[aria-sort]::after { opacity: 1; }
.jobs th[aria-sort="descending"]::after { content: "↓"; }
.jobs th[aria-sort="ascending"]::after  { content: "↑"; }
.jobs th[data-sort]:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

/* Rows are entries, not cells — enough height to hold two lines of hierarchy. */
.jobs td {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.jobs tbody tr { cursor: pointer; }
.jobs tbody tr:hover { background: var(--raised); }

/* Unevaluated rows recede — they are noise until they have a score. */
.jobs tr.thin td { color: var(--mute); }
.jobs tr.thin .company { font-weight: 400; }

.c-score { text-align: right; white-space: nowrap; width: 1%; padding-right: var(--space-4); }
.c-inr { text-align: right; white-space: nowrap; }
.c-date { white-space: nowrap; width: 1%; }
.c-actions { text-align: right; white-space: nowrap; width: 1%; }

/* THE accent moment: the score, and it anchors the row. Nothing else is plum. */
.score {
  font-family: var(--font-mono); font-size: var(--fs-score);
  color: var(--accent); font-weight: 500;
  letter-spacing: -0.02em;
}
.score.weak { color: var(--mute); font-weight: 400; }   /* below the 4.0 line */
.score-partial { color: var(--mute); font-size: var(--fs-micro); vertical-align: super; }
.score-none { color: var(--rule); font-family: var(--font-mono); font-size: var(--fs-body); }

/* Roles are long ("Senior Open Source Design Engineer") and this is the column
   that loses when eight of them compete — floor it so it never stacks. */
.c-title { min-width: 230px; }

/* Company loud, role quiet beneath it — hierarchy inside one cell. */
.title { display: flex; flex-direction: column; gap: 1px; }
.company { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.01em; }
.role { color: var(--mute); font-size: var(--fs-small); }

/* The title links out to the live posting. Undecorated at rest so it doesn't
   shout in a table where every row is already clickable; the arrow on hover is
   what distinguishes "leaves the page" from "opens the report". */
.title-link { color: inherit; text-decoration: none; }
.title-link:hover .company { text-decoration: underline; text-underline-offset: 2px; }
.title-link:hover .company::after {
  content: " ↗"; color: var(--mute); font-size: var(--fs-small); text-decoration: none;
}
.title-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.loc { color: var(--mute); font-size: var(--fs-small); white-space: nowrap; }
.inr { font-family: var(--font-mono); font-size: var(--fs-body); }

/* Posted date over age — the same two-line hierarchy as company over role. */
.c-date .date, .c-date .age { display: block; }
.date { font-size: var(--fs-small); color: var(--mute); }
.age {
  font-family: var(--font-mono); font-size: var(--fs-micro);
  color: var(--mute); line-height: 1.4;
}
/* A week old or newer, carried by contrast alone — no extra colour. */
.age.fresh { color: var(--fg); }
.date-none { color: var(--rule); }
.cv-yes { color: var(--good); font-size: var(--fs-lg); }
.cv-queued { font-size: var(--fs-micro); color: var(--mute); font-family: var(--font-mono); }

/* Status — muted semantics, never bright */
.pill {
  display: inline-block;
  font-size: var(--fs-micro); letter-spacing: .05em; text-transform: uppercase;
  padding: 2px var(--space-2); border-radius: 2px;
  border: 1px solid currentColor;
}
.s-found     { color: var(--mute); border-color: var(--rule); }
.s-evaluated { color: var(--fg); border-color: var(--hairline); }
.s-dropped   { color: var(--mute); border-color: var(--rule); }
.s-dead      { color: var(--bad); }
.s-rejected  { color: var(--bad); }
.s-applied   { color: var(--mid); }
.s-responded { color: var(--mid); }
.s-interview { color: var(--mid); font-weight: 500; }
.s-offer     { color: var(--good); font-weight: 500; }

/* Actions stay visible but quiet — hidden-until-hover left the right side
   looking empty and gave no hint they existed. */
.acts { display: flex; gap: var(--space-2); justify-content: flex-end; align-items: center; }
.act {
  font: inherit; font-size: var(--fs-micro);
  background: none; border: 1px solid var(--rule); border-radius: 3px;
  color: var(--mute); cursor: pointer; padding: var(--space-1) var(--space-2);
}
.act:hover:not(:disabled) { color: var(--fg); border-color: var(--hairline); background: var(--bg); }
.act:disabled { opacity: .3; cursor: default; }
.act-status { padding: var(--space-1); max-width: 7.5rem; }

.empty { padding: var(--space-6); color: var(--mute); text-align: center; }

/* ── Report panel ───────────────────────────────────────── */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 92vw);
  background: var(--bg); border-left: 1px solid var(--hairline);
  box-shadow: -8px 0 24px rgba(17,17,17,.06);
  display: flex; flex-direction: column;
}
/* `display` beats the hidden attribute — restore it explicitly. */
.panel[hidden] { display: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--hairline);
  font-weight: 500;
}
.panel-body { overflow-y: auto; padding: var(--space-5); }

.panel-body h1 { font-size: var(--fs-title); margin-bottom: var(--space-3); }
.panel-body h2 {
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .06em;
  color: var(--mute); margin: var(--space-5) 0 var(--space-2);
  padding-bottom: var(--space-1); border-bottom: 1px solid var(--rule);
}
.panel-body p { margin-bottom: var(--space-3); }
.panel-body ul { margin: 0 0 var(--space-3) var(--space-4); }
.panel-body li { margin-bottom: var(--space-1); }
.panel-body hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-4) 0; }
.panel-body a { color: var(--fg); }
.panel-body .meta {
  font-family: var(--font-mono); font-size: var(--fs-micro);
  color: var(--mute); line-height: 1.8;
}
.panel-body .meta b { color: var(--fg); font-weight: 400; }

/* ── Responsive ─────────────────────────────────────────────
   Three steps down from the desktop layout. Type and spacing tighten first;
   only once that runs out does the table start scrolling sideways. No column
   is ever hidden or merged — a job you can't see is a job you don't act on. */

/* Laptop — tighten the ladder, keep everything on screen. */
@media (max-width: 1280px) {
  body { padding: var(--space-4) var(--space-5) var(--space-5); }
  .jobs td { padding: var(--space-3); }
  .score { font-size: 22px; }
  .stat-n { font-size: 24px; }
  .company { font-size: var(--fs-body); }
  .loc, .date { font-size: var(--fs-micro); }
  .summary { gap: var(--space-5); }

  /* Eight columns need this much before roles start wrapping into towers.
     Past it the wrapper scrolls — every column keeps its full width. */
  .jobs { min-width: 1120px; }

  /* Clipped content with no cue reads as broken rather than scrollable. These
     four layers are the standard pure-CSS scroll shadow: the cover gradients
     scroll with the table (`local`) and mask the shadows once you reach an end,
     so a shadow shows only on the side that still has content off-screen. */
  .table-wrap {
    background:
      linear-gradient(to right, var(--bg), rgba(242, 238, 227, 0)) left / 24px 100% no-repeat local,
      linear-gradient(to left,  var(--bg), rgba(242, 238, 227, 0)) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%,   rgba(17,17,17,.13), rgba(17,17,17,0)) left / 12px 100% no-repeat,
      radial-gradient(farthest-side at 100% 50%, rgba(17,17,17,.13), rgba(17,17,17,0)) right / 12px 100% no-repeat;
  }
}

/* Tablet — the header splits, and the table starts scrolling in its wrapper. */
@media (max-width: 980px) {
  .head { flex-wrap: wrap; gap: var(--space-3); }
  .head-left, .head-right { flex: 1 1 100%; gap: var(--space-3); }
  /* Wordmark and tabs are one unit — only the action row splits to the edges. */
  .head-left { justify-content: flex-start; }
  .head-right { justify-content: space-between; }
  .summary { flex-wrap: wrap; gap: var(--space-4) var(--space-5); }
  .controls { flex-wrap: wrap; }
  .count { margin-left: 0; flex-basis: 100%; }

  /* Sticky columns and a sideways-scrolling wrapper fight each other. */
  .jobs th { position: static; }

  /* Pointer targets shrink to nothing at this size — give them a real box. */
  .act { min-height: 32px; padding: var(--space-1) var(--space-3); }
  .act-status { max-width: 6.5rem; }
}

/* Phone — full-bleed panel, stacked controls. */
@media (max-width: 640px) {
  body { padding: var(--space-4) var(--space-3) var(--space-5); }
  .head-left, .head-right { flex-wrap: wrap; }
  .summary { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .search { min-width: 0; flex: 1 1 100%; }
  .select { flex: 1 1 auto; }
  /* Its own row — sharing with the select clipped the label off the edge. */
  .toggle { flex: 1 1 100%; }
  .panel { width: 100%; border-left: 0; }
}
