/* The stylesheet from before Phlex and Tailwind, in the lowest layer so a
   utility always wins over it. It goes page by page (tailwind/application.css). */
@layer legacy, theme, base, components, utilities;

@layer legacy {
/* Jobfinder — plain, legible, and honest about provenance. */
:root {
  --ink: #1d2126; --fx-muted: #6b7280; --line: #e3e6ea; --paper: #ffffff; --ground: #f6f7f9;
  --good: #1f7a3e; --good-bg: #e6f4ea; --warn: #8a5a00; --warn-bg: #fff4d6;
  --bad: #b3261e; --bad-bg: #fbe9e7; --review: #5b3fbf; --review-bg: #ece7fb; --fx-accent: #1d4ed8;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--ground); }
header.site { background: var(--paper); border-bottom: 1px solid var(--line); }
header.site nav { max-width: 1200px; margin: 0 auto; padding: 0.6rem 1.25rem; display: flex; gap: 1.25rem; align-items: center; }
/* Links: near-black with a soft grey underline that darkens on hover. Where
   links are many (tables, menus, headings, pills) the line waits for the
   hover. */
a { color: var(--ink); text-decoration: underline; text-decoration-color: #c3c9d1; text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: text-decoration-color 0.15s; }
a:hover { text-decoration-color: currentColor; }
table a, nav a, h1 a, h2 a, h3 a, .menu-item { text-decoration-color: transparent; }
table a:hover, nav a:hover, h1 a:hover, h2 a:hover, h3 a:hover { text-decoration-color: currentColor; }
a.badge { text-decoration: none; }
main.page { max-width: 1200px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
h1 { font-size: 1.5rem; margin: 0.75rem 0; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.muted { color: var(--fx-muted); font-size: 0.92em; }
.hint { color: var(--fx-muted); font-size: 0.85em; margin-left: 0.75rem; }
code, pre { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre.json, pre.steps { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem 1rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
table.list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
table.list th, table.list td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fx-muted); }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.current { background: var(--good-bg); }
table.gates th { text-transform: none; font-size: 0.95rem; color: var(--ink); width: 8rem; }
td.url, ul.urls { word-break: break-all; font-size: 0.9em; }
ul.urls { padding-left: 1.2rem; margin: 0.25rem 0; }
/* Pills are always lowercase: status, gate, origin, activity alike. */
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; vertical-align: middle; text-transform: lowercase; }
.badge-good { color: var(--good); background: var(--good-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-review { color: var(--review); background: var(--review-bg); }
.badge-muted { color: var(--fx-muted); background: var(--line); }
/* An ad's topic tag ("astro", "research"). */
/* A tag's colours come from its record. */
.badge-tag { color: var(--tag-colour, #374151); background: var(--tag-background, #e5e7eb); }
.flash { max-width: 1200px; margin: 0.75rem auto 0; padding: 0.6rem 1rem; border-radius: 6px; }
.flash-notice { background: var(--good-bg); color: var(--good); }
.flash-alert { background: var(--bad-bg); color: var(--bad); }
.find-bar { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.9rem 1rem; margin: 0.5rem 0 1rem; }
.find-form input[type=url] { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; font-size: 1rem; max-width: 100%; }
.find-form.stacked { display: grid; gap: 0.6rem; max-width: 40rem; }
/* One box for a button, a submit and a link styled as one: buttons do not
   inherit the page font or line-height on their own. */
input[type=submit], button, a.button, summary.button { display: inline-flex; align-items: center; box-sizing: border-box; margin: 0; padding: 0.45rem 0.9rem; border: 1px solid var(--fx-accent); background: var(--fx-accent); color: #fff; border-radius: 4px; cursor: pointer; font: inherit; font-size: 0.95rem; line-height: 1.25; text-decoration: none; }
a.button:hover { text-decoration: none; }
input.small, button.small, a.button.small, summary.button.small, .actions form.button_to input { padding: 0.2rem 0.6rem; font-size: 0.82rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0.5rem 0 1rem; }
.actions form { display: inline; }
.actions form.button_to input.danger { color: var(--bad); }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem 1rem; }
dl.facts dt { color: var(--fx-muted); }
/* A long address or reference wraps within the box rather than widening
   it (Buglife's reference is its whole job URL). */
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* A salary pill: its figures keep their case (K, £), and its tooltip says where it was found. */
.badge-salary { color: var(--ink); background: var(--ground); border: 1px solid var(--line); text-transform: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge-salary[data-tip] { cursor: help; }
/* Full-time, part-time: quiet, like the salary, its tooltip the advert's words. */
.badge-hours { color: var(--ink); background: var(--ground); border: 1px solid var(--line); white-space: nowrap; }
.badge-hours[data-tip] { cursor: help; }
.badge-contract { color: var(--ink); background: var(--ground); border: 1px solid var(--line); white-space: nowrap; }
.badge-contract[data-tip] { cursor: help; }
.badge-workplace { color: var(--ink); background: var(--ground); border: 1px solid var(--line); white-space: nowrap; }
.badge-workplace[data-tip] { cursor: help; }
/* Where the job is: place names keep their capitals, on light yellow. */
.badge-location { color: #713f12; background: #fef9c3; border: 1px solid #fde68a; text-transform: none; white-space: nowrap; }
.badge-location[data-tip] { cursor: help; }

/* An instant tooltip: a dark box above, centred, with an arrow. */
[data-tip] { position: relative; }
[data-tip]:focus-visible { outline: 2px solid var(--fx-accent); outline-offset: 2px; }
/* Out of the layout until shown: a hidden tooltip still widened the page,
   and a phone could scroll sideways into nothing. */
[data-tip]::after, [data-tip]::before { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0; z-index: 30; display: none; }
[data-tip]::after {
  content: attr(data-tip); bottom: calc(100% + 9px);
  width: max-content; max-width: 20rem; padding: 0.45rem 0.7rem; border-radius: 6px;
  background: #3f4246; color: #fff; font-size: 0.8rem; font-weight: 400; line-height: 1.4;
  text-align: center; text-transform: none; white-space: normal; letter-spacing: normal;
}
[data-tip]::before { content: ""; bottom: calc(100% - 3px); border: 6px solid transparent; border-top-color: #3f4246; }
[data-tip]:hover::after, [data-tip]:hover::before, [data-tip]:focus-visible::after, [data-tip]:focus-visible::before { opacity: 1; display: block; }
.tipped[data-tip] { cursor: help; }
/* A title link's tooltip sits above it, left-aligned, as titles are. */
a.tipped[data-tip] { cursor: pointer; }
a.tipped[data-tip]::after, h1 .tipped[data-tip]::after { left: 0; transform: none; text-align: left; }
a.tipped[data-tip]::before, h1 .tipped[data-tip]::before { left: 1.25rem; transform: none; }
.salary-line { margin: 0.5rem 0 0.75rem; }
/* Workplace, hours and contract: one row of pills under the salary, each with its icon. */
.terms-line { margin: 0.5rem 0 0.75rem; }
.salary-line + .terms-line { margin-top: -0.4rem; }
.pill-icon { width: 0.85em; height: 0.85em; margin-right: 0.3em; vertical-align: -0.1em; }
.salary-line .badge-salary { font-size: 0.95rem; padding: 0.2rem 0.75rem; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }
section.alerts { border-left: 4px solid var(--bad); padding-left: 1rem; }
section.warnings { border-left: 4px solid var(--warn); padding-left: 1rem; }
section.proposal { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 1rem 1rem; margin-top: 1.5rem; }
details.escalation, details { margin-top: 1rem; }
details summary { cursor: pointer; font-weight: 600; }
p.working { padding: 1rem; background: var(--warn-bg); border-radius: 6px; }
section.yield { margin-top: 1.5rem; }

/* progress */
section.progress { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem 1rem; margin: 0.75rem 0; }
section.progress.live { border-color: #f0c96a; background: #fffbea; }
.progress-head { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--warn); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
ol.steps { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.86rem; max-height: 24rem; overflow-y: auto; }
ol.steps li { display: grid; grid-template-columns: 6rem 1fr auto; gap: 0.6rem; padding: 0.15rem 0; border-top: 1px solid var(--line); }
ol.steps .stage { color: var(--fx-muted); font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; }
ol.steps .msg { word-break: break-word; }
ol.steps li.stage-notice .msg { color: var(--warn); }
ol.steps li.stage-tier1 .stage, ol.steps li.stage-tier2 .stage, ol.steps li.stage-tier3 .stage, ol.steps li.stage-tier4 .stage, ol.steps li.stage-start .stage, ol.steps li.stage-store .stage { color: var(--fx-accent); font-weight: 600; }

.find-form.stacked textarea { width: 100%; box-sizing: border-box; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; font: 0.9rem/1.4 ui-monospace, Menlo, monospace; }
.find-form.stacked input[type=text] { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; font-size: 1rem; max-width: 100%; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; }
.search-form { display: flex; gap: 0.4rem; align-items: center; margin: 0 0 1rem; flex-wrap: wrap; }
.search-form input[type=search] { flex: 1 1 18rem; max-width: 32rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; font-size: 1rem; }
.page-head .search-form { margin: 0; flex: 1 1 auto; justify-content: flex-end; }
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filters a { padding: 0.25rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.filters a.current { background: var(--fx-accent); border-color: var(--fx-accent); color: #fff; }
.filters a.current .muted { color: inherit; opacity: 0.8; }
pre.markdown { white-space: pre-wrap; word-wrap: break-word; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.9rem 1rem; font: 0.85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 40rem; overflow: auto; }
.prose { max-width: 48rem; line-height: 1.6; }
.details-box { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.5rem; margin: 1.25rem 0; }
.details-box > :first-child { margin-top: 0; }
.details-box > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { margin: 1.4rem 0 0.5rem; font-weight: 600; }
.prose h1 { font-size: 1.15rem; }
.prose h2 { font-size: 1.05rem; }
.prose h3 { font-size: 0.95rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.2rem 0; }
.prose blockquote { margin: 0.8rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--fx-muted); }
details.raw-markdown { margin: 1.5rem 0; }
details.raw-markdown summary { cursor: pointer; color: var(--fx-muted); }
dl.facts dd p { margin: 0 0 0.4rem; }
/* The ad's own JobPosting, in the facts box under Identity, across both columns. */
dl.facts details.job-posting-schema { grid-column: 1 / -1; margin: 0.4rem 0 0; }

/* status dot: the most recent finished run */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; background: var(--line); }
.dot-good { background: var(--good); }
.dot-bad { background: var(--bad); }
.dot-muted { background: #b8bec6; }

/* a source that needs a person, and why */
section.attention { background: var(--warn-bg); border: 1px solid #f0c96a; border-radius: 6px; padding: 0.25rem 1rem 0.75rem; margin: 1rem 0; }
section.attention h2 { margin-top: 0.75rem; }
section.attention p { margin: 0.35rem 0; }
.repeat-list { display: grid; gap: 0.4rem; }
.find-bar h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
dialog.modal { border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem 1.5rem; width: min(36rem, calc(100vw - 2rem)); background: var(--paper); color: var(--ink); }
dialog.modal::backdrop { background: rgba(17, 24, 39, 0.45); }
dialog.modal h2 { margin: 0 0 0.9rem; font-size: 1.15rem; }
dialog.modal .flash { margin: 0 0 0.75rem; }
/* A wide dialog for raw text: an ad's markdown and JSON-LD. */
dialog.modal-wide { width: min(56rem, calc(100vw - 2rem)); max-height: 85vh; padding: 0; overflow: hidden; }
dialog.modal-wide[open] { display: flex; flex-direction: column; }
dialog.modal-wide .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); }
dialog.modal-wide .modal-head h2 { margin: 0; }
dialog.modal-wide pre.markdown { margin: 0; padding: 1rem 1.25rem; overflow: auto; flex: 1; border: 0; border-radius: 0; max-height: none; }
button.modal-close { background: none; border: 0; color: var(--fx-muted); font-size: 1.4rem; line-height: 1; padding: 0.1rem 0.4rem; }
button.modal-close:hover { color: var(--ink); }
/* The summary and location, folded away under the identity. A fold cannot
   share the facts' grid, so beside an ad both keep one label width. */
.job-facts dl.facts, .job-facts details.facts-more > dl { grid-template-columns: 8.5rem minmax(0, 1fr); }
dl.facts details.facts-more { grid-column: 1 / -1; }
dl.facts details.facts-more > summary { cursor: pointer; color: var(--ink); font-size: 0.9rem; margin-top: 0.3rem; }
dl.facts details.facts-more > dl { display: grid; gap: 0.3rem 1.25rem; margin: 0.4rem 0 0; }
dl.facts details.facts-more > dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* The links at the foot of the facts that open them. */
dl.facts .facts-raw { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; margin-top: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
button.link-button { background: none; border: 0; padding: 0; color: var(--ink); font-size: 0.9rem; text-decoration: underline; text-decoration-color: #c3c9d1; text-underline-offset: 0.22em; cursor: pointer; }
button.link-button:hover { text-decoration-color: currentColor; }
button.secondary { background: var(--paper); color: var(--fx-accent); }
.source-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30rem; }
.jobs-total { white-space: nowrap; width: 1%; }
td.row-menu { width: 1%; white-space: nowrap; text-align: right; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " ▾"; }
details.menu .menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 9rem; display: grid; padding: 0.3rem 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12); text-align: left; }
details.menu .menu-items form { display: block; margin: 0; }
details.menu .menu-item, details.menu .menu-items form button { display: block; width: 100%; padding: 0.4rem 0.9rem; border: 0; border-radius: 0; background: none; color: var(--ink); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
details.menu .menu-item:hover, details.menu .menu-items form button:hover { background: var(--ground); text-decoration: none; }
details.menu .menu-item.danger, details.menu .menu-items form button.danger { color: var(--bad); }

/* An organisation's logo beside its name. */
.org-title { display: flex; align-items: center; gap: 0.75rem; }
.org-title h1 { margin: 0; }
.org-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); padding: 4px; flex: none; }
/* The list's logo, left of the name; an empty one keeps the names in line. */
.org-cell { display: flex; align-items: center; gap: 0.6rem; }
.org-logo-small { display: inline-block; width: 32px; height: 32px; object-fit: contain; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); padding: 3px; flex: none; box-sizing: border-box; }
/* No usable logo: the organisation's initials in the same square. */
.org-initials { display: inline-flex; align-items: center; justify-content: center; color: var(--fx-muted); background: var(--ground); font-weight: 700; letter-spacing: 0.02em; line-height: 1; }
.org-logo-small.org-initials { font-size: 0.72rem; }
.org-logo.org-initials { font-size: 1.05rem; }
/* Uploading one on the edit page: the logo now kept, beside the chooser. */
.logo-field { display: flex; align-items: center; gap: 0.75rem; }
.logo-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); padding: 4px; flex: none; }
/* A job in the list: the organisation's logo beside its title, with a row
   of pills beneath (closed, internal, and any added later). */
.job-card { display: flex; align-items: flex-start; gap: 0.75rem; min-height: 60px; padding: 0.35rem 0; box-sizing: border-box; }
.job-logo { display: inline-block; width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); padding: 3px; flex: none; box-sizing: border-box; }
.job-logo.org-initials { font-size: 0.8rem; }
.job-card-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.job-card-title { font-weight: 600; line-height: 1.3; }
.job-card-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 1.2rem; }
.job-card-pills:not(:has(*)) { display: none; }
/* An ad's one-to-two-sentence summary: under its title in the list, under
   its salary on the ad. */
.job-card-summary { margin: 0; color: var(--fx-muted); font-size: 0.86rem; line-height: 1.4; max-width: 46rem; }
.job-summary { margin: 0; }
.summary-box { margin-bottom: 0.75rem; }
/* Where the job is: a line in its own white box, above the summary; its tooltip says where it was found. */
.location-box { margin-bottom: 0.75rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.location-box + .summary-box { margin-top: 0; }
/* The jobs list's tag filters: the tags' own pills; the chosen one ringed. */
.tag-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.35rem 0 1rem; }
.tag-filters a.badge-tag { text-decoration: none; }
.tag-filters a.badge-tag:hover { filter: brightness(0.96); }
.tag-filters a.badge-tag.current { box-shadow: 0 0 0 2px var(--tag-colour, #374151); }
.tag-filters a.badge-review { text-decoration: none; }
.tag-filters a.badge-review.current { box-shadow: 0 0 0 2px currentColor; }
.tag-filters .tag-count { opacity: 0.7; font-weight: 500; }

/* Runs tab: what the background queue is doing now. */
.queue-now { margin: 0 0 1.5rem; }
.queue-now h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.queue-stats { border-collapse: collapse; }
.queue-stats th, .queue-stats td { padding: 0.3rem 0.9rem 0.3rem 0; text-align: left; }
.queue-stats td { font-variant-numeric: tabular-nums; text-align: right; min-width: 4.5rem; }
.queue-stats thead th { font-weight: 600; text-align: right; }
.queue-stats thead th:first-child { text-align: left; }
}
