/* Job match percentage (public/js/match-ui.js): the % badge on job cards, the
   "Your match" card on job pages, the /jobs/ "See your match" panel and the
   guest steps (email code + resume). Bands: strong ≥ 80 green, good 60–79
   amber, fair < 60 grey. Linked by /jobs/ and the Worker-rendered job pages;
   explore.js loads it on demand. */

.mt-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 3.1em; padding: 3px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: .01em; border: 1px solid transparent; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Changed on purpose (2026-10-11): the colours read the page tokens (the Jobs page switches them in dark mode, css/jobs-crystal.css); the old values are the fallbacks for the other pages. */
.mt-band-strong .mt-pct, .mt-badge.mt-band-strong { color: var(--ok-ink, #0B6B50); }
.mt-badge.mt-band-strong { background: var(--ok-bg, #DDF5EC); border-color: var(--ok-line, #9FDCC6); }
.mt-badge.mt-band-good { background: var(--warn-bg, #FDF1D8); border-color: var(--warn-line, #F0CD84); color: var(--warn-ink, #8A5A00); }
.mt-badge.mt-band-fair { background: var(--beige, #EEF1F5); border-color: var(--line-strong, #CBD5E1); color: var(--ink-2, #475569); }
.mt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Full result (job pages) */
.mt-result { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mt-pct { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.mt-band-good .mt-pct { color: var(--warn-ink, #8A5A00); }
.mt-band-fair .mt-pct { color: var(--ink-2, #475569); }
.mt-band { font-weight: 600; font-size: 15px; }
.mt-reasons { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.45; }
.mt-reasons li { position: relative; padding-inline-start: 18px; }
.mt-reasons li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .45; }
.mt-raise { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--paper, #F4F7FA); font-size: 14px; line-height: 1.45; }
.mt-thin, .mt-loading { margin: 0; font-size: 14.5px; color: var(--muted, #526579); }

/* Steps */
.mt-flow { display: grid; gap: 10px; }
.mt-flow [hidden] { display: none !important; }
.mt-prompt { margin: 0; font-size: 15px; line-height: 1.5; }
.mt-step { display: grid; gap: 10px; margin: 0; }
.mt-field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.mt-field input, .mt-paste textarea { font: inherit; font-weight: 400; width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong, #CBD5E1); border-radius: 10px; background: var(--surface, #fff); color: var(--ink, #0B1F33); }
.mt-field small { font-weight: 400; color: var(--muted, #526579); }
.mt-paste summary { cursor: pointer; font-size: 14px; }
.mt-paste textarea { margin-top: 6px; }
.mt-check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.mt-check input { width: 18px; height: 18px; accent-color: var(--primary, #2459C7); }
.mt-note, .mt-sent { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted, #526579); }
.mt-link { justify-self: start; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--blue, #2459C7); text-decoration: underline; cursor: pointer; }
.mt-status { margin: 0; font-size: 14px; min-height: 0; }
.mt-status:empty { display: none; }
.mt-status.is-error { color: var(--danger-ink, #B42318); }

/* Job pages: the card inside the apply aside */
.job-match[hidden] { display: none; }
.job-match { margin: 0 0 20px; padding: 0 0 20px; border-bottom: 1px solid var(--line, #E2E8F0); }
.job-match-h { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #526579); }
.job-match-result { margin-bottom: 12px; }
.job-match .btn { justify-self: start; }

/* /jobs/ search: the panel, card badges and the sort toggle */
.match-panel[hidden], .jobs-sort[hidden] { display: none; }
.match-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px 32px; align-items: start; margin: 0 0 24px; padding: 22px 24px;
  border: 1px solid var(--line, #D5E7DF); border-radius: 16px; background: var(--sky, #E8EFFC); }
.match-panel h2 { margin: 0 0 4px; font-size: 20px; }
.match-panel-lead { margin: 0; font-size: 15px; color: var(--ink-2, #334155); }
.match-panel.is-scored { grid-template-columns: 1fr auto; align-items: center; padding: 14px 20px; }
.match-panel.is-scored .mt-flow { justify-items: end; }
.jobs-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jobs-sort { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; cursor: pointer; }
.jobs-sort input { width: 18px; height: 18px; accent-color: var(--primary, #2459C7); }
.job-item { position: relative; }
.job-item .job-match-badge { position: absolute; top: 16px; inset-inline-end: 16px; }
.job-item.has-match .job-link h3 { padding-inline-end: 76px; }
.job-match-reason { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-2, #334155); }

/* Explorer cards (homepage, careers) */
.x-job .job-match-badge { position: absolute; top: 12px; inset-inline-end: 12px; }
.x-job.has-match { position: relative; }
.x-job.has-match h3 { padding-inline-end: 64px; }

@media (max-width: 760px) {
  .match-panel, .match-panel.is-scored { grid-template-columns: 1fr; padding: 18px 16px; }
  .match-panel.is-scored .mt-flow { justify-items: start; }
  .mt-pct { font-size: 34px; }
}
