:root {
  --brand: #1f4e79;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5d6677;
  --border: #dde1e7;
  --ok: #1e7b45;
  --ok-bg: #e6f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --bad: #a4262c;
  --bad-bg: #fde8e9;
  --info-bg: #e8f0fa;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Layout */
.topbar { background: var(--brand); color: #fff; }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; opacity: .9; }
.topbar a:hover, .topbar a.active { opacity: 1; text-decoration: underline; }
.topbar .brand { font-weight: 700; font-size: 1.05rem; opacity: 1; display: flex; align-items: center; gap: .5rem; }
.topbar .brand img { height: 28px; background: #fff; border-radius: 4px; padding: 2px; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.topbar button.link { color: #fff; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; opacity: .9; }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .layout-side { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-block; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font: inherit; font-weight: 500; cursor: pointer; line-height: 1.3; }
.btn:hover { border-color: #b8bec9; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-bad { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-small { padding: .25rem .6rem; font-size: .85rem; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .9rem; }
.req { color: var(--bad); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, trix-editor:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 0; border-color: var(--brand); }
.field { margin-bottom: 1rem; }
.field .help { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.field .error, .errorlist { color: var(--bad); font-size: .85rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error trix-editor { border-color: var(--bad); }
.checkbox label { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .75rem; }
trix-editor.trix-content { min-height: 260px !important; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
/* Hide formatting that job boards strip out. */
trix-toolbar .trix-button-group.trix-button-group--file-tools,
trix-toolbar .trix-button[data-trix-attribute="strike"],
trix-toolbar .trix-button[data-trix-attribute="href"],
trix-toolbar .trix-button[data-trix-attribute="code"],
trix-toolbar .trix-button[data-trix-attribute="quote"] { display: none !important; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border: 0; }
tr:last-child td { border-bottom: 0; }

/* Badges / alerts */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eceff3; color: var(--muted); white-space: nowrap; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-live { background: var(--ok-bg); color: var(--ok); }
.badge-rejected { background: var(--bad-bg); color: var(--bad); }
.badge-closed { background: #eceff3; color: var(--muted); }
.badge-draft { background: var(--info-bg); color: var(--brand); }
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--brand); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .35rem .75rem; border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Rules warnings */
.warning { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: .6rem .8rem; border-radius: 0 6px 6px 0; margin-bottom: .6rem; }
.warning.high { border-left-color: var(--bad); background: var(--bad-bg); }
.warning strong { display: block; }
.warning .hits { margin-top: .25rem; font-size: .85rem; }
.warning .hits code { background: rgba(255,255,255,.7); padding: 0 .3rem; border-radius: 3px; }

/* Job description */
.description { line-height: 1.6; }
.description h3, .description h4 { margin: 1.2rem 0 .4rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* Copy for Indeed */
.copy-row { border-bottom: 1px solid var(--border); padding: .75rem 0; }
.copy-row:last-child { border-bottom: 0; }
.copy-row .value { white-space: pre-wrap; background: var(--bg); border-radius: 6px; padding: .5rem .6rem; margin-top: .35rem; font-size: .92rem; max-height: 320px; overflow: auto; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.timeline li:last-child { border-bottom: 0; }

/* Public pages */
.public-header { background: var(--brand); color: #fff; padding: 1rem 16px; }
.public-header .inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; }
.public-header a { color: #fff; text-decoration: none; font-weight: 700; }
.public-header img { height: 36px; background: #fff; border-radius: 4px; padding: 3px; }
.public-main { max-width: 860px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.apply-box { position: sticky; top: 1rem; }
.btn-apply { display: block; text-align: center; font-size: 1.05rem; padding: .8rem 1rem; }
.closed-banner { background: var(--bad-bg); color: var(--bad); padding: .9rem 1rem; border-radius: var(--radius); font-weight: 600; margin-bottom: 1rem; }
.preview-banner { background: var(--warn-bg); color: var(--warn); padding: .6rem 16px; text-align: center; font-weight: 600; }
.auth-box { max-width: 400px; margin: 3rem auto; }
