/* MAB Jobs: warm ivory / ink / forest. System fonts only, no external assets. */
:root {
  --ivory: #f7f3ea;
  --paper: #fffdf8;
  --ink: #1d1b16;
  --muted: #5f5a4f;
  --rule: #ddd5c4;
  --forest: #1f4d3a;
  --forest-ink: #ffffff;
  --forest-soft: #e3ece5;
  --amber: #7a4f00;
  --amber-soft: #f6e8c6;
  --brick: #8b2a1f;
  --brick-soft: #f5dfdb;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}

.wrap { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }

[hidden] { display: none !important; }

.skip {
  position: absolute; left: 0.75rem; top: -4rem;
  background: var(--forest); color: var(--forest-ink);
  padding: 0.75rem 1rem; border-radius: var(--radius); z-index: 10;
}
.skip:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

/* Masthead: typography only */
.masthead { border-bottom: 2px solid var(--ink); padding: 1.75rem 0 1.25rem; }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.5rem; }
.wordmark {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1; letter-spacing: -0.02em;
}
.wordmark-mab { color: var(--forest); }
.tagline { margin: 0; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.05rem; }

/* Status */
.status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule);
}
.status-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.75rem; flex: 1 1 24rem; }
.status-pill {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid currentColor;
  color: var(--muted); background: var(--paper);
}
.status-pill[data-tone="ok"] { color: var(--forest); background: var(--forest-soft); }
.status-pill[data-tone="stale"] { color: var(--amber); background: var(--amber-soft); }
.status-pill[data-tone="error"] { color: var(--brick); background: var(--brick-soft); }
.status-detail { color: var(--muted); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 0.5rem 1.1rem;
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--forest);
  background: var(--forest); color: var(--forest-ink);
}
.btn:hover { background: #173b2c; }
.btn-quiet { background: transparent; color: var(--forest); }
.btn-quiet:hover { background: var(--forest-soft); }
.btn:disabled { opacity: 0.6; cursor: default; }

/* Controls */
.controls { display: grid; grid-template-columns: 1fr; gap: 0.75rem; padding: 1.25rem 0 0.5rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input, .field select {
  min-height: 44px; width: 100%; padding: 0.5rem 0.75rem;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid #b9b09d; border-radius: var(--radius);
}
.field input:disabled, .field select:disabled { background: #efe9dc; color: var(--muted); }

/* Results */
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-top: 1rem; }
.results-head h2 { margin: 0; font-family: var(--serif); font-size: 1.5rem; }
.summary { margin: 0; color: var(--muted); font-size: 0.9rem; }
.integrity { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--amber); }

.job-list { list-style: none; margin: 0.75rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.job-list:focus { outline: none; }
.job {
  display: grid; grid-template-columns: 1fr; gap: 0.6rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule);
}
.job-main { min-width: 0; }
.job-title {
  margin: 0; font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; font-weight: 600;
  overflow-wrap: anywhere;
}
.job-meta { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.job-source {
  font-weight: 600; color: var(--ink);
  display: inline-block; max-width: 100%; vertical-align: bottom;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-sep { padding: 0 0.15rem; }
.apply {
  justify-self: start;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 1.1rem;
  border-radius: var(--radius); background: var(--forest); color: var(--forest-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.apply:hover { background: #173b2c; text-decoration: underline; }

.empty {
  margin: 1rem 0; padding: 1.5rem 1.25rem;
  background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--muted);
  border-radius: var(--radius);
}
.empty[data-tone="error"] { border-left-color: var(--brick); }
.empty[data-tone="off"] { border-left-color: var(--amber); }
.empty-title { margin: 0 0 0.35rem; font-family: var(--serif); font-size: 1.2rem; }
.empty-text { margin: 0 0 0.5rem; color: var(--muted); }

.more { display: flex; justify-content: center; padding: 1.25rem 0 0.5rem; }

.footer { margin-top: 2rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
.footer p { margin: 0 0 0.35rem; }
.noscript { padding: 1rem 1.25rem; }

@media (min-width: 40rem) {
  .controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: end; }
  .job { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 1.5rem; }
  .apply { justify-self: end; }
  .job-source { max-width: 28rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .status-pill, .apply, .btn { border: 1px solid CanvasText; }
}
