/* Layout of the shared job board (page chrome, Tailor card, filters, table, side panel).
 * Tokens and small components (buttons, radar, pills, axes) come from theme.css. */
:root { --header-h: 3.6rem; --side-w: 360px; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; }
.atmosphere {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(900px 500px at 85% 0%, rgba(18, 165, 148, 0.08), transparent 55%), var(--paper);
}

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 1rem; height: var(--header-h);
  max-width: 1440px; margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
}
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.tagline { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--ink-soft); }
.nav-cta {
  background: var(--ink); color: #e8f4f2; text-decoration: none; font-weight: 700;
  font-size: 0.85rem; padding: 0.4rem 0.85rem; border-radius: 999px;
}

/* ---------- table-first grid ---------- */
.app {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 1rem;
  max-width: 1440px; margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 1.5rem max(1rem, env(safe-area-inset-left, 0px));
  align-items: start;
}
.main-col {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--header-h) - 1rem);
  min-height: 420px;
  overflow-y: auto;
}
.main-col, .side-pane {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(7, 17, 26, 0.07); padding: 0.75rem 0.9rem;
}
.side-pane { position: sticky; top: 0.5rem; display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 1rem); }
.strip-wrap {
  display: grid; gap: 0.55rem;
  padding: 0.55rem 0.7rem 0.65rem; border-radius: 10px;
  background: rgba(18, 165, 148, 0.06); border: 1px solid rgba(18, 165, 148, 0.28);
}
.strip-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0; font-size: 0.8rem; color: var(--ink-soft); }
.strip-head strong { color: var(--accent-ink); font-size: 0.88rem; }
.strip-progress { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.geo-status { font-size: 0.75rem; color: var(--accent-ink); }
.geo-status:empty { display: none; }
/* Interests · Experience · Min pay — Values sits on its own row below. */
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; align-items: start; }
.refine-values { max-width: 22rem; }
.ctl { display: grid; gap: 0.05rem; min-width: 0; }
.ctl-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); line-height: 1.2; }
.ctl-hint { font-size: 0.64rem; color: var(--ink-soft); line-height: 1.15; margin-bottom: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-row { display: flex; gap: 0.3rem; }
.ctl-row .box { flex: 1; min-width: 0; }
.box { width: 100%; height: 2.1rem; display: flex; align-items: center; justify-content: space-between; }
.pick { position: relative; }
.pick summary { list-style: none; cursor: pointer; }
.pick summary::-webkit-details-marker { display: none; }
.pick summary::after { content: "▾"; font-size: 0.7rem; color: var(--ink-soft); }
.pick[open] summary { border-color: var(--accent); }
.pick-val { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-panel {
  position: absolute; top: 100%; left: 0; z-index: 30; margin-top: 0.25rem; min-width: 14rem;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 0.4rem; display: grid; grid-template-columns: repeat(2, minmax(10rem, 1fr)); gap: 0.1rem;
  max-height: 70vh; overflow: auto;
}
/* Interest multi-select rows only — not Values Lift/Hide cells (those use .seg). */
.pick-panel > label { display: flex; gap: 0.5rem; align-items: center; padding: 0.3rem 0.4rem; border-radius: 6px; font-size: 0.85rem; cursor: pointer; }
.pick-panel > label:hover { background: rgba(18, 165, 148, 0.1); }
/* Values popover: Off / Lift… / Hide… (labels name the action, not Prefer/Avoid). */
.pick-panel.values-panel {
  grid-template-columns: 1fr; min-width: min(40rem, 94vw); max-width: 44rem;
  max-height: min(70vh, 36rem); overflow: auto;
}
.values-panel .values-lead {
  margin: 0.2rem 0.45rem 0.65rem; line-height: 1.5;
  font-size: 0.88rem; color: var(--ink-soft);
}
/* Desktop: keep sheet chrome hidden; mobile media query reveals Close + backdrop. */
.values-sheet-head { display: none; }
.values-backdrop { display: none; }
/* Stack text above actions so Lift/Hide labels stay readable. */
.vrow {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.45rem;
  padding: 0.55rem 0.4rem; border-top: 1px solid var(--line); font-size: 0.92rem;
}
.vrow:first-of-type { border-top: 0; }
.vrow-text { display: grid; gap: 0.2rem; min-width: 0; }
.vrow-label { font-weight: 700; font-size: 0.98rem; color: var(--ink); line-height: 1.3; }
.vrow-brief {
  margin: 0; font-size: 0.82rem; line-height: 1.4; color: var(--ink-soft);
}
.vrow-more { font-size: 0.8rem; color: var(--ink-soft); }
.vrow-more summary {
  cursor: pointer; font-weight: 700; color: var(--accent-ink); list-style: none;
}
.vrow-more summary::-webkit-details-marker { display: none; }
.vrow-more[open] summary { margin-bottom: 0.1rem; }
.vrow-more p { margin: 0.3rem 0 0; line-height: 1.45; font-size: 0.84rem; }
.vrow-lock-note {
  margin: 0.15rem 0 0; font-size: 0.78rem; line-height: 1.35; color: var(--ink-soft);
}
.vrow .seg { display: flex; width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
/* Each cell owns its hit target: label fills the third, span fills the label (no offset hover). */
.seg label {
  position: relative; flex: 1 1 0; min-width: 0; margin: 0; padding: 0; gap: 0;
  display: block; cursor: pointer; border-radius: 0;
}
.seg label.is-locked { opacity: 0.42; cursor: not-allowed; }
.seg label.is-locked span { background: #eef1f4; color: var(--ink-soft); }
.seg input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer; z-index: 1;
}
.seg label.is-locked input { cursor: not-allowed; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 2.4rem; padding: 0.45rem 0.4rem; box-sizing: border-box;
  text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft);
  background: #fff; line-height: 1.25;
}
.seg label:not(.is-locked):hover span { background: rgba(18, 165, 148, 0.12); color: var(--accent-ink); }
.seg .seek:not(.is-locked):hover span { background: rgba(18, 165, 148, 0.18); color: var(--accent-ink); }
.seg .avoid:not(.is-locked):hover span { background: rgba(196, 75, 75, 0.12); color: var(--skip); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg .seek input:checked + span { background: var(--accent-solid); color: var(--accent-solid-text); }
.seg .avoid input:checked + span { background: var(--skip); color: #fff; }
.seg label:not(.is-locked):hover input:checked + span { filter: brightness(1.06); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- filters (Search · Place · List clusters inside the refine card) ---------- */
.filters {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 0.55rem 0.75rem;
  margin: 0; padding-top: 0.55rem; border-top: 1px solid rgba(18, 165, 148, 0.22);
}
.filter-group { display: grid; gap: 0.25rem; min-width: 0; align-content: start; }
.filter-group-label {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft); line-height: 1.2;
}
.filter-group-body { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.filters input[type="search"] { flex: 1 1 10rem; min-width: 8rem; }
.filters select { max-width: 10.5rem; }
.place-pair { display: inline-flex; gap: 0.3rem; align-items: center; }
.place-pair select { max-width: 9.5rem; }
.near-btn, .place-pair #nearBtn {
  height: 2.45rem; padding: 0 1rem; font-size: 0.9rem; font-weight: 800;
  border: 2px solid var(--accent); color: var(--accent-ink);
  background: rgba(18, 165, 148, 0.14); border-radius: 999px;
  letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(18, 165, 148, 0.25);
}
.near-btn:hover, .place-pair #nearBtn:hover { background: rgba(18, 165, 148, 0.22); }
.near-btn.on, .place-pair #nearBtn.on {
  background: var(--accent-solid); color: var(--accent-solid-text); border-color: var(--accent-solid);
}
.more-filters { position: relative; }
.more-filters > summary {
  list-style: none; cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters[open] > summary { border-color: var(--accent); color: var(--accent-ink); }
.more-filters[open] {
  display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
  padding: 0.25rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.legend { margin: 0; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.45; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; }
.legend-more { display: inline; }
.legend-more > summary {
  cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--ink-soft);
}
.legend-more .axis-key { display: inline; margin-left: 0.35rem; font-size: 0.82rem; }

/* ---------- table ---------- */
.table-wrap {
  flex: 1 1 auto;
  min-height: 280px; /* chart/filters must never collapse the job list to 0 */
  overflow: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
table.jobs { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.jobs thead th {
  position: sticky; top: 0; z-index: 2; background: var(--card); text-align: left;
  font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft);
  padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line);
}
.jobs td { position: relative; padding: 0.65rem 0.65rem; vertical-align: middle; border-bottom: 1px solid var(--line); }
.jobs td .sub { display: block; margin-top: 2px; }
.jobs tr.row { cursor: pointer; }
.jobs tr.row:hover td { background: rgba(18, 165, 148, 0.06); }
.jobs tr.row.excluded td {
  color: var(--ink-soft);
  background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(196, 75, 75, 0.05) 8px 16px);
}
.jobs tr.row.excluded .radar { opacity: 0.4; }
.ex-tag { color: var(--skip); font-style: normal; font-weight: 700; }
.where { color: var(--ink-soft); font-size: 0.8rem; max-width: 9rem; }
.empty { text-align: center; color: var(--ink-soft); padding: 2rem 1rem !important; }
.glyph { width: 60px; padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; }
.fit { width: 3rem; }
.pay { width: 6.5rem; }
.areas { max-width: 7rem; }
.seen { width: 4.5rem; white-space: nowrap; font-weight: 600; }
.open { width: 5.2rem; min-width: 4.6rem; white-space: nowrap; }
/* Keep Open reachable when the table is narrower than its columns (zoom / small screens). */
.jobs thead th.open,
.jobs td.open {
  position: sticky; right: 0; z-index: 1;
  background: #fff;
  box-shadow: -6px 0 8px -6px rgba(7, 17, 26, 0.12);
}
.jobs thead th.open { z-index: 3; background: var(--card); }
.jobs tr.row:hover td.open { background: rgba(18, 165, 148, 0.06); }
.jobs tr.row.selected td.open { background: rgba(18, 165, 148, 0.16); }
.jobs tr.row.applied td.open { background: var(--applied-bg); }
.jobs tr.row.review td.open { background: var(--review-bg); }
.jobs tr.row.blocked td.open { background: var(--blocked-bg); }
.open-link {
  display: inline-block; font-weight: 700; font-size: 0.78rem; text-decoration: none;
  padding: 0.3rem 0.6rem; border-radius: 999px;
  background: var(--accent-solid); color: var(--accent-solid-text);
}
.open-link:hover { background: var(--accent-solid-hover); }

/* Marks tint the whole row; the blue dot and heavier name flag jobs you haven't opened. */
.jobs tr.row.applied td { background: var(--applied-bg); }
.jobs tr.row.review td { background: var(--review-bg); }
.jobs tr.row.blocked td { background: var(--blocked-bg); }
.jobs tr.row.selected td { background: rgba(18, 165, 148, 0.16); }
.jobs tr.row.unseen strong { font-weight: 800; }

/* Triage: large tap targets filling the row height. */
.jobs td.tri { width: 8.5rem; min-width: 8.5rem; padding: 0; }
.triage { position: absolute; inset: 0; display: flex; min-height: 3.25rem; }
.triage button {
  flex: 1; min-width: 2rem; min-height: 100%; padding: 0;
  border: 0; border-left: 1px solid var(--line); border-radius: 0;
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  background: rgba(255, 255, 255, 0.55); color: var(--ink-soft);
}
.triage button:first-child { border-left: 0; }
.triage button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.triage .mark-applied { color: var(--applied-ink); background: var(--applied-bg); }
.triage .mark-review { color: var(--review-ink); background: var(--review-bg); }
.triage .mark-blocked { color: var(--blocked-ink); background: var(--blocked-bg); }
.triage button:hover { filter: brightness(0.94); }
.triage button.on { font-weight: 800; box-shadow: inset 0 -4px 0 currentColor; }
.jobs tr.row td { min-height: 3.25rem; }

/* ---------- side panel: Job | Resume ---------- */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 0.6rem; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 0.85rem;
  color: var(--ink-soft); padding: 0.45rem 0.7rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: 8px 8px 0 0; transition: background 0.25s ease, color 0.2s ease;
}
.tab.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
/* Soft green wash when the selected job changes while staying on the same tab. */
.tabs.tabs-pulse .tab {
  animation: tab-pulse 0.65s ease;
}
@keyframes tab-pulse {
  0% { background: transparent; }
  35% { background: rgba(18, 165, 148, 0.22); }
  100% { background: transparent; }
}
.pane { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.pane[hidden] { display: none; }
.pane h2 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.d-title { font-weight: 600; margin: 0.1rem 0 0.2rem; }
.pane .blurb { margin: 0.6rem 0; font-size: 0.85rem; line-height: 1.5; }
.pane-actions { display: grid; gap: 0.55rem; margin: 0.7rem 0; }
.pane-actions .btn.lg { justify-content: center; }
.pane-marks { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.pane-marks .btn { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.pane-marks .btn.on { border-color: var(--accent); background: rgba(18, 165, 148, 0.12); color: var(--accent-ink); }
/* Community report — visually separate panel from personal triage marks. */
.report-bar {
  display: grid; gap: 0.45rem; margin-top: 0.15rem;
  padding: 0.7rem 0.75rem; border-radius: 10px;
  border: 1px solid rgba(196, 75, 75, 0.35);
  background: linear-gradient(165deg, rgba(196, 75, 75, 0.1), rgba(196, 75, 75, 0.04));
}
.report-bar-head { font-weight: 700; font-size: 0.82rem; color: #8a1f1f; }
.report-bar-note { margin: 0; font-size: 0.74rem; color: var(--ink-soft); line-height: 1.4; }
.btn.danger {
  appearance: none; border: 1px solid rgba(196, 75, 75, 0.55); background: rgba(196, 75, 75, 0.08);
  color: #8a1f1f; font-weight: 700; font-size: 0.82rem; padding: 0.45rem 0.75rem; border-radius: 8px; cursor: pointer;
}
.btn.danger:hover { background: rgba(196, 75, 75, 0.16); }
.report-reasons { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.report-bar .report-reasons .btn {
  border-color: rgba(196, 75, 75, 0.35); background: rgba(255, 255, 255, 0.65); color: #8a1f1f;
  font-size: 0.78rem; padding: 0.28rem 0.6rem;
}
.report-bar .report-reasons .btn:hover { background: rgba(196, 75, 75, 0.12); }
.report-card { border-color: rgba(196, 75, 75, 0.35); background: rgba(196, 75, 75, 0.04); }
.domain-alert {
  margin: 0.5rem 0 0; padding: 0.55rem 0.7rem; border-radius: 8px;
  border: 1px solid rgba(196, 140, 40, 0.45); background: rgba(255, 196, 80, 0.12);
  font-size: 0.8rem; color: #6a4500;
}
.domain-alert.confirmed { border-color: rgba(196, 75, 75, 0.5); background: rgba(196, 75, 75, 0.1); color: #8a1f1f; }
.domain-alert strong { display: block; margin-bottom: 0.15rem; }
.domain-alert p { margin: 0; line-height: 1.4; }
.report-badge, .badge-rep, .badge-domain {
  display: inline-block; font-size: 0.68rem; font-weight: 700; color: #8a1f1f;
  background: rgba(196, 75, 75, 0.12); border-radius: 999px; padding: 0.05rem 0.4rem; margin-left: 0.3rem;
}
.badge-domain { color: #6a4500; background: rgba(255, 196, 80, 0.22); }
.jobs tr.reported { box-shadow: inset 3px 0 0 rgba(196, 75, 75, 0.55); }
.jobs tr.domain-flagged { box-shadow: inset 3px 0 0 rgba(196, 140, 40, 0.7); }
.jobs tr.reported.domain-flagged { box-shadow: inset 3px 0 0 rgba(196, 75, 75, 0.55), inset 6px 0 0 rgba(196, 140, 40, 0.7); }
.follow { color: var(--accent-ink); }
.follow.due, .follow-note.due { color: #8a1f1f; font-weight: 600; }
.follow-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--accent-ink); }
/* Recruiter email check — upload/paste; body never uploaded. */
.mail-box {
  margin-top: 0.6rem; padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 10px;
  background: #f7fafb; font-size: 0.8rem; color: var(--ink-soft);
}
.mail-box strong { display: block; color: var(--ink); font-size: 0.82rem; margin-bottom: 0.15rem; }
.mail-box.has-mail { border-color: rgba(18, 165, 148, 0.35); }
.mail-box .mail-actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mail-upload { cursor: pointer; }
.mail-check.lo { border-color: rgba(196, 75, 75, 0.4); }
.mail-check.mid { border-color: rgba(196, 140, 40, 0.45); }
.mail-check.hi { border-color: rgba(18, 165, 148, 0.4); }
.mail-check .mail-actions { margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mail-check li.warn { color: #8a1f1f; }
.mail-box .mail-paste {
  width: 100%; box-sizing: border-box; margin: 0.5rem 0 0;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.65rem;
  font: 400 0.82rem/1.4 ui-monospace, Menlo, monospace; resize: vertical; min-height: 6.5rem;
  background: #fff;
}
.mail-timeline-head { margin: 0.7rem 0 0.2rem; font-size: 0.8rem; color: var(--ink-soft); }
.mail-score { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.45rem 0; }
.mail-score span { background: #f2f5f6; border-radius: 999px; padding: 0.2rem 0.5rem; font-size: 0.74rem; }
.mail-checklist { list-style: none; padding: 0 !important; display: grid; gap: 0.32rem; }
.mail-check-item { display: block; }
.mail-check-btn {
  appearance: none; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.4rem; align-items: start;
  padding: 0.35rem 0.4rem; border-radius: 8px; font: inherit; color: inherit;
}
.mail-check-btn:hover, .mail-check-item.on .mail-check-btn { background: rgba(18, 165, 148, 0.08); }
.mail-check-mark { font-size: 1rem; line-height: 1.2; }
.mail-check-item.pass .mail-check-mark { color: var(--accent-ink); }
.mail-check-item.fail .mail-check-mark { color: #8a1f1f; }
.mail-check-item.warn .mail-check-mark { color: #8a5a00; }
.mail-check-body { display: grid; gap: 0.12rem; }
.mail-check-body small { display: block; color: var(--ink-soft); font-size: 0.72rem; }
.mail-check-quote { color: var(--ink) !important; font-style: italic; }
.mail-split {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 0.75rem;
  margin-top: 0.55rem; align-items: start;
}
.mail-source {
  border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.65rem;
  background: #f0f4f7; min-height: 8rem;
}
.mail-source h4 { margin: 0 0 0.25rem; font-size: 0.8rem; letter-spacing: 0.03em; text-transform: uppercase; }
.mail-source-pre {
  margin: 0.35rem 0 0; white-space: pre-wrap; word-break: break-word;
  font: 0.72rem/1.4 ui-monospace, Menlo, monospace; max-height: 16rem; overflow: auto;
}
.mail-hit {
  background: rgba(196, 140, 40, 0.35); outline: 1px solid rgba(196, 140, 40, 0.55);
  border-radius: 3px; padding: 0 0.1rem;
}
.mail-quote-callout {
  margin: 0.45rem 0 0; padding: 0.45rem 0.55rem; border-radius: 8px;
  background: rgba(196, 140, 40, 0.12); font-size: 0.78rem; line-height: 1.4;
}
.mail-kind {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--accent-ink);
  background: rgba(18, 165, 148, 0.12); padding: 0.1rem 0.35rem; border-radius: 999px;
}
.mail-trust {
  margin: 0.55rem 0 0.35rem;
}
.mail-trust-head {
  display: flex; align-items: baseline; gap: 0.45rem;
  font-size: 0.78rem; margin-bottom: 0.25rem;
}
.mail-trust-head strong { font-size: 1.05rem; }
.mail-trust-label { margin-left: auto; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.03em; text-transform: uppercase; }
.mail-trust-track {
  height: 0.45rem; border-radius: 99px; background: rgba(0,0,0,0.08); overflow: hidden;
}
.mail-trust-track > span { display: block; height: 100%; border-radius: inherit; }
.mail-trust.ok .mail-trust-track > span { background: #1a9a7a; }
.mail-trust.ok .mail-trust-label, .mail-trust.ok strong { color: #0b6f64; }
.mail-trust.caution .mail-trust-track > span { background: #c4a035; }
.mail-trust.caution .mail-trust-label, .mail-trust.caution strong { color: #8a5a00; }
.mail-trust.bad .mail-trust-track > span { background: #c44b4b; }
.mail-trust.bad .mail-trust-label, .mail-trust.bad strong { color: #8a1f1f; }
.mail-topic.na { opacity: 0.55; cursor: not-allowed; background: #eef1f4; }
.mail-topic.na .mail-topic-dot { background: #9aa6b2; }
.mail-topic:disabled { pointer-events: none; }
@media (max-width: 720px) {
  .mail-split { grid-template-columns: 1fr; }
}

/* Job-pane cards (Why it fits, Keywords, Documents, reports). */
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
.card summary { cursor: pointer; font-weight: 600; }
.card h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.card p { margin: 0 0 6px; font-size: 0.85rem; }
.card ul { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.card pre { margin: 8px 0 0; white-space: pre-wrap; font: 13px/1.45 var(--font-body); max-height: 320px; overflow: auto; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

@media (max-width: 980px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr; }
  .refine-values { max-width: none; }
}
@media (max-width: 720px) {
  .strip { grid-template-columns: 1fr; }
}
.shape-radar { display: flex; justify-content: center; margin: 0.4rem 0; }
.pane-empty { color: var(--ink-soft); text-align: center; padding: 2rem 1rem; }

/* Values evidence + employer blurb */
.vals { list-style: none; margin: 0 0 0.4rem; padding: 0; display: grid; gap: 0.3rem; }
.val {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0 0.4rem; align-items: baseline;
  padding: 0.3rem 0.5rem; font-size: 0.78rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.val em { font-style: normal; font-weight: 800; }
.val span { grid-column: 1 / -1; font-size: 0.72rem; color: var(--ink-soft); }
.val.pos { border-color: rgba(18, 165, 148, 0.4); } .val.pos em { color: var(--accent-ink); }
.val.neg { border-color: rgba(196, 75, 75, 0.4); background: rgba(196, 75, 75, 0.05); } .val.neg em { color: var(--skip); }
.stance { font-style: normal; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.about { font-size: 0.78rem; color: var(--ink-soft); }
.about summary { cursor: pointer; font-weight: 600; }
.about p { margin: 0.3rem 0 0; line-height: 1.45; }

/* Market map — space-first; full-column hits; drill-in uses ranked rows (mobile-friendly) */
.market {
  flex: 0 0 auto;
  margin: 0.3rem 0 0.4rem; padding: 0.45rem 0.65rem 0.35rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 165, 148, 0.07), #fff 50%);
}
.market-title { margin: 0; font-size: 0.92rem; font-weight: 800; color: var(--accent-ink); }
.market-sub { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--ink-soft); line-height: 1.35; }
.market-head {
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.65rem; align-items: baseline; margin-bottom: 0.3rem;
}
.market-head strong { font-size: 0.95rem; color: var(--accent-ink); }
.market-head span { font-size: 0.82rem; color: var(--ink-soft); flex: 1 1 10rem; }
.market-chart-back {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  margin: 0 0 0.45rem; padding: 0.45rem 0.55rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--card) 90%, #fff);
}
.market-chart-back .btn { font-weight: 800; min-height: 2.3rem; }
.market-crumb-here { font-weight: 700; color: var(--accent-ink); }
.market-svg-wrap, .market-chart-scroll {
  overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
}
.market-chart { display: grid; gap: 0.15rem; max-width: 100%; }
.market-svg { display: block; overflow: visible; }
.market-col-labs {
  display: grid;
  grid-template-columns: repeat(var(--market-cols, 1), minmax(0, 1fr));
  gap: 0.15rem;
  padding-left: var(--market-pad-l, 34px);
  min-height: 2.4rem;
}
.market-col-lab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: 650 0.78rem/1.25 var(--font-body, inherit); color: var(--ink);
  text-align: center; padding: 0.25rem 0.12rem; border-radius: 6px;
  min-width: 0; min-height: 2.35rem;
}
.market-col-lab span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; white-space: pre-line; word-break: break-word;
}
.market-col-lab:hover, .market-col-lab:focus-visible {
  background: rgba(18, 165, 148, 0.1); outline: none; color: var(--accent-ink);
}
.market-col-lab.on {
  background: rgba(18, 165, 148, 0.16); color: var(--accent-ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.market-hit { fill: transparent; cursor: pointer; }
.market-bar { opacity: 1; pointer-events: none; }
.market-col.tone-open .market-bar { fill: #1a9a7a; }
.market-col.tone-mid .market-bar { fill: #c4a035; }
.market-col.tone-tight .market-bar { fill: #c44b4b; }
.market-col.on .market-hit { fill: rgba(18, 165, 148, 0.12); }
.market-col:focus { outline: none; }
.market-col:focus .market-hit, .market-col:hover .market-hit { fill: rgba(18, 165, 148, 0.1); }
.market-sat { font-size: 12px; font-weight: 700; fill: var(--ink); pointer-events: none; }
.market-axis { font-size: 11px; fill: var(--ink-soft); }
.market-hint { margin: 0.2rem 0 0.1rem; font-size: 0.85rem; }

.drill-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.85rem;
  margin: 0.55rem 0 0.4rem; padding: 0.7rem 0.85rem;
  border: 2px solid rgba(18, 165, 148, 0.45); border-radius: 12px;
  background: rgba(18, 165, 148, 0.12);
}
.drill-nav[hidden] { display: none; }
.drill-nav .btn.primary {
  min-height: 2.5rem; padding: 0.45rem 1rem; font-size: 0.95rem; font-weight: 800;
}
.drill-nav-here { font-weight: 700; font-size: 1rem; color: var(--accent-ink); flex: 1 1 auto; }

.list-switch {
  display: grid; justify-items: center; gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
}
.list-switch-pane {
  display: grid; justify-items: center; gap: 0.35rem;
  width: min(100%, 28rem); padding: 0.65rem 0.85rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; box-shadow: 0 4px 14px rgba(7, 17, 26, 0.06);
}
.list-switch-label {
  margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.list-switch .legend { margin: 0; justify-content: center; text-align: center; }
.list-switch-btns { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: center; width: 100%; }
.list-switch-btns .btn {
  flex: 1 1 8rem; justify-content: center; min-height: 2.4rem;
  font-size: 0.9rem; border-width: 1.5px;
}
.list-switch-btns .btn.primary {
  background: var(--accent-solid); color: var(--accent-solid-text); border-color: var(--accent-solid);
}

/* Interest-match filter — sits with the list chrome, not buried in Refine. */
.only-matches {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.65rem;
  max-width: 100%; margin: 0.1rem 0 0; padding: 0.55rem 1rem 0.55rem 0.75rem;
  border: 1.5px solid rgba(18, 165, 148, 0.45); border-radius: 999px;
  background: rgba(18, 165, 148, 0.1); color: var(--accent-ink);
  font-size: 0.92rem; font-weight: 700; line-height: 1.25;
  cursor: pointer; user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.only-matches:hover {
  background: rgba(18, 165, 148, 0.16); border-color: var(--accent);
}
.only-matches:has(input:checked) {
  background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-solid-text);
  box-shadow: 0 2px 10px rgba(18, 165, 148, 0.35);
}
.only-matches input {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.only-matches-ui {
  flex: none; width: 1.35rem; height: 1.35rem; border-radius: 6px;
  border: 2px solid rgba(11, 111, 100, 0.55); background: #fff;
  box-shadow: inset 0 1px 2px rgba(7, 17, 26, 0.06);
  position: relative;
}
.only-matches:has(input:checked) .only-matches-ui {
  border-color: #fff; background: #fff;
}
.only-matches:has(input:checked) .only-matches-ui::after {
  content: ""; position: absolute; left: 0.32rem; top: 0.08rem;
  width: 0.38rem; height: 0.7rem; border: solid var(--accent-solid); border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.only-matches input:focus-visible + .only-matches-ui {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.only-matches-ui, .only-matches-text { min-width: 0; pointer-events: none; }

.pager {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  margin: 0.55rem 0 0.25rem; padding: 0.45rem;
}
.pager[hidden] { display: none; }
.pager-status { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.pager .btn { min-width: 5.5rem; justify-content: center; }
.pager .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.market-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.market-row {
  width: 100%; appearance: none; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto;
  gap: 0.1rem 0.55rem; align-items: center;
  padding: 0.55rem 0.65rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; min-height: 2.75rem;
}
.market-row:hover, .market-row:focus-visible { border-color: var(--accent); outline: none; }
.market-row.on { border-color: var(--accent); background: rgba(18, 165, 148, 0.1); }
.market-row-kind {
  grid-row: 1 / span 2; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-soft); min-width: 2.6rem;
}
.market-row.tone-open .market-row-kind { color: #0d6b54; }
.market-row.tone-tight .market-row-kind { color: #8a1f1f; }
.market-row-label { font-weight: 650; font-size: 0.86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-row-meta { font-size: 0.72rem; color: var(--ink-soft); }
.market-row-space {
  grid-row: 1 / span 2; grid-column: 3; text-align: right; font-weight: 800; font-size: 1rem; line-height: 1.1;
  color: var(--accent-ink);
}
.market-row-space small { display: block; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.market-row.tone-tight .market-row-space { color: #8a1f1f; }
.market-row-track {
  grid-column: 2 / 3; height: 5px; border-radius: 99px; background: rgba(0, 0, 0, 0.06); overflow: hidden;
}
.market-row-track > span { display: block; height: 100%; border-radius: inherit; background: #1a9a7a; }
.market-row.tone-mid .market-row-track > span { background: #c4a035; }
.market-row.tone-tight .market-row-track > span { background: #c44b4b; }
.market-drill-lead, .market-drill-sub { margin: 0 0 0.35rem; font-size: 0.75rem; color: var(--ink-soft); }
.market-drill-sub { margin-top: 0.65rem; font-weight: 700; color: #8a1f1f; }
.market-list-crowded .market-row { border-color: rgba(196, 75, 75, 0.25); }
.market-list > li.is-open { display: grid; gap: 0; }
/* Expanded employer: invert the header so it clearly separates from closed rows */
.market-list > li.is-open > .market-row {
  border-radius: 12px 12px 0 0;
  border-color: #0d6b54;
  border-bottom-color: transparent;
  background: #0d6b54;
  color: #fff;
  box-shadow: 0 2px 10px rgba(13, 107, 84, 0.28);
}
.market-list > li.is-open > .market-row .market-row-kind,
.market-list > li.is-open > .market-row .market-row-meta,
.market-list > li.is-open > .market-row .market-row-space,
.market-list > li.is-open > .market-row .market-row-space small {
  color: rgba(255, 255, 255, 0.88);
}
.market-list > li.is-open > .market-row .market-row-track {
  background: rgba(255, 255, 255, 0.22);
}
.market-list > li.is-open > .market-row .market-row-track > span {
  background: #fff;
}
.market-inline {
  margin: 0 0 0.45rem;
  padding: 0.65rem 0.7rem 0.75rem;
  border: 2px solid #0d6b54;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #e8f6f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.market-inline-lead { margin: 0 0 0.4rem; font-size: 0.72rem; color: #0d6b54; font-weight: 600; }
.market-job-list { display: grid; gap: 0.3rem; max-height: 16rem; overflow: auto; }
.market-job {
  appearance: none; width: 100%; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.55rem; align-items: center;
  padding: 0.45rem 0.55rem; border-radius: 8px; border: 1px solid rgba(13, 107, 84, 0.22);
  background: #fff; color: var(--ink); font: inherit;
}
.market-job:hover, .market-job:focus-visible {
  border-color: #0d6b54; outline: none; background: rgba(18, 165, 148, 0.08);
}
.market-job .fit { font-size: 1rem; text-align: center; }
.market-job-body { display: grid; gap: 0.05rem; min-width: 0; }
.market-job-title {
  font-weight: 650; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.market-job-meta { font-size: 0.7rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.market-drill-panel,
.market-rows-panel {
  margin-top: 0.35rem;
  background: linear-gradient(180deg, rgba(7, 17, 26, 0.03), #fff 40%);
}
.market-rows-panel .market-drill-lead { font-weight: 600; color: var(--ink); }

@media (max-width: 720px) {
  .market-svg-wrap {
    display: block;
    margin: 0 -0.25rem;
    padding: 0 0.25rem 0.15rem;
  }
  .market-col-lab { font-size: 0.8rem; min-height: 2.9rem; }
  .market-head span { flex-basis: 100%; }
  .list-switch-pane { width: 100%; }
  .list-switch-btns .btn { flex: 1 1 45%; }
  .drill-nav .btn { flex: 1 1 auto; }
}

/* ---------- narrow screens: stack; list tall enough to scan many rows ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); } /* minmax(0) so the wide table scrolls instead of stretching the page */
  .main-col { height: auto; overflow: visible; padding: 0.75rem 0.95rem; }
  /* Refine card grew taller — give the list most of the viewport once you scroll to it. */
  .table-wrap {
    /* Keep page/footer geometry stable */
    height: min(72dvh, 42rem);
    max-height: min(72dvh, 42rem);
    min-height: 22rem;
  }
  .side-pane {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0.75rem 0.95rem;
  }
  .side-pane .pane {
    flex: none;
    overflow: visible;
  }
  .tagline { display: none; }
}
@media (max-width: 720px) {
  .app {
    padding-left: max(1.15rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.15rem, env(safe-area-inset-right, 0px));
  }
  .top {
    padding-left: max(1.15rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.15rem, env(safe-area-inset-right, 0px));
  }
}

/* Values on small screens: bottom sheet + full-width stance toggles (readable thumbs). */
@media (max-width: 720px) {
  /* Dim the board so the sheet reads as a modal and taps outside can dismiss. */
  .pick[data-key="values"][open] > .values-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 89;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(7, 17, 26, 0.4);
    cursor: pointer;
  }
  .pick[data-key="values"][open] > .pick-panel.values-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    margin: 0;
    min-width: 100%;
    max-width: 100%;
    /* dvh keeps the sheet inside the visible viewport (mobile browser chrome). */
    max-height: min(78dvh, 36rem);
    border-radius: 16px 16px 0 0;
    z-index: 90;
    padding: 0.65rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(7, 17, 26, 0.18);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .values-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1;
    margin: -0.15rem -0.15rem 0.35rem;
    padding: 0.35rem 0.15rem 0.55rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 0.95rem;
  }
  .values-sheet-head .values-close {
    flex: none;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
  }
  .values-panel .vrow { padding: 0.65rem 0.15rem; }
  .values-panel .seg span {
    min-height: 2.75rem;
    padding: 0.6rem 0.3rem;
    font-size: 0.84rem;
  }
}
