/* Wayfinder's components, then each page's own layout. Every value comes from themes.css.
   The idea is a road sign: one job per screen, said plainly, with size and weight doing the work.
   Rules and white space group things. Boxes are rare. See docs/design.md. */

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--text-lg) / 1.5 var(--sans);
}

a { color: var(--accent); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
summary { cursor: pointer; }
strong, b { font-weight: 700; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.masthead :focus-visible { outline-color: var(--mark); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Page frame ---------- */
.masthead { position: relative; z-index: 30; background: var(--bar); color: var(--on-bar); }

.masthead__inner, main {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

.masthead__inner { display: flex; align-items: stretch; gap: var(--space-xl); min-height: var(--bar-height); }
.masthead__back { display: none; align-self: center; color: var(--on-bar); font-size: var(--text-title); font-weight: 800; text-decoration: none; }
.masthead__page { display: none; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--on-bar);
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav { display: flex; flex: 1; gap: var(--space-2xs); }

.nav a {
  display: flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md) 0;
  border-block: var(--space-xs) solid transparent;
  color: var(--on-bar-soft);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover { color: var(--on-bar); }
.nav a[aria-current="page"] { border-bottom-color: var(--mark); color: var(--on-bar); font-weight: 800; }

/* The account circle holds who you are and everything you rarely need. */
.account { position: relative; align-self: center; margin-left: auto; }
.account > summary { list-style: none; }
.account > summary::-webkit-details-marker { display: none; }

.account__button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--on-bar);
  border-radius: var(--radius-round);
  color: var(--on-bar);
  font-size: var(--text-sm);
  font-weight: 700;
}

.account__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + var(--space-sm));
  right: 0;
  width: 250px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
}

.account__who { margin: 0; padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.account__who strong { display: block; }
.account__who span { color: var(--ink-muted); font-size: var(--text-sm); }
.account__menu form { margin: 0; border-top: 1px solid var(--line); }

.account__menu a, .account__menu button {
  display: block;
  width: 100%;
  min-height: var(--touch-height);
  padding: var(--space-sm) var(--space-lg);
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.account__menu a:hover, .account__menu button:hover { background: var(--surface-raised); }

main { padding-block: var(--space-xl) var(--space-3xl); }

.tabs-bottom { display: none; }

/* ---------- Text ---------- */
.page-title { margin: 0; font-size: var(--text-display); line-height: 1.05; font-weight: 900; letter-spacing: -0.02em; }
.page-note { margin: var(--space-sm) 0 0; color: var(--ink-muted); font-size: var(--text-base); }
.page-note--end { margin-top: var(--space-xl); font-size: var(--text-sm); }
.summary-line { margin: var(--space-sm) 0 0; font-size: var(--text-lg); }
.summary-line strong { font-weight: 800; }
.muted { color: var(--ink-muted); font-size: var(--text-base); }
.hint { margin: 0 0 var(--space-2xs); color: var(--ink-muted); font-size: var(--text-sm); }
.plain { margin: 0; padding-left: var(--space-lg); }

/* A label for a control or a fact. */
.field > label:not(.check), .field > legend, .field__label {
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.4;
  font-weight: 700;
}

/* A section: a heavy rule beneath its heading. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2xs) var(--space-sm);
  margin: var(--space-2xl) 0 0;
  padding-bottom: var(--space-sm);
  border-bottom: var(--rule) solid var(--ink);
}

.section-head h2 { margin: 0; font-size: var(--text-section); line-height: 1.2; font-weight: 800; }
.section-head__count { color: var(--ink-muted); font-size: var(--text-md); }
.section-head__note { color: var(--ink-muted); font-size: var(--text-md); }

/* A section that opens looks like any other section. */
.section-more { margin: var(--space-md) 0 0; font-weight: 700; }
.section-fold > summary { list-style: none; }
.section-fold > summary::-webkit-details-marker { display: none; }
.section-fold__hint { margin-left: auto; color: var(--accent); font-size: var(--text-md); font-weight: 700; }
.section-fold[open] .section-fold__hint { color: var(--ink-muted); }
.section-fold .plain { margin-top: var(--space-md); }

/* ---------- Buttons ---------- */
.button, .action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius);
  cursor: pointer;
  font: 700 var(--text-md) / 1.2 var(--sans);
  list-style: none;
  text-decoration: none;
  white-space: nowrap;
}

.button { background: var(--accent); border: 2px solid var(--accent); color: var(--on-accent); }
.button:hover { filter: brightness(1.15); }
.action { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.action:hover { background: var(--surface-raised); }
.action::-webkit-details-marker { display: none; }
.action--danger { border-color: var(--danger); color: var(--danger); }
.dismiss > summary { border-color: transparent; color: var(--ink-muted); }
.dismiss > summary:hover { color: var(--ink); }

.link-button {
  min-height: var(--control-height);
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-md);
  text-decoration: underline;
}

/* ---------- Form controls ---------- */
input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"], [type="file"]), select, textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font: 400 var(--text-base) / 1.4 var(--sans);
}

input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"], [type="file"]):focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
input[type="file"] { color: var(--ink); font: inherit; font-size: var(--text-md); }
textarea { display: block; resize: vertical; }
::placeholder { color: var(--placeholder); }

select {
  appearance: none;
  padding-right: var(--space-2xl);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.field { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
fieldset.field { gap: var(--space-md); }
.field > legend { margin-bottom: var(--space-xs); }

.check { display: flex; align-items: center; gap: var(--space-sm); color: var(--ink-soft); cursor: pointer; font-size: var(--text-md); }
.check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check--consent { align-items: flex-start; color: var(--ink); }
.check--consent input { margin-top: var(--space-xs); }

.choices { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); padding-block: var(--space-xs); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: start; gap: var(--space-md); }

/* A column of fields, with buttons at their natural width. */
.stack { display: grid; gap: var(--space-lg); margin-top: var(--space-xl); }
.stack > .button, .stack > .action, .stack > .link-button { justify-self: start; }

.disclosure > summary { color: var(--accent); font-size: var(--text-md); font-weight: 700; }
.disclosure > .form-grid, .disclosure > .stack { margin-top: var(--space-md); }

/* A list typed as removable chips. Without JavaScript, the textarea stays. */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--control-height);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: text;
}

.chips:focus-within { border-color: var(--ink); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) var(--space-xs) var(--space-2xs) var(--space-sm);
  background: var(--accent-tint);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chip__remove {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
}

.chip__remove:hover { color: var(--ink); }

.chips input:not([type="hidden"]) {
  flex: 1 1 140px;
  width: auto;
  min-width: 0;
  min-height: 28px;
  padding: 0 var(--space-xs);
  background: none;
  border: 0;
  outline: 0;
}

/* A range with two handles. */
.range { display: grid; gap: var(--space-xs); }
.range__value { color: var(--ink); font-size: var(--text-md); line-height: 1.4; }
.range__track { position: relative; height: var(--control-height); }

.range__track::before, .range__track::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
}

.range__track::before { right: 0; left: 0; background: var(--line); }

/* Set by range.js, because the handles' positions can't be known here. */
.range__track::after {
  right: calc(100% - var(--range-to, 100%));
  left: var(--range-from, 0%);
  background: var(--accent);
}

.range input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; background: none; pointer-events: none; }

.range input::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  appearance: none;
  background: var(--surface);
  border: 3px solid var(--accent);
  border-radius: var(--radius-round);
  cursor: pointer;
  pointer-events: auto;
}

.range input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 3px solid var(--accent);
  border-radius: var(--radius-round);
  cursor: pointer;
  pointer-events: auto;
}

/* ---------- Messages ----------
   Four kinds, plus the toast: a page note says what a page is, a notice says what's happening,
   a warning says something's wrong, and an empty state says why nothing is here. */
.notice {
  margin-block: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-tint);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--text-md);
}

.notice p { margin: 0 0 var(--space-sm); }
.notice p:last-child { margin-bottom: 0; }
.notice form { margin: 0; }

/* A warning reads like a road sign: solid, with a diamond. */
.signal {
  position: relative;
  margin-block: var(--space-lg);
  padding: var(--space-md) var(--space-lg) var(--space-md) var(--space-2xl);
  border-radius: var(--radius);
  font-size: var(--text-md);
}

.signal::before {
  content: "";
  position: absolute;
  top: 19px;
  left: var(--space-lg);
  width: 9px;
  height: 9px;
  background: currentcolor;
  transform: rotate(45deg);
}

.signal strong { display: block; font-weight: 800; }
.signal--serious { background: var(--signal); color: var(--on-signal); }
.signal--caution { background: var(--signal-tint); color: var(--ink); }
.signal--closed { background: var(--surface-raised); color: var(--ink); }

.empty { margin-top: var(--space-xl); }
.empty h2 { margin: 0 0 var(--space-xs); font-size: var(--text-empty); line-height: 1.15; font-weight: 900; }
.empty p { margin: 0 0 var(--space-sm); }
.empty p:last-child { margin-bottom: 0; }

/* A warning on a list: a diamond with breathing room, then plain words. */
.marks { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); margin: var(--space-sm) 0 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.mark { display: inline-flex; align-items: center; font-weight: 700; }
.mark--quiet { color: var(--ink-muted); font-weight: 400; }

.mark--warn::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0 var(--space-md) 0 var(--space-xs);
  background: var(--signal);
  outline: 1px solid var(--ink);
  transform: rotate(45deg);
}

.tag { font-size: var(--text-sm); font-weight: 700; }
.tag--serious, .tag--caution { color: var(--ink); }
.tag--minor { color: var(--ink-muted); font-weight: 400; }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); }

.toast {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  left: var(--space-lg);
  z-index: 100;
  max-width: 420px;
  margin-inline: auto;
  padding: var(--space-md) var(--space-lg);
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--bg);
  font-size: var(--text-md);
}

.toast__undo { padding: 0; background: none; border: 0; color: var(--mark); cursor: pointer; font: inherit; font-weight: 800; }

/* ---------- A job ----------
   One component in two sizes: the full size is for deciding, and the row is for scanning. */
.job {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: var(--space-2xs) var(--space-md);
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--line);
}

.job__fit { min-width: 0; }
.job__main { min-width: 0; }
.job__title { margin: 0; font-size: var(--text-title); line-height: 1.2; font-weight: 800; }
.job__title a { color: var(--accent); text-decoration: none; }
.job__title a:hover { text-decoration: underline; }

.job__who { display: flex; align-items: center; gap: var(--space-sm); margin: var(--space-xs) 0 0; font-size: var(--text-md); }
.job__company { color: var(--ink); font-weight: 700; }
.job__company-link { display: inline-flex; align-items: center; gap: var(--space-sm); text-decoration: none; }
.job__company-link .job__company { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.job__company-link:hover .job__company { color: var(--accent); }
.job__new { color: var(--accent); font-weight: 800; }
.marked.job__judged { margin-top: var(--space-md); max-width: 68ch; gap: var(--space-xs); }
.job__rank { width: fit-content; margin: var(--space-sm) 0 0; padding-top: var(--space-xs); border-top: 1px solid var(--line); color: var(--ink-muted); font-size: var(--text-sm); }
.job__note { margin: var(--space-xs) 0 0; color: var(--ink-muted); font-size: var(--text-sm); }
.job__date { margin: 0; color: var(--ink-muted); font-size: var(--text-md); white-space: nowrap; }

/* Actions sit above the job's stretched link. */
.job__actions { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: var(--space-xs); }
.job__actions .share--icon { margin-top: var(--space-sm); }
.none { color: var(--ink-muted); }

/* Each fact has its own label and place, and lines up from one job to the next. */
.facts { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 0.6fr); gap: var(--space-sm) var(--space-lg); margin: var(--space-md) 0 0; max-width: 620px; }
.facts dt { color: var(--ink-muted); font-size: var(--text-xs); line-height: 1.3; }
.facts dd { margin: 0; font-size: var(--text-base); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.logo {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  background: var(--logo-tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--logo-ink);
  font-size: var(--text-logo);
  line-height: 1;
  font-weight: 700;
}

.logo img { position: absolute; inset: 0; width: 100%; height: 100%; padding: var(--space-2xs); background: var(--logo-tile); object-fit: contain; }

/* Fit: a number plus the word that says what it means. Colour is never alone. */
.fit { min-width: 0; }
.fit__number { display: block; font-size: var(--text-fit); line-height: 1; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fit__band { display: block; margin-top: var(--space-xs); font-size: var(--text-xs); line-height: 1.2; font-weight: 700; }
.fit--strong .fit__number, .fit--strong .fit__band { color: var(--accent); }
.fit--good .fit__number, .fit--good .fit__band { color: var(--ink); }
.fit--stretch .fit__number, .fit--stretch .fit__band { color: var(--ink-muted); }

/* The row: columns on a wide screen, labelled facts on a phone. */
.jobs-head, .job--row { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 540px) 28px; }
.job--row { padding-block: var(--space-md); }
.job--row .job__title { font-size: var(--text-lg); }
.job--row .job__who { margin-top: var(--space-2xs); color: var(--ink-muted); }
.job--row .job__company { font-weight: 400; color: var(--ink-muted); }
.job--row .logo { display: none; }
.job--row .fit__number { font-size: var(--text-fit-row); }
.job--row .fit__band { display: none; }
.job--row .marks { margin-top: var(--space-xs); }
.job--row .facts { margin: 0; max-width: none; grid-template-columns: 190px 90px 110px 70px; align-items: baseline; }
.job--row .facts dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.job--row .facts dd { font-size: var(--text-md); font-weight: 400; }
.job--decided { grid-template-columns: 52px minmax(0, 1fr) auto; padding-block: var(--space-md); }
.job--decided .job__title { font-size: var(--text-lg); }
.job--decided .job__who { margin-top: var(--space-2xs); }
.job--decided .job__company { font-weight: 400; color: var(--ink-muted); }
.job--decided .fit__number { font-size: var(--text-fit-row); }
.job--decided .fit__band { display: none; }

/* ---------- Decisions ---------- */
.decide, .decide__form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin: 0; }
.decide__state { font-size: var(--text-md); font-weight: 800; color: var(--accent); }
.dismiss { position: relative; }
.dismiss[open] > summary { color: var(--ink); }
.dismiss__reasons { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-sm); }
.job--full .dismiss__reasons { position: absolute; z-index: 5; top: 100%; right: 0; width: 280px; padding: var(--space-sm); background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); }
.dismiss__reasons .action { min-height: 38px; padding-inline: var(--space-sm); border-width: 1px; font-weight: 600; }

/* ---------- Jobs ---------- */

.filters { display: grid; gap: var(--space-md); margin-top: var(--space-md); }
.filters__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-md); }
.filters__word { flex: 1 1 240px; }
.filters__more > summary { width: fit-content; }
.filters__more[open] { flex-basis: 100%; }
.filters__panel { display: grid; gap: var(--space-lg); margin-top: var(--space-md); padding: var(--space-lg); background: var(--surface-raised); border-radius: var(--radius); }
.filter-group > legend { margin-bottom: var(--space-sm); font-weight: 800; }
.filter-group .choices { margin-top: var(--space-sm); }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.list-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-lg); }
.list-bar__count { margin: 0; font-size: var(--text-section); font-weight: 800; }
.list-bar__sort { display: flex; align-items: center; gap: var(--space-sm); color: var(--ink-muted); font-size: var(--text-md); }
.list-bar__sort label { flex: none; }
.list-bar__sort select { width: auto; }

.jobs-head__sort { padding: 0; background: none; border: 0; color: inherit; font: inherit; font-weight: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.jobs-head__sort[aria-pressed="true"] { color: var(--accent); }
.search-panel { gap: var(--space-sm); justify-items: start; }
.search-panel__empty { color: var(--danger); font-weight: 700; }
.jobs-head {
  display: grid;
  gap: var(--space-md);
  padding-block: var(--space-sm) var(--space-xs);
  border-bottom: var(--rule) solid var(--ink);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.jobs-head span:nth-child(n+3) { display: none; }

/* The three facts' headings line up with the row's columns. */
@media (min-width: 981px) {
  .jobs-head { grid-template-columns: 52px minmax(0, 1fr) 190px 90px 110px 70px 28px; }
  .jobs-head span:nth-child(n+3) { display: block; }
  .jobs-head { column-gap: var(--space-md); }
  .job--row { grid-template-columns: 52px minmax(0, 1fr) auto 28px; }
  .job--row .facts { column-gap: var(--space-md); }
}

.jobs-more { display: flex; margin: var(--space-lg) auto 0; }

/* ---------- A job's own page ---------- */
.back { display: inline-block; margin-bottom: var(--space-md); font-size: var(--text-md); font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.posting-head { display: flex; align-items: flex-start; gap: var(--space-md); }
.posting-head__main { flex: 1; min-width: 0; }
.posting-head__company { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 var(--space-xs); color: var(--ink-muted); font-size: var(--text-base); }
.posting-head__company strong { color: var(--ink); font-weight: 700; }
.posting-head__company > span { margin-left: var(--space-md); }
.posting-head__company .share { margin-left: auto; }
.logo--large { width: 48px; height: 48px; }
.facts--key { margin-top: var(--space-lg); max-width: none; grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); gap: var(--space-sm) var(--space-2xl); }
.facts--key dd { font-size: var(--text-lg); font-weight: 700; }

.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-lg); margin-top: var(--space-xl); }
.verdict__score .fit__number { font-size: var(--text-fit-large); }
.verdict__scale { display: block; color: var(--ink-muted); font-size: var(--text-xs); }
.verdict__heading { margin: 0; font-size: var(--text-section); line-height: 1.2; font-weight: 800; }
.verdict__sentence { margin: var(--space-xs) 0 0; max-width: 62ch; }

.posting-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-lg); }
.posting-actions__short { display: none; }
.posting-actions .button { font-size: var(--text-base); }
.posting-after { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-md); font-size: var(--text-md); }
.posting-after__next { font-weight: 800; }
.posting-note { flex: 1 1 100%; }
.posting-after__next + .posting-note { flex-basis: auto; }
.posting-note[open] { flex-basis: 100%; }
.posting-note > summary, .posting-more > summary, .posting-judged > summary { color: var(--accent); font-size: var(--text-md); font-weight: 700; }
.posting-note .field { max-width: 620px; margin: var(--space-sm) 0; }

.posting-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-2xl); margin-top: var(--space-md); }
.panel { margin-top: var(--space-lg); }
.panel__heading { margin: 0 0 var(--space-md); padding-bottom: var(--space-sm); border-bottom: var(--rule) solid var(--ink); font-size: var(--text-section); line-height: 1.2; font-weight: 800; }
.panel__note { margin: var(--space-sm) 0 0; color: var(--ink-muted); font-size: var(--text-sm); }
.panel .tags { margin-top: var(--space-sm); }

.marked { display: grid; gap: var(--space-sm); margin: 0; padding: 0; list-style: none; font-size: var(--text-base); }
.marked li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-xs); }
.marked__mark { font-weight: 900; }
.marked__mark--yes { color: var(--accent); }
.marked__mark--gap { color: var(--danger); }

.fact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-md); margin: 0; }
.fact-list dt, .posting-more__label { color: var(--ink-muted); font-size: var(--text-xs); line-height: 1.3; }
.fact-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.posting-more { margin-top: var(--space-md); }
.posting-flags { margin-top: var(--space-md); }
.posting-more > .fact-list { margin-top: var(--space-md); }
.posting-more__label { margin: var(--space-md) 0 var(--space-xs); }

.history__sentence { margin: 0; }
.history__bar { display: block; width: 100%; height: 8px; margin-top: var(--space-sm); }
.history__stretch { fill: var(--accent); }
.history__stretch--closed { fill: var(--line); }
.history__range { display: flex; justify-content: space-between; margin: var(--space-2xs) 0 0; color: var(--ink-muted); font-size: var(--text-xs); }

.timeline { margin: var(--space-md) 0 0; padding: 0; list-style: none; }
.timeline__event { position: relative; padding: 0 0 var(--space-md) var(--space-xl); font-size: var(--text-md); }
.timeline__event::before { content: ""; position: absolute; top: 7px; left: 4px; width: 9px; height: 9px; background: var(--ink-muted); transform: rotate(45deg); }
.timeline__event::after { content: ""; position: absolute; top: 18px; bottom: -6px; left: 8px; width: 1px; background: var(--line-strong); }
.timeline__event:last-child::after { display: none; }
.timeline__event:first-child::before { background: var(--accent); }
.timeline__event--alert::before, .timeline__event--alert:first-child::before { background: var(--signal); outline: 1px solid var(--ink); }
.timeline time { display: block; color: var(--ink-muted); font-size: var(--text-xs); }

.jump { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin: var(--space-md) 0; font-size: var(--text-md); }
.jump[hidden] { display: none; }
.jump__label { color: var(--ink-muted); }

.prose { max-width: 68ch; margin-top: var(--space-md); color: var(--ink-soft); font-size: var(--text-lg); line-height: 1.6; overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4 { margin: var(--space-xl) 0 var(--space-sm); color: var(--ink); font-size: var(--text-title); line-height: 1.25; font-weight: 800; }
.prose p { margin: 0 0 var(--space-md); }
.prose ul, .prose ol { margin: 0 0 var(--space-md); padding-left: var(--space-lg); }
.prose li { margin-bottom: var(--space-xs); }
.prose strong, .prose b { color: var(--ink); font-weight: 700; }
.prose [id] { scroll-margin-top: var(--space-lg); }
.prose--plain { white-space: pre-wrap; }
.prose .prose__aside, .prose .prose__aside strong, .prose .prose__aside b { color: var(--ink-muted); font-size: var(--text-md); }

.posting-judged { margin-top: var(--space-2xl); color: var(--ink-muted); font-size: var(--text-md); }
.posting-judged p { margin: var(--space-sm) 0 0; }

/* ---------- Usage ---------- */
.meter { margin-top: var(--space-md); }
.meter__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-md); }
.meter__label { font-weight: 700; overflow-wrap: anywhere; }
.meter__value { color: var(--ink-muted); font-size: var(--text-md); white-space: nowrap; }
.meter__value strong { color: var(--ink); font-weight: 800; }
.meter__track { display: block; width: 100%; height: 10px; margin-top: var(--space-xs); background: var(--accent-tint); }
.meter__fill { fill: var(--accent); }
.meter--near .meter__track { background: var(--signal-tint); }
.meter--near .meter__fill { fill: var(--signal); }
.meter--over .meter__track { background: var(--danger-tint); }
.meter--over .meter__fill { fill: var(--danger); }
.meter__note { margin: var(--space-xs) 0 0; font-size: var(--text-sm); font-weight: 700; }
.meter--over .meter__note { color: var(--danger); }

.health { margin: var(--space-md) 0 0; font-size: var(--text-base); }
.health strong { display: block; font-size: var(--text-title); font-weight: 800; }
.health--problem strong { color: var(--danger); }
.invite { margin-top: var(--space-md); }
.invite > summary { width: fit-content; }
.invite .stack { max-width: 480px; margin-top: var(--space-md); }
.person { padding-block: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--line); }
.person__meta { margin: var(--space-xs) 0 0; color: var(--ink-muted); font-size: var(--text-sm); }
.person__manage { margin-top: var(--space-xs); font-size: var(--text-sm); }
.person__manage > summary { color: var(--accent); font-weight: 700; }
.person__manage form { margin-top: var(--space-sm); }

/* ---------- Companies ---------- */
.company-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-md); padding-block: var(--space-md); border-bottom: 1px solid var(--line); }
.logo--list { width: 36px; height: 36px; }
.company-row__main { min-width: 0; }
.company-row__name { margin: 0; font-size: var(--text-lg); line-height: 1.3; font-weight: 800; }
.company-row__name a { color: var(--accent); text-decoration: none; }
.company-row__name a:hover { text-decoration: underline; }
.company-row__about { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: var(--space-2xs) 0 0; max-width: 68ch; color: var(--ink-soft); font-size: var(--text-md); }
.company-row__jobs { color: var(--ink-muted); font-size: var(--text-md); text-align: right; white-space: nowrap; }
.company-row__jobs p { margin: 0; }
.company-row__fits { color: var(--accent); font-weight: 800; }
.company-filter { margin-top: var(--space-md); }
.company-about { margin: var(--space-md) 0 0; max-width: 68ch; }
.company-hiring { margin: var(--space-md) 0 0; font-size: var(--text-base); }
.company-hiring strong { font-weight: 800; }
.company-details { display: grid; gap: var(--space-sm); margin: var(--space-md) 0 0; max-width: 68ch; }
.company-details dt { color: var(--ink-muted); font-size: var(--text-sm); }
.company-details dd { margin: 0; font-size: var(--text-base); }
.company-history { margin: var(--space-md) 0; font-size: var(--text-base); }
.share { position: relative; display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); font: inherit; font-size: var(--text-sm); font-weight: 700; cursor: pointer; white-space: nowrap; }
.share:hover { border-color: var(--accent); color: var(--accent); }
.share__icon { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share--icon { grid-row: 1; grid-column: -2; align-self: start; justify-self: end; padding: var(--space-2xs); border: 0; color: var(--ink-muted); }
.share--icon .share__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.share--icon.is-said .share__label { top: 100%; right: 0; width: auto; height: auto; overflow: visible; clip-path: none; padding: var(--space-2xs) var(--space-xs); background: var(--ink); color: var(--surface); }
.job__moved { color: var(--accent); font-weight: 700; text-decoration: none; }
.mark__link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
a.fit { display: block; text-decoration: none; }
a.fit:hover .fit__band { text-decoration: underline; }
.job .mark { font-weight: 400; }
.job .mark--serious { font-weight: 700; }
.job__status { margin: var(--space-2xs) 0 0; color: var(--accent); font-size: var(--text-md); font-weight: 700; }
.company-recognition { margin: var(--space-sm) 0 0; font-size: var(--text-base); }
.company-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); margin: var(--space-md) 0 0; font-weight: 700; font-size: var(--text-md); }

/* ---------- Admin watch list ---------- */
.admin-add { margin-top: var(--space-lg); }
.section-head--alert h2::before { content: "◆ "; color: var(--signal); -webkit-text-stroke: 1px var(--ink); }
.watch-head, .watch-row__line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 80px 190px 50px; gap: var(--space-2xs) var(--space-md); align-items: baseline; }
.watch-head { padding-block: var(--space-xs); border-bottom: 2px solid var(--ink); color: var(--ink-muted); font-size: var(--text-sm); font-weight: 700; }
.watch-row { border-bottom: 1px solid var(--line); }
.watch-row__line { padding-block: var(--space-sm); cursor: pointer; font-size: var(--text-md); list-style: none; }
.watch-row__line::-webkit-details-marker { display: none; }
.watch-row__name { font-size: var(--text-base); font-weight: 800; min-width: 0; }
.watch-row__name a { color: var(--accent); text-decoration: none; }
.watch-row__name a:hover { text-decoration: underline; }
.watch-row__board, .watch-row__about, .watch-row__older { color: var(--ink-muted); }
.watch-row__open { font-weight: 700; }
.watch-row__edit { color: var(--accent); font-weight: 700; text-align: right; }
.watch-row[open] .watch-row__edit { color: var(--ink-muted); }
.watch-row__problem, .watch-row__older { grid-column: 1 / -1; }
.watch-row__problem strong { font-weight: 800; }
.watch-row__panel { display: grid; gap: var(--space-md); max-width: 560px; padding-block: var(--space-sm) var(--space-lg); }
.watch-row__panel form { margin: 0; }

/* ---------- Documents ---------- */
.docs { margin-top: var(--space-lg); }
.docs.is-over .doc-list, .docs.is-over .docs__empty { outline: 3px dashed var(--accent); outline-offset: 3px; }
.docs__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-xs) var(--space-lg); padding-bottom: var(--space-sm); border-bottom: var(--rule) solid var(--ink); }
.docs__head h2 { margin: 0; font-size: var(--text-section); font-weight: 800; line-height: 1.2; }
.docs__add { padding: var(--space-sm) var(--space-md); background: none; border: 2px solid var(--ink); border-radius: var(--radius); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.docs__add:hover { border-color: var(--accent); color: var(--accent); }
.docs__empty { display: grid; justify-items: center; gap: var(--space-sm); margin-top: var(--space-md); padding: var(--space-xl) var(--space-lg); border: 2px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.docs__empty p { margin: 0; }
.docs__hint { margin: var(--space-sm) 0 0; color: var(--ink-muted); font-size: var(--text-sm); }
.docs__more { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); margin-top: var(--space-md); font-size: var(--text-md); }
.docs__fold { margin-top: var(--space-sm); padding: var(--space-md); background: var(--surface-raised); border-radius: var(--radius); }
.docs__fold label { display: block; font-size: var(--text-md); font-weight: 700; }
.docs__fold input, .docs__fold textarea { width: 100%; margin-top: var(--space-sm); }
.docs__fold-actions { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-sm); }
.docs__update { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-lg); padding: var(--space-md); background: var(--accent-tint); border-radius: var(--radius); }
.docs__update strong { display: block; font-weight: 800; }
.docs__update span { color: var(--ink-soft); font-size: var(--text-md); }
.docs__working { margin-top: var(--space-lg); padding: var(--space-md); background: var(--surface-raised); border-left: var(--rule) solid var(--accent); }
.docs__working p { margin: var(--space-xs) 0 0; color: var(--ink-soft); font-size: var(--text-md); }
.docs__working-line { display: flex; align-items: center; gap: var(--space-sm); color: var(--ink) !important; font-size: var(--text-base) !important; }
.docs__spin { flex: none; width: var(--space-lg); height: var(--space-lg); border: 3px solid var(--line); border-top-color: var(--accent); border-radius: var(--radius-round); animation: docs-spin 0.8s linear infinite; }
@keyframes docs-spin { to { transform: rotate(360deg); } }
.docs__failed { margin: var(--space-lg) 0 0; padding: var(--space-md); background: var(--danger-tint); border-left: var(--rule) solid var(--danger); }
.docs__review { margin: var(--space-sm) 0 0; padding: var(--space-md); background: var(--signal-tint); border-radius: var(--radius); }
.doc-consent-note { margin: var(--space-xs) 0 0; color: var(--danger); font-size: var(--text-md); font-weight: 700; }
.doc-row__main .doc-row__status--new { color: var(--accent); font-weight: 700; }
.doc-row__main .doc-row__status--bad { color: var(--danger); font-weight: 700; }
.doc-row__main-tag { font-weight: 700; }
.doc-row__bar { flex-basis: 100%; height: 4px; background: var(--line); overflow: hidden; }
.doc-row__bar i { display: block; width: 40%; height: 100%; background: var(--accent); animation: docs-slide 1s ease-in-out infinite alternate; }
@keyframes docs-slide { from { margin-left: 0; } to { margin-left: 60%; } }
.exp-row__tag { padding: 0 var(--space-xs); background: var(--accent); border-radius: var(--radius); color: var(--on-accent); font-size: var(--text-xs); font-weight: 800; }
.exp-row__tag--changed { background: var(--signal); color: var(--ink); }
@media (pointer: coarse) { .docs__drop { display: none; } }
@media (prefers-reduced-motion: reduce) { .docs__spin, .doc-row__bar i { animation: none; } }

/* ---------- How it works ---------- */
.reading .section-head { scroll-margin-top: var(--bar-height); }
.route { position: relative; display: grid; max-width: 620px; grid-template-columns: minmax(0, 1fr) var(--space-xl); column-gap: var(--space-sm); margin: var(--space-md) 0 0; padding: 0; list-style: none; }
.stop { position: relative; grid-column: 1; display: grid; grid-template-columns: var(--space-xl) minmax(0, 1fr); column-gap: var(--space-sm); padding-bottom: var(--space-md); }
.stop:nth-child(1) { grid-row: 1; }
.stop:nth-child(2) { grid-row: 2; }
.stop:nth-child(3) { grid-row: 3; }
.stop:nth-child(4) { grid-row: 4; }
.stop:nth-child(5) { grid-row: 5; }
.stop:nth-child(6) { grid-row: 6; }
.stop::before { content: ""; position: absolute; left: calc(var(--space-xl) / 2 - 2px); top: var(--space-xs); bottom: calc(var(--space-xs) * -1); width: 4px; background: var(--accent); }
.stop:nth-child(6)::before { display: none; }
.stop__dot { position: relative; width: var(--space-xl); height: var(--space-xl); border: 4px solid var(--accent); border-radius: var(--radius-round); background: var(--surface); }
.stop--you .stop__dot { background: var(--accent); }
.stop__body > summary { display: block; cursor: pointer; list-style: none; }
.stop__body > summary::-webkit-details-marker { display: none; }
.stop__who { display: block; color: var(--ink-muted); font-size: var(--text-sm); font-weight: 700; }
.stop--you .stop__who { color: var(--accent); }
.stop__title { display: block; font-size: var(--text-lg); font-weight: 800; line-height: 1.25; }
.stop__title::after { content: " +"; color: var(--accent); }
.stop__body[open] .stop__title::after { content: " −"; }
.stop__summary { display: block; color: var(--ink-soft); font-size: var(--text-md); }
.stop__more { margin: var(--space-xs) 0 0; padding: var(--space-sm); background: var(--surface-raised); font-size: var(--text-md); }
.route__loop { position: relative; grid-column: 2; grid-row: 4 / 7; margin: var(--space-sm) 0 var(--space-xl); border: 3px dashed var(--accent); border-left: 0; border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.route__loop::before { content: "◀"; position: absolute; top: calc(var(--space-md) * -1); left: calc(var(--space-sm) * -1); color: var(--accent); font-size: var(--text-sm); }
.route__note { margin: 0; padding: var(--space-sm); background: var(--accent-tint); color: var(--accent); font-size: var(--text-md); font-weight: 700; }
.how-job { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--space-sm); padding-block: var(--space-md); border-bottom: 1px solid var(--line); }
.how-job .fit__number { display: inline; }
.how-job__main { min-width: 0; }
.how-job__title { color: var(--accent); }
.how-job__company { text-decoration: underline; text-underline-offset: 3px; }
.how-job__facts { margin: var(--space-xs) 0 0; color: var(--ink-muted); font-size: var(--text-sm); }
.pin { display: inline-grid; place-items: center; width: var(--space-lg); height: var(--space-lg); padding: 0; border: 0; border-radius: var(--radius-round); background: var(--ink); color: var(--surface); font-family: inherit; font-size: var(--text-xs); font-weight: 800; line-height: 1; vertical-align: middle; }
button.pin { margin-left: var(--space-xs); cursor: pointer; }
.pin.is-on { background: var(--signal); color: var(--ink); }
.how-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm) var(--space-lg); margin: var(--space-md) 0 0; padding: 0; list-style: none; font-size: var(--text-md); }
.how-legend li { display: flex; gap: var(--space-sm); padding: var(--space-2xs); }
.how-legend li.is-on { background: var(--signal-tint); }
.how-legend .pin { flex: none; }
.how-legend strong { display: block; }
.fit-scale { position: relative; display: grid; grid-template-columns: 60fr 20fr 20fr; gap: var(--space-2xs); margin-top: var(--space-xl); }
.fit-scale__mark { position: absolute; left: 84%; top: calc(var(--space-lg) * -1 - var(--space-2xs)); transform: translateX(-50%); color: var(--accent); font-size: var(--text-sm); font-weight: 800; white-space: nowrap; }
.fit-scale__band { padding: var(--space-xs) var(--space-sm); font-size: var(--text-md); font-weight: 800; }
.fit-scale__band span { display: block; font-size: var(--text-sm); font-weight: 400; }
.fit-scale__band--stretch { background: var(--surface-raised); color: var(--ink-muted); }
.fit-scale__band--good { background: var(--ink); color: var(--surface); }
.fit-scale__band--strong { background: var(--accent); color: var(--on-accent); }
.how-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin-top: var(--space-md); font-size: var(--text-md); }
.how-pair p { margin: 0; padding-top: var(--space-xs); border-top: 2px solid var(--line); }
.how-pair strong { display: block; }
.how-moves { margin-top: var(--space-md); }
.how-warnings { border-bottom: 1px solid var(--line); }
.how-warnings > summary { padding-block: var(--space-sm); cursor: pointer; font-weight: 800; }
.how-warnings dl { margin: 0 0 var(--space-sm); }
.how-warnings dl div { padding-block: var(--space-xs); }
.how-warnings dt { font-weight: 700; }
.how-warnings dd { margin: 0; color: var(--ink-soft); font-size: var(--text-md); }
.how-limits { margin: var(--space-md) 0 0; padding-left: var(--space-lg); }

/* ---------- Sign in ---------- */
.login { max-width: 400px; margin: var(--space-xl) auto 0; }
.login__message { min-height: 24px; margin-top: var(--space-md); color: var(--danger); font-size: var(--text-md); }

/* ---------- Account ---------- */
.danger-form { display: grid; gap: var(--space-sm); max-width: 320px; margin-bottom: var(--space-lg); }
.danger-form .action { justify-self: start; }
.reading .page-title { margin-bottom: var(--space-sm); color: var(--ink); }
.reading h2 { margin-top: var(--space-xl); font-size: var(--text-section); }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: var(--space-lg); margin: var(--space-sm) 0 var(--space-lg); border-bottom: var(--rule) solid var(--ink); }
.tabs a { padding-block: var(--space-sm) var(--space-xs); border-bottom: var(--space-xs) solid transparent; color: var(--ink-muted); font-weight: 600; text-decoration: none; }
.tabs a[aria-current="page"] { border-bottom-color: var(--mark); color: var(--ink); font-weight: 800; }
.admin-result { margin-top: var(--space-lg); padding: var(--space-lg); background: var(--surface-raised); border-radius: var(--radius); }
.admin-result .stack { margin-top: var(--space-md); }
.admin-result__count { margin: 0; }
.sample-titles { margin: var(--space-sm) 0 0; padding-left: var(--space-lg); color: var(--ink-soft); font-size: var(--text-sm); }

/* Setup steps, shown at the top of each step. */
.setup-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); margin: 0 0 var(--space-sm); padding: 0; list-style: none; }
.setup-steps__item { padding-top: var(--space-sm); border-top: var(--space-xs) solid var(--line); color: var(--ink-muted); font-size: var(--text-sm); }
.setup-steps__item--done { border-top-color: var(--accent); color: var(--ink); font-weight: 700; }
.setup-note { margin: var(--space-md) 0 var(--space-xs); color: var(--ink-muted); font-size: var(--text-sm); line-height: 1.4; }
.setup-account { margin-top: var(--space-2xl); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); }

/* A person's files and links. */
.doc-list { display: grid; margin: var(--space-md) 0 0; padding: 0; list-style: none; }
.doc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); padding-block: var(--space-md); border-bottom: 1px solid var(--line); }
.doc-row__main { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.doc-row__main strong, .doc-row__main span { display: block; }
.doc-row__main span { color: var(--ink-muted); font-size: var(--text-sm); }
.doc-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); font-size: var(--text-md); }
.doc-row__actions form { margin: 0; }
.found-links { padding: var(--space-md); background: var(--surface-raised); border-radius: var(--radius); }
.found-links > .action { justify-self: start; width: fit-content; margin-top: var(--space-sm); }

/* A type of work, closed to its summary until someone changes it. */
.exp-list { display: grid; }
.exp-row { padding-block: var(--space-md); border-bottom: 1px solid var(--line); }
.exp-row > summary span { display: block; color: var(--ink-muted); font-size: var(--text-md); }
.exp-row--blank > summary { color: var(--accent); }
.exp-row__fields { margin-top: var(--space-md); }

/* One row of mutually exclusive choices. */
.seg-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); padding-block: var(--space-sm); border-bottom: 1px solid var(--line); }
.seg-row > legend { float: left; padding: 0; color: var(--ink); font: inherit; font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg__option { position: relative; cursor: pointer; }
.seg__option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__option span { display: block; padding: var(--space-xs) var(--space-md); color: var(--ink-soft); font-size: var(--text-sm); font-weight: 600; }
.seg__option input:checked + span { background: var(--ink); color: var(--bg); font-weight: 800; }
.seg__option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Job titles, grouped by field. Each is Want, Consider or neither. */
.picker__search { max-width: 480px; }
.picker__chosen { display: grid; gap: var(--space-xs); padding-block: var(--space-xs); }
.picker__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.picker__word { min-width: 72px; color: var(--ink-muted); font-size: var(--text-sm); font-weight: 700; }
.picker__groups { border-top: var(--rule) solid var(--ink); }
.picker__group { border-bottom: 1px solid var(--line); }
.picker__group > summary { display: flex; align-items: center; gap: var(--space-md); min-height: var(--touch-height); cursor: pointer; }
.picker__group > summary { list-style: none; }
.picker__group > summary::-webkit-details-marker { display: none; }
.picker__group > summary::before { content: "▸"; color: var(--ink-muted); }
.picker__group[open] > summary::before { content: "▾"; }
.picker__field { font-weight: 700; }
.picker__count { margin-left: auto; color: var(--accent); font-size: var(--text-sm); font-weight: 700; }
.picker__all { display: flex; gap: var(--space-lg); padding-bottom: var(--space-xs); }
.picker__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); padding-block: var(--space-sm); border-top: 1px solid var(--line); }
.picker__title { font-size: var(--text-base); }
.picker__none { margin: var(--space-sm) 0 0; color: var(--ink-muted); font-size: var(--text-md); }
.picker__other { max-width: 480px; margin-top: var(--space-md); }
.picker .seg__option + .seg__option { border-left: 2px solid var(--ink); }
.picker .seg__option span { min-width: 76px; padding-block: var(--space-sm); text-align: center; }

/* Profile sections, each with its own save. */
.profile-sections { display: grid; margin-top: var(--space-lg); border-top: var(--rule) solid var(--ink); }
.profile-section { padding-block: var(--space-md); border-bottom: 1px solid var(--line); }
.profile-section > summary span { display: block; color: var(--ink-muted); font-size: var(--text-md); }
.profile-section > summary strong, .profile-section--link strong { font-size: var(--text-title); font-weight: 800; }
.profile-section--link { position: relative; display: block; padding-right: var(--space-2xl); color: var(--ink); text-decoration: none; }
.profile-section--link strong { display: block; }
.profile-section--link span { display: block; color: var(--ink-muted); font-size: var(--text-md); }
.profile-section__arrow { position: absolute; top: var(--space-md); right: 0; font-size: var(--text-title); font-weight: 800; }
.profile-section[open] > summary span { display: none; }
.profile-section__body { margin-top: var(--space-md); }

/* ---------- Narrower screens. The jobs list stacks before the phone layout begins ---------- */
@media (max-width: 980px) {
  .job--row { grid-template-columns: 52px minmax(0, 1fr) 28px; }
  .job--row .job__fit { grid-column: 1; grid-row: 1 / span 2; }
  .job--row .job__main { grid-column: 2; grid-row: 1; }
  .job--row .facts { grid-column: 2 / -1; grid-row: 2; display: flex; flex-wrap: wrap; margin-top: var(--space-2xs); gap: 0; color: var(--ink-muted); }
  .job--row .facts dd { color: var(--ink-muted); font-size: var(--text-sm); }
  .job--row .facts div:has(.none) { display: none; }
  .job--row .facts div + div::before { content: "·"; margin-inline: var(--space-xs); font-size: var(--text-sm); }
  .job--row .facts div { display: flex; }
  .jobs-head { display: block; padding-block: 0; }
  .jobs-head span { display: none; }
}

/* ---------- A phone: bottom menu within reach, a slim bar, and the list straight away ---------- */
@media (max-width: 720px) {
  .masthead__inner, main { padding-inline: var(--space-lg); }
  .masthead__inner { gap: var(--space-md); min-height: 52px; }
  .wordmark__name, .nav { display: none; }
  .masthead__page { display: block; flex: 1; align-self: center; font-size: var(--text-title); font-weight: 800; }
  .masthead__back { display: block; }
  .wordmark--has-back { display: none; }
  .back { display: none; }
  .page-title--in-bar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .page-title { font-size: var(--text-display-small); }
  main { padding-block: var(--space-md) var(--space-2xl); }

  body:has(.tabs-bottom) { padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom)); }

  .tabs-bottom {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(4, auto);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 2px solid var(--ink);
  }

  .tabs-bottom a {
    display: grid;
    justify-items: center;
    gap: 0;
    min-height: var(--tabs-height);
    padding: var(--space-xs) var(--space-2xs);
    border-top: var(--rule) solid transparent;
    color: var(--ink-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
  }

  .tabs-bottom a[aria-current="page"] { border-top-color: var(--accent); color: var(--accent); font-weight: 800; }
  .icon { fill: none; stroke: currentcolor; stroke-width: 2.4; }
  .toast { bottom: calc(var(--tabs-height) + var(--space-md)); }

  .section-head { margin-top: var(--space-xl); }
  .section-head__note { flex-basis: 100%; }
  .action, .button { min-height: var(--touch-height); }

  .watch-head { display: none; }
  .watch-row__line { grid-template-columns: minmax(0, 1fr) auto auto; }
  .watch-row__name { grid-column: 1; grid-row: 1; }
  .watch-row__open { grid-column: 2; grid-row: 1; }
  .watch-row__edit { grid-column: 3; grid-row: 1; }
  .watch-row__board { grid-column: 1; grid-row: 2; }
  .watch-row__about { grid-column: 2 / -1; grid-row: 2; text-align: right; }
  .how-legend { grid-template-columns: minmax(0, 1fr); }
  .job { grid-template-columns: 52px minmax(0, 1fr); }
  .job__actions { grid-column: 2; margin-top: var(--space-sm); }
  .job--decided .job__date { grid-column: 2; }
  .job--full .dismiss { position: static; }
  .job--full .dismiss__reasons { right: auto; left: 0; max-width: 100%; }
  .fit__number { font-size: var(--text-fit-phone); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

        .list-bar__count { font-size: var(--text-title); }

  .posting-pair { grid-template-columns: minmax(0, 1fr); }
  .verdict { gap: var(--space-md); }
  .verdict__score .fit__number { font-size: var(--text-fit-phone-large); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-steps__item span { font-size: var(--text-xs); }
  .picker__word { flex-basis: 100%; }
}

/* On a phone, a job is long, so its actions stay in reach. A short screen needs the room. */
@media (max-width: 720px) and (min-height: 501px) {
  html:has(.posting-actions) { scroll-padding-bottom: 128px; }
  body:has(.posting-actions) { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

  .posting-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    gap: var(--space-xs);
    margin: 0;
    padding: var(--space-sm) var(--space-sm) calc(var(--space-sm) + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 2px solid var(--ink);
  }

  .posting-actions .decide, .posting-actions .decide__form { gap: var(--space-xs); }
  .posting-actions .action { padding-inline: var(--space-sm); font-size: var(--text-sm); }
  .posting-actions:has(.decide__state) .decide { flex-basis: 100%; }
  .posting-actions__open { flex: 1; padding-inline: var(--space-md); white-space: nowrap; }
  .posting-actions__long { display: none; }
  .posting-actions__short { display: inline; }

  .posting-actions .dismiss__reasons {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    margin: 0;
    padding: var(--space-sm);
    background: var(--surface);
    border-top: 2px solid var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
