/* Job Applications: the one style sheet for the whole plugin.
 * Part 1 is the admin screens (Dashboard, Applications, Templates, Settings and the job editor), scoped to .jap-ui and body.jap-admin.
 * Part 2 is the public Careers list, the job page and the application form, scoped to .jap.
 * Colours are tokens. Admin tokens (--ja-*) come in a light and a dark set; [data-theme="dark"] swaps them. Public tokens (--jap-*)
 * are light, and only the button colour (--jap-accent) is set from the plugin settings. Text and background pairs were chosen for at
 * least 4.5 to 1 contrast and are checked by the browser test in lab/ui-test-job-applications.mjs. */

/* ================================================================== */
/* PART 1: ADMIN                                                       */
/* ================================================================== */

body.jap-admin, .jap-ui {
	--ja-page: #eef1f5;
	--ja-surface: #ffffff;
	--ja-surface2: #f5f7fa;
	--ja-ink: #151a1f;
	--ja-ink2: #3b434c;
	--ja-muted: #59626d;
	--ja-line: #cfd5dd;
	--ja-line2: #e4e8ee;
	--ja-axis: #aab2bd;
	--ja-brand: #1f56d9;
	--ja-brand-hover: #1745b5;
	--ja-brand-ink: #1f56d9;
	--ja-brand-soft: #e6edff;
	--ja-brand-line: #b9c9f5;
	--ja-good: #0a6b34;
	--ja-good-bg: #e0f3e7;
	--ja-bad: #b42318;
	--ja-bad-bg: #fdeceb;
	--ja-warn: #7a4600;
	--ja-warn-bg: #fff3d6;
	--ja-warn-line: #ecd08a;
	--ja-flat: #e9edf2;
	--ja-purple: #5b2fb3;
	--ja-purple-bg: #efe8fb;
	--ja-teal: #0b6b6b;
	--ja-teal-bg: #dcf3f2;
	--ja-indigo: #3a3fb5;
	--ja-indigo-bg: #e8e9fb;
	--ja-hover: #f3f6fd;
	--ja-tip-bg: #151a1f;
	--ja-tip-ink: #ffffff;
	--ja-star: #9a5a00;
	--ja-shadow: 0 1px 2px rgba(16, 24, 40, .07), 0 1px 3px rgba(16, 24, 40, .06);
	--ja-pop: 0 8px 24px rgba(16, 24, 40, .18);
	--ja-radius: 10px;
}
.jap-ui { color: var(--ja-ink); color-scheme: light; max-width: none; font-size: 13px; }
.jap-ui[data-theme="dark"] {
	--ja-page: #0e1217;
	--ja-surface: #1a2029;
	--ja-surface2: #202833;
	--ja-ink: #e9eef4;
	--ja-ink2: #bcc6d1;
	--ja-muted: #95a1af;
	--ja-line: #323c49;
	--ja-line2: #262e39;
	--ja-axis: #4a5565;
	--ja-brand: #2f63e0;
	--ja-brand-hover: #2555c4;
	--ja-brand-ink: #86acff;
	--ja-brand-soft: #1d2b4d;
	--ja-brand-line: #2f4580;
	--ja-good: #66d493;
	--ja-good-bg: #123222;
	--ja-bad: #ff9288;
	--ja-bad-bg: #3b1a1c;
	--ja-warn: #f0c765;
	--ja-warn-bg: #3a2f10;
	--ja-warn-line: #5b4a1a;
	--ja-flat: #2a3340;
	--ja-purple: #c9b3ff;
	--ja-purple-bg: #2a2050;
	--ja-teal: #6fdcd8;
	--ja-teal-bg: #11302f;
	--ja-indigo: #b4b8ff;
	--ja-indigo-bg: #22244f;
	--ja-hover: #212b3b;
	--ja-tip-bg: #e9eef4;
	--ja-tip-ink: #151a1f;
	--ja-star: #f0b24a;
	--ja-shadow: 0 1px 2px rgba(0, 0, 0, .35);
	--ja-pop: 0 10px 28px rgba(0, 0, 0, .55);
	color-scheme: dark;
}
/* The whole page around the screens follows the theme, down to the bottom edge and the WordPress footer (only on these screens; the script
   adds the class to both the page and its body, so nothing light shows below a short screen). #0e1217 is the same colour as --ja-page. */
html.jap-ui-dark { background: #0e1217; color-scheme: dark; }
html.jap-ui-dark body, body.jap-ui-dark, body.jap-ui-dark #wpwrap, body.jap-ui-dark #wpcontent, body.jap-ui-dark #wpbody, body.jap-ui-dark #wpbody-content, body.jap-ui-dark #wpfooter { background: #0e1217; }
body.jap-ui-dark #wpfooter, body.jap-ui-dark #wpfooter a, body.jap-ui-dark #wpfooter p { color: #95a1af; }

.jap-ui *, .jap-ui *::before, .jap-ui *::after { box-sizing: border-box; }
.jap-ui .notice, .jap-ui div.updated, .jap-ui div.error { color: #1d2327; }
.jap-ui .notice a { color: #2271b1; }
.jap-ui button { font-family: inherit; }
.jap-ui :focus-visible { outline: 2px solid var(--ja-brand-ink); outline-offset: 2px; }
.jap-ui a { color: var(--ja-brand-ink); }
.jap-ui p { margin: 0 0 6px; }
.jap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header: one compact row ---------- */
.jap-ui .jap-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; margin: 0 0 10px; }
.jap-ui .jap-pagetitle { padding: 2px 0 0; margin: 0 0 2px; font-size: 20px; line-height: 1.3; font-weight: 600; color: var(--ja-ink); }
.jap-ui .jap-lede { margin: 0; color: var(--ja-ink2); font-size: 13px; line-height: 1.45; max-width: 820px; }
.jap-ui .jap-controls { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-left: auto; }
.jap-ui .jap-seg { display: inline-flex; background: var(--ja-flat); border-radius: 8px; padding: 2px; gap: 2px; }
.jap-ui .jap-seg button, .jap-ui .jap-seg label span { border: 0; background: transparent; padding: 4px 11px; border-radius: 6px; font-size: 12.5px; color: var(--ja-ink2); cursor: pointer; line-height: 1.3; display: inline-block; }
.jap-ui .jap-seg button:hover { color: var(--ja-ink); }
.jap-ui .jap-seg button[aria-pressed="true"], .jap-ui .jap-seg input:checked + span { background: var(--ja-surface); color: var(--ja-ink); font-weight: 600; box-shadow: var(--ja-shadow); }
.jap-ui .jap-seg input { position: absolute; opacity: 0; pointer-events: none; }
.jap-ui .jap-seg input:focus-visible + span { outline: 2px solid var(--ja-brand-ink); }

/* ---------- Buttons and inputs ---------- */
.jap-ui .jap-btn { border: 1px solid var(--ja-line); background: var(--ja-surface); color: var(--ja-ink); padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12.5px; line-height: 1.3; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.jap-ui .jap-btn:hover { border-color: var(--ja-axis); background: var(--ja-surface2); color: var(--ja-ink); }
.jap-ui .jap-btn.primary { background: var(--ja-brand); border-color: var(--ja-brand); color: #fff; }
.jap-ui .jap-btn.primary:hover { background: var(--ja-brand-hover); border-color: var(--ja-brand-hover); color: #fff; }
.jap-ui .jap-btn-danger { color: var(--ja-bad); border-color: var(--ja-bad); }
.jap-ui .jap-btn-danger:hover { background: var(--ja-bad-bg); color: var(--ja-bad); border-color: var(--ja-bad); }
.jap-ui .jap-btn-ghost { background: transparent; }
.jap-ui .jap-btn:disabled { opacity: .5; cursor: not-allowed; }
.jap-ui .jap-link { background: none; border: 0; padding: 0; color: var(--ja-brand-ink); text-decoration: underline; cursor: pointer; font-size: 12px; }
.jap-ui .jap-in { width: 100%; max-width: 100%; border: 1px solid var(--ja-line); background: var(--ja-surface); color: var(--ja-ink); border-radius: 7px; padding: 5px 9px; font-size: 13px; line-height: 1.4; min-height: 32px; box-shadow: none; }
.jap-ui select.jap-in { padding-right: 24px; }
/* WordPress forces near-black text on a drop-down while it is hovered, focused or open (.wp-core-ui select:hover and :focus), which made the chosen text vanish in dark mode. These rules are more specific, so the theme colours stay. */
.jap-ui select.jap-in:hover, .jap-ui select.jap-in:focus, .jap-ui select.jap-in:active { color: var(--ja-ink); background-color: var(--ja-surface); }
.jap-ui select.jap-in:hover { border-color: var(--ja-axis); }
.jap-ui select.jap-in:focus, .jap-ui select.jap-in:active { border-color: var(--ja-brand-ink); box-shadow: 0 0 0 1px var(--ja-brand-ink); }
.jap-ui textarea.jap-in { min-height: 0; resize: vertical; }
.jap-ui .jap-in:focus { border-color: var(--ja-brand-ink); box-shadow: 0 0 0 1px var(--ja-brand-ink); outline: 0; }
.jap-ui .jap-in::placeholder { color: var(--ja-muted); opacity: 1; }
.jap-ui .jap-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ja-ink); margin-right: 10px; }
.jap-ui .jap-check input { margin: 0; }
.jap-ui .jap-colour { width: 56px; min-height: 32px; padding: 2px; }

/* The Careers page address: the fixed start of the address, the part you can change, and a closing slash */
.jap-ui .jap-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.jap-ui .jap-addr .jap-in { flex: 1 1 140px; width: auto; min-width: 120px; }
.jap-ui .jap-addr-pre { color: var(--ja-ink2); font-size: 12.5px; overflow-wrap: anywhere; }

/* ---------- Tooltips (a round ? that explains a setting) ---------- */
.jap-ui .jap-i { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ja-flat); color: var(--ja-ink2); font-size: 11px; font-weight: 700; cursor: help; margin-left: 5px; position: relative; vertical-align: middle; }
.jap-ui [data-tip]:hover::after, .jap-ui [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: max-content; max-width: 260px; background: var(--ja-tip-bg); color: var(--ja-tip-ink); font-size: 12px; font-weight: 400; line-height: 1.4; padding: 7px 10px; border-radius: 8px; text-align: left; pointer-events: none; white-space: normal; box-shadow: var(--ja-pop); }

/* ---------- Tabs ---------- */
.jap-ui .jap-tabbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 16px; margin: 0 0 10px; box-shadow: inset 0 -1px 0 var(--ja-line); }
.jap-ui .jap-tabs { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; max-width: 100%; }
.jap-ui .jap-tab { border: 0; background: transparent; padding: 7px 12px 8px; font-size: 13px; color: var(--ja-ink2); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.jap-ui .jap-tab:hover { color: var(--ja-ink); }
.jap-ui .jap-tab.is-on, .jap-ui .jap-tab[aria-selected="true"] { color: var(--ja-brand-ink); border-bottom-color: var(--ja-brand); font-weight: 600; }
.jap-ui .jap-tab .jap-count { background: var(--ja-flat); color: var(--ja-ink2); border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 600; }
.jap-ui .jap-tab.is-on .jap-count { background: var(--ja-brand-soft); color: var(--ja-brand-ink); }

/* ---------- Cards, banners, layout ---------- */
.jap-ui .jap-card { background: var(--ja-surface); border: 1px solid var(--ja-line); border-radius: var(--ja-radius); box-shadow: var(--ja-shadow); padding: 12px 14px; margin: 0 0 12px; position: relative; }
.jap-ui .jap-card h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ja-ink); line-height: 1.3; }
.jap-ui .jap-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.jap-ui .jap-sub { margin: 0 0 4px; color: var(--ja-ink2); font-size: 12px; line-height: 1.4; }
.jap-ui .jap-muted { color: var(--ja-muted); font-size: 12px; }
.jap-ui .jap-hint { color: var(--ja-ink2); font-size: 12.5px; margin: 0 0 8px; line-height: 1.45; }
/* Settings cards flow down two columns (not a row grid), so a short card never leaves an empty hole beside a tall one. */
.jap-ui .jap-grid2 { column-count: 2; column-gap: 12px; }
.jap-ui .jap-grid2 > .jap-card { margin: 0 0 12px; break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid; }
.jap-ui .jap-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
.jap-ui .jap-banner { border: 1px solid var(--ja-line); border-radius: 8px; padding: 7px 12px; margin: 0 0 10px; background: var(--ja-surface); color: var(--ja-ink); font-size: 13px; }
.jap-ui .jap-banner.is-good { background: var(--ja-good-bg); border-color: var(--ja-good); color: var(--ja-good); }
.jap-ui .jap-banner.is-bad { background: var(--ja-bad-bg); border-color: var(--ja-bad); color: var(--ja-bad); }
.jap-ui .jap-banner.is-warn { background: var(--ja-warn-bg); border-color: var(--ja-warn-line); color: var(--ja-warn); }
.jap-ui .jap-savebar { margin: 4px 0 0; display: flex; gap: 8px; }
.jap-ui .jap-empty-admin { text-align: center; padding: 28px 14px; }
.jap-ui .jap-foot { margin: 8px 0 0; }

/* ---------- Status pills and the status steps ---------- */
.jap-pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--ja-flat); color: var(--ja-ink2); }
.jap-s-new { background: var(--ja-brand-soft); color: var(--ja-brand-ink); }
.jap-s-reviewing, .jap-s-paused { background: var(--ja-warn-bg); color: var(--ja-warn); }
.jap-s-shortlisted { background: var(--ja-purple-bg); color: var(--ja-purple); }
.jap-s-interview { background: var(--ja-teal-bg); color: var(--ja-teal); }
.jap-s-offer { background: var(--ja-indigo-bg); color: var(--ja-indigo); }
.jap-s-hired, .jap-s-open { background: var(--ja-good-bg); color: var(--ja-good); }
.jap-s-rejected, .jap-s-closed { background: var(--ja-bad-bg); color: var(--ja-bad); }
.jap-s-withdrawn, .jap-s-filled, .jap-s-draft { background: var(--ja-flat); color: var(--ja-ink2); }
.jap-ui .jap-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.jap-ui .jap-step { border: 1px solid var(--ja-line); background: var(--ja-surface); color: var(--ja-ink); border-radius: 999px; padding: 4px 13px; font-size: 12.5px; cursor: pointer; }
.jap-ui .jap-step:hover { border-color: var(--ja-axis); background: var(--ja-surface2); }
.jap-ui .jap-step.is-current { background: var(--ja-brand); border-color: var(--ja-brand); color: #fff; font-weight: 600; }
.jap-ui .jap-step.is-current.jap-s-rejected { background: var(--ja-bad); border-color: var(--ja-bad); color: #fff; }
.jap-ui[data-theme="dark"] .jap-step.is-current.jap-s-rejected { background: #b42318; border-color: #b42318; color: #fff; }
.jap-ui .jap-statusbar { padding: 8px 14px; }

/* ---------- Filters, table, bulk bar ---------- */
.jap-ui .jap-filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.jap-ui .jap-filterbar .jap-in { width: auto; min-width: 180px; }
.jap-ui .jap-tablewrap { padding: 0; overflow-x: auto; }
.jap-ui .jap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jap-ui .jap-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ja-ink2); padding: 8px 12px; border-bottom: 1px solid var(--ja-line); background: var(--ja-surface2); white-space: nowrap; }
.jap-ui .jap-table th a { color: var(--ja-ink2); text-decoration: none; }
.jap-ui .jap-table td { padding: 8px 12px; border-bottom: 1px solid var(--ja-line2); vertical-align: top; color: var(--ja-ink); }
.jap-ui .jap-table tr:last-child td { border-bottom: 0; }
.jap-ui .jap-table tbody tr:hover td { background: var(--ja-hover); }
.jap-ui .jap-c-cb { width: 32px; }
.jap-ui .jap-name { font-weight: 600; text-decoration: none; }
.jap-ui .jap-name:hover { text-decoration: underline; }
.jap-ui .jap-ok { color: var(--ja-good); font-weight: 600; }
.jap-ui .jap-flag { display: inline-block; background: var(--ja-bad-bg); color: var(--ja-bad); border-radius: 999px; padding: 0 8px; font-size: 11.5px; font-weight: 600; }
.jap-ui .jap-stars { color: var(--ja-star); letter-spacing: 1px; white-space: nowrap; }
.jap-ui .jap-star-off { color: var(--ja-muted); }
.jap-ui .jap-bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.jap-ui .jap-bulkbar .jap-in { width: auto; min-width: 230px; }
.jap-ui .jap-pager { margin: 8px 0; }
.jap-ui .jap-pager .page-numbers { display: inline-block; padding: 3px 10px; border: 1px solid var(--ja-line); border-radius: 6px; margin-right: 4px; text-decoration: none; color: var(--ja-ink); background: var(--ja-surface); }
.jap-ui .jap-pager .page-numbers.current { background: var(--ja-brand); border-color: var(--ja-brand); color: #fff; }

/* ---------- One application ---------- */
.jap-ui .jap-dl { margin: 0; }
.jap-ui .jap-dl > div { display: grid; grid-template-columns: minmax(130px, 34%) minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--ja-line2); }
.jap-ui .jap-dl > div:last-child { border-bottom: 0; }
.jap-ui .jap-dl dt { color: var(--ja-ink2); font-size: 12.5px; }
.jap-ui .jap-dl dd { margin: 0; color: var(--ja-ink); overflow-wrap: anywhere; }
.jap-ui .jap-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jap-ui .jap-rate { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-bottom: 4px; }
.jap-ui .jap-rate input { position: absolute; opacity: 0; pointer-events: none; }
.jap-ui .jap-rate label { font-size: 24px; line-height: 1; color: var(--ja-muted); cursor: pointer; position: relative; }
.jap-ui .jap-rate label::before { content: "\2606"; }
.jap-ui .jap-rate label:hover, .jap-ui .jap-rate label:hover ~ label, .jap-ui .jap-rate input:checked ~ label { color: var(--ja-star); }
.jap-ui .jap-rate label:hover::before, .jap-ui .jap-rate label:hover ~ label::before, .jap-ui .jap-rate input:checked ~ label::before { content: "\2605"; }
.jap-ui .jap-rate input:focus-visible + label { outline: 2px solid var(--ja-brand-ink); }
.jap-ui .jap-mailform .jap-in, .jap-ui .jap-noteform .jap-in { margin-bottom: 6px; }
.jap-ui .jap-timeline { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.jap-ui .jap-ev { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; align-items: start; }
.jap-ui .jap-ev-k { font-size: 11px; font-weight: 600; text-align: center; border-radius: 6px; padding: 2px 4px; background: var(--ja-flat); color: var(--ja-ink2); }
.jap-ui .jap-ev-note .jap-ev-k { background: var(--ja-warn-bg); color: var(--ja-warn); }
.jap-ui .jap-ev-status .jap-ev-k { background: var(--ja-brand-soft); color: var(--ja-brand-ink); }
.jap-ui .jap-ev-email_out .jap-ev-k { background: var(--ja-teal-bg); color: var(--ja-teal); }
.jap-ui .jap-ev-b { overflow-wrap: anywhere; color: var(--ja-ink); }
.jap-ui .jap-danger { border-color: var(--ja-bad); }

/* ---------- File viewer (a window over the application screen, opened by the View button) ---------- */
.jap-ui .jap-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.jap-ui .jap-viewer { width: min(1120px, 96vw); height: min(92vh, 1000px); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--ja-line); border-radius: 12px; background: var(--ja-surface); color: var(--ja-ink); box-shadow: var(--ja-pop); overflow: hidden; }
.jap-ui .jap-viewer[open] { display: flex; flex-direction: column; }
.jap-ui .jap-viewer::backdrop { background: rgba(10, 14, 20, .62); }
.jap-ui .jap-vw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--ja-line); background: var(--ja-surface2); }
.jap-ui .jap-vw-head { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.jap-ui .jap-vw-name { font-size: 14px; overflow-wrap: anywhere; }
.jap-ui .jap-vw-sub { font-size: 12px; color: var(--ja-muted); }
.jap-ui .jap-vw-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.jap-ui .jap-vw-tabs button { border: 1px solid var(--ja-line); background: var(--ja-surface); color: var(--ja-ink2); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; }
.jap-ui .jap-vw-tabs button[aria-pressed="true"] { background: var(--ja-brand-soft); border-color: var(--ja-brand-line); color: var(--ja-brand-ink); font-weight: 600; }
.jap-ui .jap-vw-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.jap-ui .jap-vw-body { position: relative; flex: 1 1 auto; min-height: 0; background: var(--ja-page); }
.jap-ui .jap-vw-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.jap-ui .jap-vw-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ja-ink2); background: var(--ja-page); font-size: 14px; pointer-events: none; }
.jap-ui .jap-vw-wait[hidden] { display: none; }

/* ---------- Settings ---------- */
.jap-ui .jap-set { display: grid; grid-template-columns: minmax(150px, 34%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ja-line2); align-items: start; }
.jap-ui .jap-set:last-child { border-bottom: 0; }
.jap-ui .jap-set-l label { font-weight: 600; color: var(--ja-ink); }
.jap-ui .jap-set-f .jap-in { margin-bottom: 2px; }

.jap-ui .jap-smtp { margin: 0 0 6px; padding: 6px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.45; }
.jap-ui .jap-smtp.is-ok { background: var(--ja-good-bg); color: var(--ja-good); }
.jap-ui .jap-smtp.is-warn { background: var(--ja-warn-bg); color: var(--ja-warn); }
/* ---------- Post a job and the Jobs list (the plugin's own pages) ---------- */
.jap-ui .jap-jobgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.jap-ui .jap-jobmain { min-width: 0; }
.jap-ui .jap-jobaside { position: sticky; top: 44px; display: grid; gap: 12px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; scrollbar-width: thin; }
.jap-ui .jap-jobaside .jap-card { margin: 0; }
.jap-ui .jap-step-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 10px; }
.jap-ui .jap-step-head h2 { margin: 0; padding: 0; font-size: 16px; line-height: 1.3; font-weight: 600; color: var(--ja-ink); }
.jap-ui .jap-step-head p { margin: 1px 0 0; color: var(--ja-ink2); font-size: 12.5px; }
.jap-ui .jap-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ja-brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.jap-ui .jap-stepcard { scroll-margin-top: 44px; }
.jap-ui .jap-title-in { font-size: 18px; padding: 8px 12px; min-height: 42px; }
.jap-ui .jap-jf { margin: 0 0 10px; min-width: 0; }
.jap-ui .jap-jf-l { display: flex; align-items: center; margin-bottom: 3px; }
.jap-ui .jap-lab { font-weight: 600; color: var(--ja-ink); font-size: 12.5px; }
.jap-ui .jap-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.jap-ui .jap-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.jap-ui .jap-row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.jap-ui .jap-editor { border-radius: 7px; overflow: hidden; }
.jap-ui .jap-editor .wp-editor-container { border-color: var(--ja-line); }
.jap-ui .jap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jap-ui .jap-chip { position: relative; }
.jap-ui .jap-chip input { position: absolute; opacity: 0; pointer-events: none; }
.jap-ui .jap-chip span { display: inline-block; border: 1px solid var(--ja-line); border-radius: 999px; padding: 3px 11px; background: var(--ja-surface); color: var(--ja-ink); cursor: pointer; font-size: 12.5px; }
.jap-ui .jap-chip input:checked + span { background: var(--ja-brand-soft); border-color: var(--ja-brand-ink); color: var(--ja-brand-ink); font-weight: 600; }
.jap-ui .jap-chip input:focus-visible + span { outline: 2px solid var(--ja-brand-ink); outline-offset: 2px; }
.jap-ui .jap-ideas { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.jap-ui .jap-chip-btn { border: 1px dashed var(--ja-axis); background: transparent; color: var(--ja-ink2); border-radius: 999px; padding: 1px 9px; font-size: 12px; cursor: pointer; }
.jap-ui .jap-chip-btn:hover { background: var(--ja-hover); color: var(--ja-ink); }
.jap-ui .jap-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 4px; }
.jap-ui .jap-set-card { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--ja-line); border-radius: 8px; padding: 8px 10px; background: var(--ja-surface); cursor: pointer; }
.jap-ui .jap-set-card:hover { background: var(--ja-hover); }
.jap-ui .jap-set-card input { margin-top: 3px; }
.jap-ui .jap-set-card strong { display: block; color: var(--ja-ink); }
.jap-ui .jap-set-card em { font-style: normal; color: var(--ja-ink2); font-size: 12px; }
.jap-ui .jap-set-card small { display: block; color: var(--ja-muted); font-size: 12px; margin-top: 2px; }

/* A way of applying: a tick box with a short explanation that opens its own settings */
.jap-ui .jap-opt { border: 1px solid var(--ja-line); border-radius: 8px; margin: 0 0 8px; background: var(--ja-surface); }
.jap-ui .jap-opt-l { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; }
.jap-ui .jap-opt-l input { margin-top: 3px; }
.jap-ui .jap-opt-l strong { display: block; color: var(--ja-ink); font-size: 13.5px; }
.jap-ui .jap-opt-l small { display: block; color: var(--ja-ink2); font-size: 12.5px; margin-top: 1px; }
.jap-ui .jap-opt-sub { padding: 8px 12px 2px 36px; border-top: 1px dashed var(--ja-line2); }
.jap-ui .jap-opt-sub[hidden] { display: none; }

/* ---------- Post a job, one step at a time ---------- */
/* The script adds the step bar and the Back and Next buttons. Steps that are not current are kept in the page (so the description editor and the
   growing boxes still measure correctly) but moved out of sight and out of the tab order. With no script (body keeps "no-js") every step shows. */
.jap-ui .jap-jobmain { position: relative; }
body.js .jap-ui .jap-wizard .jap-stepcard:not(.is-current) { position: absolute; left: 0; top: 0; width: 100%; height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.jap-ui .jap-stepper { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 12px; padding: 0; list-style: none; }
.jap-ui .jap-stepper li { margin: 0; }
.jap-ui .jap-stepper button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1px solid var(--ja-line); background: var(--ja-surface); color: var(--ja-ink2); border-radius: 999px; cursor: pointer; font-size: 12.5px; line-height: 1.3; }
.jap-ui .jap-stepper button:hover { border-color: var(--ja-axis); background: var(--ja-surface2); color: var(--ja-ink); }
.jap-ui .jap-stepper .jap-num-sm { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ja-flat); color: var(--ja-ink2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.jap-ui .jap-stepper li.is-done .jap-num-sm { background: var(--ja-good-bg); color: var(--ja-good); }
.jap-ui .jap-stepper li.is-current button { border-color: var(--ja-brand-ink); background: var(--ja-brand-soft); color: var(--ja-brand-ink); font-weight: 600; }
.jap-ui .jap-stepper li.is-current .jap-num-sm { background: var(--ja-brand); color: #fff; }
.jap-ui .jap-step-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ja-line2); }
.jap-ui .jap-step-nav .jap-btn { padding: 7px 16px; font-size: 13.5px; }
.jap-ui .jap-step-count { color: var(--ja-muted); font-size: 12px; }
.jap-ui .jap-step-head h2:focus { outline: 0; }

/* Boxes that grow as the text gets longer (the script sets the height; the corner handle still works) */
.jap-ui textarea.jap-in { overflow-y: hidden; }

/* Choice lists (drop-downs) stay readable in the dark theme: the list pops up outside the page, so it needs its own colours */
.jap-ui select.jap-in option, .jap-ui select.jap-in optgroup, .jap-ui select option, .jap-ui select optgroup { background-color: var(--ja-surface); color: var(--ja-ink); }
.jap-ui select option:disabled { color: var(--ja-muted); }
.jap-ui select option:checked { background-color: var(--ja-brand); color: #fff; }
.jap-ui select optgroup { font-weight: 700; font-style: normal; }

/* The job description editor (TinyMCE) follows the light or dark theme. Its writing area is inside a frame, so the script colours that part. */
.jap-ui .jap-editor .wp-editor-area { background: var(--ja-surface); color: var(--ja-ink); border: 0; }
.jap-ui[data-theme="dark"] .jap-editor .wp-editor-tools,
.jap-ui[data-theme="dark"] .jap-editor .wp-editor-container,
.jap-ui[data-theme="dark"] .jap-editor .mce-tinymce,
.jap-ui[data-theme="dark"] .jap-editor .mce-container,
.jap-ui[data-theme="dark"] .jap-editor .mce-panel,
.jap-ui[data-theme="dark"] .jap-editor .mce-toolbar-grp,
.jap-ui[data-theme="dark"] .jap-editor .mce-statusbar,
.jap-ui[data-theme="dark"] .jap-editor .mce-edit-area,
.jap-ui[data-theme="dark"] .jap-editor .quicktags-toolbar { background: var(--ja-surface2) !important; border-color: var(--ja-line) !important; color: var(--ja-ink) !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-ico,
.jap-ui[data-theme="dark"] .jap-editor .mce-txt,
.jap-ui[data-theme="dark"] .jap-editor .mce-caret { color: var(--ja-ink) !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-caret { border-top-color: var(--ja-ink) !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-btn { background: transparent !important; border-color: transparent !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-btn:hover,
.jap-ui[data-theme="dark"] .jap-editor .mce-btn:focus { background: var(--ja-hover) !important; border-color: var(--ja-line) !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-btn.mce-active,
.jap-ui[data-theme="dark"] .jap-editor .mce-btn.mce-active:hover { background: var(--ja-brand-soft) !important; border-color: var(--ja-brand-line) !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-btn.mce-disabled .mce-ico { opacity: .4; }
.jap-ui[data-theme="dark"] .jap-editor .mce-path-item,
.jap-ui[data-theme="dark"] .jap-editor .mce-statusbar .mce-container-body { color: var(--ja-ink2) !important; }
.jap-ui[data-theme="dark"] .jap-editor .mce-edit-area { border-color: var(--ja-line) !important; }
.jap-ui .jap-editor .wp-switch-editor { border-color: var(--ja-line); background: var(--ja-surface2); color: var(--ja-ink2); }
.jap-ui .jap-editor .tmce-active .switch-tmce, .jap-ui .jap-editor .html-active .switch-html { background: var(--ja-surface); color: var(--ja-ink); border-bottom-color: var(--ja-surface); }
.jap-ui[data-theme="dark"] .jap-editor .wp-switch-editor { background: var(--ja-surface2); border-color: var(--ja-line); color: var(--ja-ink2); }
.jap-ui[data-theme="dark"] .jap-editor .tmce-active .switch-tmce, .jap-ui[data-theme="dark"] .jap-editor .html-active .switch-html { background: var(--ja-surface); color: var(--ja-ink); border-bottom-color: var(--ja-surface); }
.jap-ui .jap-editor .quicktags-toolbar .ed_button { background: var(--ja-surface); border: 1px solid var(--ja-line); color: var(--ja-ink); }
.jap-ui .jap-editor .quicktags-toolbar .ed_button:hover { background: var(--ja-hover); }

/* The side: publish, checklist, preview */
.jap-ui .jap-pubstate { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jap-ui .jap-side-meta { margin: 8px 0 0; display: flex; justify-content: space-between; gap: 8px; }
.jap-ui .jap-side-meta span { color: var(--ja-ink2); }
.jap-ui .jap-pub-btns { display: grid; gap: 6px; margin-top: 12px; }
.jap-ui .jap-btn-wide { justify-content: center; width: 100%; padding: 8px 12px; font-size: 14px; }
.jap-ui .jap-del { color: var(--ja-bad); margin-top: 10px; }
.jap-ui .jap-checks ul { margin: 0; padding: 0; list-style: none; }
.jap-ui .jap-checks li { padding-left: 24px; position: relative; margin: 0 0 4px; }
.jap-ui .jap-checks li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ja-muted); }
.jap-ui .jap-checks li a { color: var(--ja-ink2); text-decoration: none; }
.jap-ui .jap-checks li a:hover { text-decoration: underline; }
.jap-ui .jap-checks li.is-done a { color: var(--ja-good); }
.jap-ui .jap-checks li.is-done::before { background: var(--ja-good); border-color: var(--ja-good); }
.jap-ui .jap-checks li.is-soft:not(.is-done)::before { border-style: dashed; }
.jap-ui .jap-pv { border: 1px solid var(--ja-line); border-radius: 10px; padding: 12px; background: var(--ja-surface2); }
.jap-ui .jap-pv-title { font-size: 16px; font-weight: 600; color: var(--ja-ink); overflow-wrap: anywhere; }
.jap-ui .jap-pv-sum { color: var(--ja-ink2); margin: 3px 0 8px; font-size: 12.5px; }
.jap-ui .jap-pv-meta { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.jap-ui .jap-pv-meta li { margin: 0; background: var(--ja-flat); color: var(--ja-ink); border-radius: 999px; padding: 1px 10px; font-size: 12px; }
.jap-ui .jap-pv-btn { display: inline-block; background: var(--ja-brand); color: #fff; border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; }

/* The Jobs list */
.jap-ui .jap-jobtable td { vertical-align: middle; }
.jap-ui .jap-rowact { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }

/* ---------- Field builder ---------- */
.jap-ui .jap-bld { display: grid; gap: 6px; }
.jap-ui .jap-bld-row { border: 1px solid var(--ja-line); border-radius: 8px; background: var(--ja-surface); }
.jap-ui .jap-bld-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; }
.jap-ui .jap-bld-move { display: inline-flex; flex-direction: column; gap: 1px; }
.jap-ui .jap-bld-move button { border: 1px solid var(--ja-line); background: var(--ja-surface2); color: var(--ja-ink2); border-radius: 4px; width: 22px; height: 14px; line-height: 1; font-size: 9px; padding: 0; cursor: pointer; }
.jap-ui .jap-bld-move button:disabled { opacity: .35; cursor: default; }
.jap-ui .jap-bld-badge { font-size: 11px; font-weight: 600; background: var(--ja-flat); color: var(--ja-ink2); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.jap-ui .jap-bld-x { border: 0; background: transparent; color: var(--ja-bad); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.jap-ui .jap-bld-body { border-top: 1px solid var(--ja-line2); padding: 8px 10px 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; background: var(--ja-surface2); border-radius: 0 0 8px 8px; }
.jap-ui .jap-bld-body[hidden] { display: none; }
.jap-ui .jap-bld-body .jap-wide { grid-column: 1 / -1; }
.jap-ui .jap-bld-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.jap-ui .jap-bld-add .jap-in { width: auto; min-width: 220px; }
.jap-ui .jap-bld-empty { color: var(--ja-muted); padding: 8px 0; }

/* ---------- Templates ---------- */
.jap-ui .jap-tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.jap-ui .jap-tplcard { margin: 0; }
.jap-ui .jap-tplact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.jap-ui .jap-inline { display: inline; margin: 0; }
.jap-ui .jap-badges { display: inline-flex; gap: 4px; }
.jap-ui .jap-tokens { margin-top: 8px; color: var(--ja-ink2); }
.jap-ui .jap-tokens ul { columns: 2; margin: 6px 0 0 16px; }
.jap-ui .jap-tokens code { background: var(--ja-flat); color: var(--ja-ink); padding: 1px 5px; border-radius: 4px; }

/* ---------- Dashboard ---------- */
/* Figures for right now: the number is a link stretched over the whole tile, and the ? bubble sits above it. */
.jap-ui .jap-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 12px; }
.jap-ui .jap-tile { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; background: var(--ja-surface); border: 1px solid var(--ja-line); border-radius: var(--ja-radius); box-shadow: var(--ja-shadow); padding: 12px 14px; }
.jap-ui .jap-tile:hover { border-color: var(--ja-axis); background: var(--ja-hover); }
.jap-ui .jap-tile-h { display: flex; align-items: center; color: var(--ja-ink2); font-size: 12.5px; }
.jap-ui .jap-tile-h .jap-i { z-index: 2; }
.jap-ui a.jap-tile-v { font-size: 30px; line-height: 1.15; font-weight: 600; color: var(--ja-ink); text-decoration: none; }
.jap-ui a.jap-tile-v::after { content: ""; position: absolute; inset: 0; border-radius: var(--ja-radius); }
.jap-ui a.jap-tile-v:focus-visible { outline: 0; }
.jap-ui a.jap-tile-v:focus-visible::after { outline: 2px solid var(--ja-brand-ink); outline-offset: 2px; }
.jap-ui .jap-tile.is-hot a.jap-tile-v { color: var(--ja-brand-ink); }
.jap-ui .jap-tile-s { color: var(--ja-muted); font-size: 12px; line-height: 1.4; }
.jap-ui .jap-up { color: var(--ja-good); font-weight: 600; }

/* What needs attention: each line has a mark (! or i) as well as a colour, so it never relies on colour alone */
/* The lines sit side by side and wrap onto a new row when the card is narrow; a short last row stretches so there is no empty gap.
   Each line is the mark and the words on top, the button underneath (pinned to the bottom so every line in a row is the same height). */
.jap-ui .jap-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jap-ui .jap-todo li { box-sizing: border-box; flex: 1 1 260px; min-width: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--ja-line); border-radius: 8px; background: var(--ja-surface2); }
.jap-ui .jap-todo li .jap-btn { grid-column: 2; justify-self: start; }
.jap-ui .jap-todo li.is-warn { background: var(--ja-warn-bg); border-color: var(--ja-warn-line); }
.jap-ui .jap-todo li.is-info { background: var(--ja-brand-soft); border-color: var(--ja-brand-line); }
.jap-ui .jap-todo-ic { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--ja-surface); border: 1px solid currentColor; }
.jap-ui .jap-todo li.is-warn .jap-todo-ic { color: var(--ja-warn); }
.jap-ui .jap-todo li.is-info .jap-todo-ic { color: var(--ja-brand-ink); }
.jap-ui .jap-todo-b { flex: 1 1 auto; min-width: 0; }
.jap-ui .jap-todo-b strong { display: block; color: var(--ja-ink); font-weight: 600; }
.jap-ui .jap-todo-b span { color: var(--ja-ink2); font-size: 12.5px; }
/* A single line on a wide screen keeps the button on the right of the words instead of underneath */
@media (min-width: 783px) {
	.jap-ui .jap-todo li:only-child { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-rows: auto; align-items: center; }
	.jap-ui .jap-todo li:only-child .jap-btn { grid-column: 3; justify-self: end; }
}
.jap-ui .jap-ok-line { margin: 0; color: var(--ja-good); font-weight: 600; }

/* The chart and the status bars sit side by side and stretch to the same height */
.jap-ui .jap-dash-pair { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: stretch; margin: 0 0 12px; }
.jap-ui .jap-dash-pair > .jap-card { margin: 0; }

/* Columns, one a day: one colour (one series), thin, rounded at the top only, hairline grid, 2px of air between columns */
.jap-ui .jap-chart { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 8px; margin-top: 10px; }
.jap-ui .jap-chart-y { position: relative; height: 150px; }
.jap-ui .jap-chart-y span { position: absolute; right: 0; transform: translateY(50%); font-size: 11px; line-height: 1; color: var(--ja-muted); font-variant-numeric: tabular-nums; }
.jap-ui .jap-chart-plot { position: relative; height: 150px; border-bottom: 1px solid var(--ja-line); }
.jap-ui .jap-chart-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--ja-line2); }
.jap-ui .jap-chart-grid.is-mid { bottom: 50%; }
.jap-ui .jap-chart-grid.is-top { top: 0; }
.jap-ui .jap-chart-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.jap-ui .jap-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.jap-ui .jap-col i { display: block; width: calc(100% - 2px); max-width: 24px; min-height: 3px; background: var(--ja-brand-ink); border-radius: 4px 4px 0 0; }
.jap-ui .jap-col i.is-zero { display: none; }
.jap-ui .jap-col:hover, .jap-ui .jap-col:focus-visible { background: var(--ja-hover); }
.jap-ui .jap-col:focus-visible { outline: 2px solid var(--ja-brand-ink); outline-offset: -2px; }
.jap-ui .jap-col:hover i, .jap-ui .jap-col:focus-visible i { opacity: .8; }
.jap-ui .jap-col[data-pt]:hover::after, .jap-ui .jap-col[data-pt]:focus-visible::after { content: attr(data-pt); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 30; white-space: nowrap; background: var(--ja-tip-bg); color: var(--ja-tip-ink); font-size: 12px; font-weight: 400; line-height: 1.4; padding: 5px 9px; border-radius: 7px; box-shadow: var(--ja-pop); pointer-events: none; }
.jap-ui .jap-col:first-child[data-pt]:hover::after, .jap-ui .jap-col:first-child[data-pt]:focus-visible::after { left: 0; transform: none; }
.jap-ui .jap-col:last-child[data-pt]:hover::after, .jap-ui .jap-col:last-child[data-pt]:focus-visible::after { left: auto; right: 0; transform: none; }
.jap-ui .jap-chart-x { grid-column: 2; display: flex; gap: 2px; margin-top: 5px; }
.jap-ui .jap-chart-x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; line-height: 1.2; color: var(--ja-muted); white-space: nowrap; }
.jap-ui .jap-chartcard { display: flex; flex-direction: column; }
.jap-ui .jap-tv { margin-top: auto; padding-top: 12px; }
.jap-ui .jap-tv summary { cursor: pointer; color: var(--ja-brand-ink); font-size: 12.5px; }
/* The first and last date labels grow inward, so a long label ("24 Nov") never runs past the edge of the card */
.jap-ui .jap-chart-x.is-long span:first-child { display: flex; justify-content: flex-start; }
.jap-ui .jap-chart-x.is-long span:last-child { display: flex; justify-content: flex-end; }
.jap-ui .jap-tv-scroll { margin-top: 6px; max-height: 240px; overflow: auto; border: 1px solid var(--ja-line); border-radius: 8px; }
.jap-ui .jap-tv-scroll .jap-table td, .jap-ui .jap-tv-scroll .jap-table th { padding: 5px 12px; }

/* Where applications stand: a name, a thin bar and a number on each row (the bar is a lighter step of the same blue behind it) */
.jap-ui .jap-pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.jap-ui .jap-pipe li { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr) 34px; gap: 10px; align-items: center; }
.jap-ui .jap-pipe a { color: var(--ja-ink); text-decoration: none; font-size: 13px; }
.jap-ui .jap-pipe a:hover { text-decoration: underline; }
.jap-ui .jap-pipe-bar { display: block; height: 10px; background: var(--ja-brand-soft); border-radius: 4px; overflow: hidden; }
.jap-ui .jap-pipe-bar i { display: block; height: 100%; background: var(--ja-brand-ink); border-radius: 0 4px 4px 0; }
.jap-ui .jap-pipe-c { text-align: right; font-weight: 600; color: var(--ja-ink); font-variant-numeric: tabular-nums; }
.jap-ui .jap-pipe li.is-zero a, .jap-ui .jap-pipe li.is-zero .jap-pipe-c { color: var(--ja-muted); font-weight: 400; }

/* Latest applications */
.jap-ui .jap-recent { list-style: none; margin: 0; padding: 0; }
.jap-ui .jap-recent li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--ja-line2); }
.jap-ui .jap-recent li:last-child { border-bottom: 0; }
.jap-ui .jap-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ja-flat); color: var(--ja-ink2); font-size: 12px; font-weight: 600; }
.jap-ui .jap-recent-b { min-width: 0; overflow-wrap: anywhere; }
.jap-ui .jap-jobscard .jap-tablewrap { border: 1px solid var(--ja-line2); border-radius: 8px; }

/* Quick links and the set-up check */
.jap-ui .jap-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.jap-ui .jap-links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; color: var(--ja-ink); }
.jap-ui .jap-links a:hover { background: var(--ja-hover); border-color: var(--ja-line); }
.jap-ui .jap-links strong { display: block; color: var(--ja-brand-ink); font-weight: 600; }
.jap-ui .jap-links small { display: block; color: var(--ja-ink2); font-size: 12px; line-height: 1.4; }
.jap-ui .jap-arrow { flex: none; color: var(--ja-muted); font-size: 16px; }
.jap-ui .jap-health { list-style: none; margin: 0; padding: 0; }
.jap-ui .jap-health li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--ja-line2); }
.jap-ui .jap-health li:last-child { border-bottom: 0; }
.jap-ui .jap-health strong { color: var(--ja-ink); font-weight: 600; }
.jap-ui .jap-hmark { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.jap-ui .jap-hmark.is-ok { background: var(--ja-good-bg); color: var(--ja-good); }
.jap-ui .jap-hmark.is-warn { background: var(--ja-warn-bg); color: var(--ja-warn); }

/* The period switch is made of links on the Dashboard */
.jap-ui .jap-seg a { display: inline-block; padding: 4px 11px; border-radius: 6px; font-size: 12.5px; line-height: 1.3; color: var(--ja-ink2); text-decoration: none; }
.jap-ui .jap-seg a:hover { color: var(--ja-ink); }
.jap-ui .jap-seg a[aria-current="true"] { background: var(--ja-surface); color: var(--ja-ink); font-weight: 600; box-shadow: var(--ja-shadow); }

/* ---------- Template preview page ---------- */
.jap-previewpage { margin: 0; background: #f1f3f7; }
.jap-previewbar { background: #1d2327; color: #fff; padding: 8px 16px; font: 13px/1.4 system-ui, sans-serif; }
.jap-previewbar a { color: #9ec2ff; }
.jap-preview-wrap { max-width: 880px; margin: 24px auto; padding: 0 16px; }

@media (max-width: 1100px) {
	.jap-ui .jap-jobgrid { grid-template-columns: minmax(0, 1fr); }
	.jap-ui .jap-jobaside { position: static; max-height: none; overflow: visible; }
	.jap-ui .jap-split { grid-template-columns: minmax(0, 1fr); }
	.jap-ui .jap-dash-pair { grid-template-columns: minmax(0, 1fr); }
	.jap-ui .jap-grid2 { column-count: 1; }
}
@media (max-width: 782px) {
	.jap-ui .jap-viewer { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; border: 0; }
	.jap-ui .jap-vw-actions { margin-left: 0; width: 100%; }
	.jap-ui .jap-row, .jap-ui .jap-row2, .jap-ui .jap-row4, .jap-ui .jap-bld-body { grid-template-columns: minmax(0, 1fr); }
	.jap-ui .jap-set { grid-template-columns: minmax(0, 1fr); }
	.jap-ui .jap-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
	.jap-ui .jap-bld-head { grid-template-columns: auto minmax(0, 1fr) auto; }
	.jap-ui .jap-bld-head .jap-bld-badge, .jap-ui .jap-bld-head .jap-check { grid-column: auto; }
	.jap-ui .jap-tokens ul { columns: 1; }
	.jap-ui .jap-chart { grid-template-columns: 22px minmax(0, 1fr); column-gap: 4px; }
}
@media print {
	body.jap-admin #adminmenumain, body.jap-admin #wpadminbar, body.jap-admin #wpfooter, .jap-ui .jap-controls, .jap-ui .jap-statusbar, .jap-ui .jap-mailform, .jap-ui .jap-noteform, .jap-ui .jap-danger, .jap-ui .jap-rate + .jap-link { display: none !important; }
	body.jap-admin #wpcontent { margin-left: 0; }
	.jap-ui .jap-split { grid-template-columns: minmax(0, 1fr); }
	.jap-ui .jap-viewer { display: none !important; }
	.jap-ui .jap-card { box-shadow: none; break-inside: avoid; }
}

/* ================================================================== */
/* PART 2: PUBLIC (Careers list, job page, application form)           */
/* ================================================================== */

.jap {
	--jap-accent: #1f7a4f;
	--jap-accent-ink: #ffffff;
	--jap-ink: #1d2327;
	--jap-ink2: #3c434a;
	--jap-muted: #50575e;
	--jap-line: #cdd2d9;
	--jap-soft: #f4f6f8;
	--jap-card: #ffffff;
	--jap-err: #b42318;
	--jap-err-bg: #fdeceb;
	--jap-ok-bg: #e6f4ec;
	--jap-ok: #0a5a2c;
	--jap-radius: 10px;
	color: var(--jap-ink);
	font-size: 16px;
	line-height: 1.55;
	max-width: 1120px;
	margin: 0 auto;
}
.jap *, .jap *::before, .jap *::after { box-sizing: border-box; }
.jap a { color: var(--jap-accent); }
.jap :focus-visible { outline: 3px solid var(--jap-accent); outline-offset: 2px; }
.jap .jap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.jap .jap-btn, .jap a.jap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--jap-accent); color: var(--jap-accent-ink); border: 2px solid var(--jap-accent); border-radius: 6px; padding: 9px 22px; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; transition: filter .15s; min-height: 42px; }
.jap .jap-btn:hover, .jap a.jap-btn:hover { filter: brightness(.92); color: var(--jap-accent-ink); text-decoration: none; }
.jap .jap-btn:disabled { opacity: .6; cursor: wait; }
.jap .jap-btn-ghost, .jap a.jap-btn-ghost { background: transparent; color: var(--jap-accent); }
.jap .jap-btn-ghost:hover, .jap a.jap-btn-ghost:hover { background: var(--jap-soft); color: var(--jap-accent); filter: none; }
.jap .jap-btn-block { display: flex; width: 100%; margin: 0 0 10px; }

/* ---------- The jobs list ---------- */
.jap .jap-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.jap .jap-filter .jap-in { flex: 1 1 200px; min-width: 0; }
.jap .jap-count { color: var(--jap-muted); margin: 0 0 10px; font-size: 14px; }
.jap .jap-cards { display: grid; gap: 12px; }
.jap .jap-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; background: var(--jap-card); border: 1px solid var(--jap-line); border-radius: var(--jap-radius); padding: 16px 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: box-shadow .15s, border-color .15s; }
.jap .jap-card:hover { border-color: var(--jap-accent); box-shadow: 0 4px 14px rgba(16, 24, 40, .1); }
.jap .jap-card-main { flex: 1 1 340px; min-width: 0; }
.jap .jap-card-title { margin: 0 0 4px; font-size: 20px; line-height: 1.3; }
.jap .jap-card-title a { color: var(--jap-ink); text-decoration: none; }
.jap .jap-card-title a:hover { color: var(--jap-accent); text-decoration: underline; }
.jap .jap-card-sum { margin: 0 0 8px; color: var(--jap-ink2); }
.jap .jap-card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.jap .jap-when { color: var(--jap-muted); font-size: 13px; }
.jap .jap-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.jap .jap-meta li { margin: 0; background: var(--jap-soft); color: var(--jap-ink); border-radius: 999px; padding: 2px 12px; font-size: 13.5px; }
.jap .jap-meta-lg { margin: 0 0 18px; }
.jap .jap-meta-lg li { font-size: 15px; padding: 4px 14px; }
.jap .jap-pages { margin: 18px 0 0; }
.jap .jap-pages .page-numbers { display: inline-block; padding: 5px 13px; border: 1px solid var(--jap-line); border-radius: 6px; margin-right: 5px; text-decoration: none; color: var(--jap-ink); }
.jap .jap-pages .page-numbers.current { background: var(--jap-accent); border-color: var(--jap-accent); color: var(--jap-accent-ink); }
.jap .jap-empty { background: var(--jap-soft); border-radius: var(--jap-radius); padding: 28px 22px; text-align: center; }
.jap .jap-empty h3 { margin: 0 0 6px; }

/* ---------- One job ---------- */
/* A job is posted by the company, so the theme's "By <person> / <date>" line is not shown on a job page. Themes name it differently, so the
   common names are covered (Astra and most classic themes, block themes, and the Elementor Post Info widget). Only job pages are touched
   (WordPress adds single-jap_job to the page's body); the Posted line in the Apply card and the Google job data are separate and stay. */
body.single-jap_job .entry-meta,
body.single-jap_job .post-meta,
body.single-jap_job .entry-byline,
body.single-jap_job .byline,
body.single-jap_job .posted-on,
body.single-jap_job .posted-by,
body.single-jap_job .post-author,
body.single-jap_job .post-date,
body.single-jap_job .wp-block-post-author,
body.single-jap_job .wp-block-post-author-name,
body.single-jap_job .wp-block-post-date,
body.single-jap_job .elementor-post-info__item--type-author,
body.single-jap_job .elementor-post-info__item--type-date { display: none !important; }
.jap .jap-back { margin: 0 0 12px; font-size: 15px; }
.jap .jap-banner { border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; background: var(--jap-soft); border: 1px solid var(--jap-line); }
.jap .jap-banner-closed { background: #fff3d6; border-color: #ecd08a; color: #5c3600; }
.jap .jap-banner-closed a { color: #5c3600; }
.jap .jap-cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; }
.jap .jap-sec { margin: 0 0 26px; }
.jap .jap-sec h2 { font-size: 22px; margin: 0 0 10px; line-height: 1.3; }
.jap .jap-sec ul { margin: 0 0 0 1.1em; padding: 0; }
.jap .jap-sec li { margin: 0 0 5px; }
.jap .jap-desc > :first-child { margin-top: 0; }
.jap .jap-side { position: sticky; top: 24px; }
.jap .jap-apply-card { background: var(--jap-card); border: 1px solid var(--jap-line); border-radius: var(--jap-radius); padding: 18px; box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.jap .jap-facts { margin: 8px 0 0; }
.jap .jap-facts > div { padding: 8px 0; border-top: 1px solid var(--jap-line); }
.jap .jap-facts dt { font-size: 13px; color: var(--jap-muted); }
.jap .jap-facts dd { margin: 0; font-weight: 600; color: var(--jap-ink); }
.jap .jap-small { font-size: 13px; color: var(--jap-muted); margin: 6px 0 0; }

/* ---------- The application form (after the sample: bold labels, red stars, square-ish boxes, green buttons) ---------- */
.jap .jap-apply { margin: 34px 0 0; background: var(--jap-card); border: 1px solid var(--jap-line); border-radius: var(--jap-radius); padding: 28px 30px; }
.jap .jap-apply > h2 { margin: 0 0 14px; font-size: 24px; line-height: 1.3; }
.jap .jap-intro { margin: 0 0 22px; font-size: 15px; color: var(--jap-ink); }
.jap .jap-intro p { margin: 0 0 10px; }
.jap .jap-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 18px; }
.jap .jap-field { grid-column: span 12; margin: 0; padding: 0; border: 0; min-width: 0; }
.jap .jap-w-half { grid-column: span 6; }
.jap .jap-w-third { grid-column: span 4; }
.jap .jap-label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 7px; padding: 0; color: var(--jap-ink); }
.jap .jap-req { color: #c0200f; margin-left: 2px; }
.jap .jap-in { display: block; width: 100%; background: #fff; color: var(--jap-ink); border: 1px solid #c3c8cf; border-radius: 4px; padding: 8px 12px; font: inherit; font-size: 15px; line-height: 1.4; min-height: 42px; box-shadow: none; }
.jap select.jap-in { padding-right: 32px; }
.jap textarea.jap-in { min-height: 110px; resize: vertical; }
.jap .jap-in::placeholder { color: #6b7280; opacity: 1; }
.jap .jap-in:focus { border-color: var(--jap-accent); box-shadow: 0 0 0 2px var(--jap-accent); outline: 0; }
.jap .jap-readonly { background: var(--jap-soft); color: var(--jap-ink); cursor: default; }
.jap .jap-in[aria-invalid="true"] { border-color: var(--jap-err); box-shadow: 0 0 0 1px var(--jap-err); }
.jap .jap-name { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 3fr) minmax(0, 3fr); gap: 12px; }
.jap .jap-addr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.jap .jap-addr .jap-a-full { grid-column: 1 / -1; }
.jap .jap-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 2px; }
.jap .jap-check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 15px; cursor: pointer; margin: 0; }
.jap .jap-check input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--jap-accent); }
.jap .jap-in-file { padding: 7px 10px; }
.jap .jap-in-file::file-selector-button { background: var(--jap-soft); color: var(--jap-ink); border: 1px solid #c3c8cf; border-radius: 4px; padding: 5px 12px; margin-right: 12px; cursor: pointer; font: inherit; font-size: 14px; }
.jap .jap-help { margin: 5px 0 0; font-size: 13.5px; color: var(--jap-muted); }
.jap .jap-err { margin: 6px 0 0; font-size: 14px; color: var(--jap-err); font-weight: 600; }
.jap .jap-err[hidden], .jap .jap-done[hidden] { display: none; }
.jap .jap-h { margin: 8px 0 0; font-size: 18px; padding-top: 14px; border-top: 1px solid var(--jap-line); }
.jap .jap-note { margin: 0; color: var(--jap-ink2); }
.jap .jap-consent { margin-top: 4px; }
.jap .jap-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 26px; }
.jap .jap-actions .jap-btn { min-width: 120px; }
.jap .jap-status { margin: 12px 0 0; min-height: 1.4em; font-weight: 600; }
.jap .jap-status.is-error { color: var(--jap-err); }
.jap .jap-status.is-ok { color: var(--jap-ok); }
.jap .jap-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.jap .jap-done { background: var(--jap-ok-bg); border: 1px solid #8fcca8; color: #0a3d1e; border-radius: 8px; padding: 20px 22px; }
.jap .jap-done h3 { margin: 0 0 8px; font-size: 22px; color: #0a3d1e; }
.jap .jap-done a { color: #0a3d1e; font-weight: 600; }
.jap .jap-done .jap-btn { color: var(--jap-accent-ink); }

@media (max-width: 900px) {
	.jap .jap-cols { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.jap .jap-side { position: static; order: -1; }
}
@media (max-width: 640px) {
	.jap { font-size: 15px; }
	.jap .jap-apply { padding: 20px 16px; }
	.jap .jap-w-half, .jap .jap-w-third { grid-column: span 12; }
	.jap .jap-name { grid-template-columns: minmax(0, 1fr); }
	.jap .jap-addr { grid-template-columns: minmax(0, 1fr); }
	.jap .jap-card { padding: 14px; }
	.jap .jap-card-side { align-items: stretch; width: 100%; }
	.jap .jap-actions .jap-btn { flex: 1 1 100%; }
	.jap .jap-btn { width: 100%; }
	.jap .jap-pages .jap-btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
	.jap .jap-card, .jap .jap-btn { transition: none; }
}

/* ================================================================== */
/* PART 3: THE READING PAGE                                            */
/* The plain page a stored Word, ODT, RTF, TXT or DOC file is turned into when staff press View (includes/viewer.php). It is its own     */
/* little web page inside the viewer window, so everything here is scoped to html.jap-read / body.jap-read. It is always light, like paper. */
/* ================================================================== */
html.jap-read { background: #e9edf2; }
body.jap-read, body.jap-read *, body.jap-read *::before, body.jap-read *::after { box-sizing: border-box; }
body.jap-read { margin: 0; padding: 16px 12px 40px; font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1d2327; }
body.jap-read .note { max-width: 860px; margin: 0 auto 12px; padding: 9px 14px; background: #fff6dd; border: 1px solid #e6cf8a; border-radius: 8px; color: #5c3d00; font-size: 13px; line-height: 1.45; }
body.jap-read .paper { max-width: 860px; margin: 0 auto; background: #fff; padding: 44px 52px; border: 1px solid #d3d9e0; border-radius: 6px; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); overflow-wrap: anywhere; }
body.jap-read .paper h1, body.jap-read .paper h2, body.jap-read .paper h3, body.jap-read .paper h4, body.jap-read .paper h5, body.jap-read .paper h6 { margin: 1.1em 0 .4em; line-height: 1.25; color: #10151a; }
body.jap-read .paper h1 { font-size: 1.7em; margin-top: 0; }
body.jap-read .paper h2 { font-size: 1.35em; }
body.jap-read .paper h3 { font-size: 1.15em; }
body.jap-read .paper h4, body.jap-read .paper h5, body.jap-read .paper h6 { font-size: 1em; }
body.jap-read .paper p { margin: 0 0 .7em; }
body.jap-read .paper ul, body.jap-read .paper ol { margin: 0 0 .8em; padding-left: 1.5em; }
body.jap-read .paper li { margin: 0 0 .25em; }
body.jap-read .paper .c { text-align: center; }
body.jap-read .paper .r { text-align: right; }
body.jap-read .paper table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
body.jap-read .paper td { border: 1px solid #dfe4ea; padding: 5px 8px; vertical-align: top; }
body.jap-read .paper td p:last-child { margin-bottom: 0; }
body.jap-read .paper .hf { margin: 0 0 1.2em; padding: 8px 12px; background: #f4f6f8; border-radius: 6px; font-size: 13px; color: #3b434c; }
body.jap-read .paper .hf-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #50575e; margin: 0 0 4px; }
body.jap-read .paper .hf p { margin: 0 0 .25em; }
body.jap-read .paper pre.txt { white-space: pre-wrap; margin: 0; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
body.jap-read .paper .err { color: #8a1c12; }
@media (max-width: 640px) {
	body.jap-read { padding: 8px 6px 24px; }
	body.jap-read .paper { padding: 22px 18px; }
}
@media print {
	html.jap-read, body.jap-read { background: #fff; padding: 0; }
	body.jap-read .note { display: none; }
	body.jap-read .paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
}
