/* BridgesJobs portal - base styling.
   Kept in a file rather than inline so the CSP can stay strict (no
   'unsafe-inline'). Applicants arrive on phones, so this is mobile-first. */

/* Light is the default and these are the values the app has always had.
   --navy is a BRAND SURFACE (the masthead, the buttons); --accent is the
   same colour used as INK (links, tabs, progress). They are split because
   on a dark background they have to move in opposite directions: the
   surface stays deep, the ink has to lift. */
:root {
  --navy: #1f3a5f;
  --navy-dk: #162b46;
  --accent: #1f3a5f;
  --ink: #1d2430;
  --muted: #5c6673;
  --line: #d9dee5;
  --row-line: #eceff3;
  --bg: #f6f8fa;
  --card: #ffffff;
  --head-bg: #eef1f5;
  --chip: #eceff3;
  --track: #e4e9ef;
  --dash: #b9c2cd;
  --warn-bg: #fff8e1;
  --warn-line: #e8d9a0;
  --ok-bg: #dff0e3;
  --ok-line: #c3ddc8;
  --ok-bg: #f2f8f3;          /* a done row, barely there */
  --ok-ink: #2c6b3a;
  --btn-bg: #1f3a5f;
  --btn-bg-hover: #162b46;
  --btn-ink: #ffffff;
  /* Headings were painted with --navy-dk, which is a SURFACE token. In
     dark that became near-black on a near-black page and the page title
     simply disappeared. Headings get ink of their own. */
  --heading: #162b46;
  color-scheme: light;
}

/* ---------- dark mode -----------------------------------------------
   Two ways in, and the cookie wins. A person who has chosen a theme on
   the toggle keeps it whatever their laptop is set to, including when
   the two disagree, which is the whole reason they touched the toggle.
   With no cookie the OS decides.

   :root:not([data-theme="light"]) is what makes that work - an explicit
   light choice has to survive an OS set to dark.

   color-scheme is set as well as the colours, or the browser keeps
   painting scrollbars, the date picker and autofill in light. */
/* NO prefers-color-scheme SWITCH, deliberately. This stylesheet is
   shared with the applicant side, and those pages carry a signature
   canvas whose ink is a hardcoded dark (#1d2430 in sign.js). An
   applicant whose phone is set to dark would have drawn their signature
   in near-black on a near-black pad and seen nothing happen.

   Dark is therefore opt-in only, through the HR toggle, and the cookie
   that sets it can only be set behind hr_required - so it can never
   reach an applicant. The cost is that an HR person on a dark laptop
   clicks once instead of never, which is the right trade against a
   signature nobody can see. */

:root[data-theme="dark"] {
  --navy: #16202c;
  --navy-dk: #0f1721;
  --accent: #7fb0e8;
  --ink: #e6ebf2;
  --muted: #93a0b0;
  --line: #2b3545;
  --row-line: #232d3b;
  --bg: #0f141b;
  --card: #19212c;
  --head-bg: #202a37;
  --chip: #263141;
  --track: #2b3545;
  --dash: #46536a;
  --warn-bg: #2e2716;
  --warn-line: #5a4c23;
  --ok-bg: #16281c;
  --ok-line: #2c4a35;
  --ok-bg: #1a2820;          /* the same, for dark */
  --ok-ink: #7fc68f;
  --btn-bg: #2f6fb8;
  --btn-bg-hover: #3d80cc;
  --btn-ink: #ffffff;
  --heading: #eaf0f8;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Sticky is applied below, and only where it earns its keep. */
  padding: 14px 18px;
  background: var(--navy);
  color: #fff;
}

.masthead .mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
}

.masthead .wordmark { font-weight: 600; letter-spacing: .2px; }

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1 {
  font-size: 22px;
  margin: 18px 0 8px;
  color: var(--heading);
}

.lede { font-size: 17px; margin: 0 0 14px; }

.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 15px;
}

.foot {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.foot p { margin: 0; }

/* ---------- applicant packet ---------- */

/* A <progress>, deliberately. The CSP blocks inline style attributes, so a
   div whose width is set per-request silently renders full width. */
progress.bar {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--track);   /* Firefox track */
  margin: 14px 0 6px;
  overflow: hidden;
}
progress.bar::-webkit-progress-bar { background: var(--track); border-radius: 4px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 4px; }

h2.sect {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin: 24px 0 8px;
}

ul.forms { list-style: none; margin: 0; padding: 0; }

ul.forms li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

ul.forms a { color: var(--accent); font-weight: 600; text-decoration: none; }
ul.forms a:hover { text-decoration: underline; }
ul.forms.done li { opacity: .7; }

/* The facility list runs to 42 rows, so it is tightened. The packet list
   is NOT: those rows are tap targets on a phone and want the height. */
ul.forms.compact li {
  padding: 9px 14px;
  margin-bottom: 5px;
}
ul.forms.compact a { font-weight: 600; }
ul.forms.compact .variant { font-size: 12.5px; }
.variant, .when { color: var(--muted); font-size: 13px; }
.pending-doc { color: var(--muted); }

/* ---------- a single form ---------- */

.crumb { margin: 0 0 4px; font-size: 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.variant-line { color: var(--muted); margin: 0 0 10px; }

.doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.doc-missing { color: var(--muted); margin: 0; }
.doclink { color: var(--accent); font-weight: 600; }

/* --- the preview bar (23 Nov) ----------------------------------------
   Loud on purpose. Someone looking at an applicant's own pages has to
   know that is what they are looking at, and has to be able to get out
   from wherever they got to. */
.preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--chip);
  font-size: .9rem;
}
.preview-bar form { margin: 0; }
.inline { display: inline; margin: 0; }

.signform { margin-top: 4px; }

fieldset.choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px 14px;
  margin: 0 0 16px;
  background: var(--card);
}
fieldset.choice legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
fieldset.choice label { display: block; padding: 7px 0; }

label.fld {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 5px;
}

.fld-in {
  width: 100%;
  font-size: 16px;            /* 16px stops iOS zooming on focus */
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.sigpad {
  width: 100%;
  height: 180px;
  /* ALWAYS a light sheet, never var(--card). What is drawn here is
     saved as a PNG and stamped onto a white PDF page, so the ink has to
     stay dark - which means the pad under it has to stay light, in
     whatever theme the page is wearing. */
  background: #ffffff;
  border: 1px dashed var(--dash);
  border-radius: 8px;
  touch-action: none;         /* or the page scrolls instead of signing */
  display: block;
}

.sigtools { margin: 6px 0 0; }
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.legal { color: var(--muted); font-size: 13px; margin: 16px 0; }

.btn {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  color: var(--btn-ink);
  background: var(--btn-bg);
  border: 0;
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
}
.btn:hover { background: var(--btn-bg-hover); }

/* ---------- facility career pages ---------- */

.fac-head { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; }
.fac-logo { max-height: 56px; max-width: 170px; }
.fac-mark {
  display: inline-grid;
  place-items: center;
  width: 52px; height: 52px;
  flex: 0 0 52px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
}
.fac-head h1 { margin: 0; font-size: 20px; }
.fac-where { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.dot { margin: 0 6px; color: var(--line); }

.fac-photo {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 6px 0 16px;
  display: block;
}

.fac-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 6px;
}
.tab {
  padding: 9px 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--accent); }
.tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }

ol.steps { padding-left: 20px; margin: 8px 0 16px; }
ol.steps li { margin-bottom: 7px; }

.eeo { color: var(--muted); font-size: 13px; line-height: 1.55; }

ul.jobs { list-style: none; margin: 0; padding: 0; }
ul.jobs li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.job-title { font-size: 16px; margin: 0 0 4px; color: var(--heading); }
.job-meta { margin: 0; color: var(--muted); font-size: 13px; }
.job-sum { margin: 8px 0 0; font-size: 14px; }

/* ---------- flash messages ---------- */

ul.flash {
  list-style: none;
  margin: 14px 0 0;
  padding: 11px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  font-size: 14px;
}
ul.flash li + li { margin-top: 5px; }

.note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--ink); }
.note.issued { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ink); }
.code { font-size: 20px; letter-spacing: 3px; font-weight: 700; }

/* ---------- HR back office ---------- */

.hr-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.hr-bar h1 { margin: 16px 0 0; }
.hr-bar .crumb { margin: 14px 0 0; }
.hr-tools { display: flex; align-items: center; gap: 14px; padding-top: 16px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.filters .fld-in { width: auto; flex: 1 1 150px; min-width: 0; }

.btn-sm { width: auto; padding: 10px 16px; font-size: 14px; }

table.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}
table.grid th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  background: var(--head-bg);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--row-line); }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.num, table.grid th.num { text-align: right; white-space: nowrap; }
table.grid a { color: var(--accent); font-weight: 600; text-decoration: none; }
table.grid a:hover { text-decoration: underline; }

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.tag.live { background: var(--ok-bg); color: var(--ok-ink); }

ul.checks { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.checks li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
}
ul.checks li span:last-child { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  flex: 1 1 260px;
}
.actions .fld-in { width: auto; flex: 1 1 140px; }
.chk { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.link-box { font-size: 13px; font-family: Consolas, "Courier New", monospace; }
.code-in { letter-spacing: 6px; font-size: 22px; text-align: center; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Packet progress in the list. A <progress>, not a styled div - a
   per-row width would have to be an inline style, which the CSP drops. */
.prog { display: flex; align-items: center; gap: 8px; }
progress.minibar {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 6px;
  border: 0;
  border-radius: 3px;
  background: var(--track);
}
progress.minibar::-webkit-progress-bar { background: var(--track); border-radius: 3px; }
progress.minibar::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress.minibar::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.prog-n { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---------- desktop: the HR back office is used at a desk ---------- */

/* 1160px was a reading width, and these are not reading pages - they
   are forms with columns. On a 1900px monitor it left roughly 370px of
   nothing down each side while the fields stayed cramped. The cap is
   now generous and still stops short of edge-to-edge. */
.wrap.wide { max-width: min(2240px, 96vw); }

@media (min-width: 900px) {
  .wrap.wide { padding-left: 24px; padding-right: 24px; }


  /* What you look at and what you do, beside the packet itself. */
  .hr-cols {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }
  .hr-col > h2.sect:first-child { margin-top: 10px; }

  /* Stacked forms are a phone compromise; here they sit in a row. */
  .actions { flex-direction: column; }
  .actions form { flex: 1 1 auto; width: 100%; }

  .filters .fld-in { flex: 0 0 auto; min-width: 170px; }
  .filters { gap: 10px; }

  table.grid { font-size: 13.5px; }
  table.grid th, table.grid td { padding: 8px 14px; }
  .w-progress { width: 160px; }

  .hr-bar h1 { margin-top: 20px; font-size: 22px; }
}

.small { font-size: 13px; color: var(--muted); }

/* The required-field asterisk. Red and bold because that is how Madi
   marked them up, and because the labels around it are --muted grey -
   a mark the same weight as the label it sits beside is not a mark.
   The space is in the rule rather than the template so that it cannot
   be lost to whitespace control in a macro. */
.req { color: #c0392b; font-weight: 700; margin-right: 4px; }
ul.forms li form { margin: 0; }
input[type="file"].fld-in { padding: 9px; background: var(--card); }

/* --- the communities grid ------------------------------------------
   Logos vary wildly in shape: some are wide wordmarks 4:1, some are
   nearly square badges. The art box is a fixed height with the image
   contained inside it, so a row of them lines up without any one being
   stretched or cropped. */
ul.fac-grid {
  list-style: none;
  margin: 18px 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
ul.fac-grid li { margin: 0; }
ul.fac-grid a {
  display: block;
  padding: 16px 14px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  height: 100%;
  box-sizing: border-box;
}
ul.fac-grid a:hover { border-color: var(--accent); }
ul.fac-grid a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fac-grid-art {
  display: grid;
  place-items: center;
  height: 76px;
  margin-bottom: 12px;
}
.fac-grid-art img {
  max-height: 76px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.fac-grid-name {
  display: block;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.25;
}
ul.fac-grid a:hover .fac-grid-name { text-decoration: underline; }
ul.fac-grid .variant { display: block; margin-top: 2px; }

@media (max-width: 560px) {
  ul.fac-grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 10px; }
  .fac-grid-art { height: 60px; }
  .fac-grid-art img { max-height: 60px; }
}

/* --- openings ------------------------------------------------------- */
textarea.fld-in { font: inherit; resize: vertical; min-height: 90px; }
table.grid tr.done td { opacity: .62; }
table.grid tr.done a { color: var(--muted); }
.filters .chk { white-space: nowrap; }
/* An <a> styled as a button still carries the link underline. */
a.btn, a.btn:hover { text-decoration: none; color: var(--btn-ink); }

/* --- the application wizard ----------------------------------------- */
ul.applynav li { display: flex; align-items: center; gap: 8px; }
fieldset.qgroup { border: 0; padding: 0; margin: 14px 0 6px; }
fieldset.qgroup legend { padding: 0; }
fieldset.qgroup .chk { margin-right: 18px; }
ol.terms { padding-left: 20px; }
ol.terms > li { margin-bottom: 12px; }
ol.terms-sub { margin-top: 8px; }

/* --- access: ticking 43 facilities --------------------------------- */
/* All of this is classes rather than inline style: the CSP has no
   'unsafe-inline', so a style attribute is dropped and the page would
   render as one very long column of checkboxes. */
fieldset.ticks {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 6px 14px 14px;
  margin: 0 0 18px;
}
fieldset.ticks legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 0 6px;
}
fieldset.ticks p.muted { font-size: 13px; margin: 12px 0 0; }

.tickgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 16px;
}
.tickgrid label,
.tick-all,
.role-pick {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  /* Tall enough to be a thumb target - these screens get used on a
     phone in a building, not only at a desk. */
  padding: 8px 2px;
}
.tickgrid label span { padding-top: 1px; }

.tick-all {
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  padding-bottom: 12px;
}
.tick-all .variant, .role-pick .variant { display: block; }

.role-pick + .role-pick { border-top: 1px solid var(--row-line); }

/* Job titles are long - "Certified Nursing Assistant (CNA) 3-11 11-7
   S&S" - so the opening picker gets wider columns than the facility
   one, which holds short names. */
.tickgrid-wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* A checklist step is ticked from inside a table cell, so the control
   has to sit on one line with the row. Classes, not a style attribute:
   the CSP has no 'unsafe-inline' and it blocks inline style
   ATTRIBUTES, not just <style> blocks. That has bitten three times. */
.tickform { display: flex; gap: 6px; align-items: center; }
.fld-sm { max-width: 11em; }

/* "needed" beside a label on a packet form. A class, not a style
   attribute: the CSP blocks inline style ATTRIBUTES too. */
.req { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- forms that use the width they are given -----------------
   Every field on the HR forms was a row of its own. On the 1160px desk
   wrap that made a company-name box about 1100px wide and ran one
   reference block to roughly 700px tall, so three of them needed four
   screens for what fits on one.

   The columns come from a CONTAINER query rather than a media query,
   because this same markup sits in three different widths: the 1160px
   wrap the HR back office uses, the 680px wrap that BOTH the Mobile
   view toggle and the offer page produce, and a real phone. A viewport
   media query would get two of those three wrong - it would column up
   the offer page's narrow wrap on a desktop, and it would keep the
   columns when somebody switches to Mobile view to check the narrow
   layout, which is the one case the toggle exists to show honestly.

   Where container queries are unsupported, nothing matches and every
   field falls back to span 12 - which is exactly the old layout, so
   the failure mode is the thing it replaced. */

.fgrid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 18px;
  container-type: inline-size;
}

/* min-width:0 or a long placeholder refuses to let its column shrink
   and the whole row overflows. */
.fgrid > .f { grid-column: span 12; min-width: 0; }

/* label.fld only matches labels, and the radio group's caption is a
   span - it is not labelling one control. */
.fgrid .fld {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 5px;
}
.fgrid .fld-in { width: 100%; max-width: none; }

/* fieldset.choice makes every label a block, which stacked Yes / No /
   Not asked down three rows. Inside a row they belong on one line. */
.fgrid .chk-row { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 9px 0 0; }
.fgrid .chk-row label.chk { display: inline-flex; padding: 0; }

.fgrid .variant-line { margin: 4px 0 0; }

/* Pair the short fields as soon as two will fit - this is the 680px
   wrap, so the offer page and Mobile view both land here. */
@container (min-width: 560px) {
  .fgrid > .f-phone,  .fgrid > .f-called,
  .fgrid > .f-from,   .fgrid > .f-to,
  .fgrid > .f-rehire, .fgrid > .f-noresp,
  .fgrid > .f-rate,   .fgrid > .f-per,
  .fgrid > .f-start,  .fgrid > .f-days,
  .fgrid > .f-shift,  .fgrid > .f-reports { grid-column: span 6; }
}

/* The desk. One reference is now three rows, in the order the call
   happens: who you rang, who answered and when, what they confirmed. */
@container (min-width: 900px) {
  .fgrid > .f-emp      { grid-column: span 5; }
  .fgrid > .f-phone    { grid-column: span 3; }
  .fgrid > .f-contact  { grid-column: span 4; }

  .fgrid > .f-called   { grid-column: span 3; }
  .fgrid > .f-from     { grid-column: span 2; }
  .fgrid > .f-to       { grid-column: span 2; }
  .fgrid > .f-position { grid-column: span 5; }

  .fgrid > .f-rehire   { grid-column: span 7; }
  .fgrid > .f-noresp   { grid-column: span 5; }
}

/* ---------- HR density -----------------------------------------------
   The applicant side is a phone form and is sized like one: 16px inputs
   with generous padding, because 16px is what stops iOS zooming the page
   when a field takes focus and a thumb needs the target. The HR back
   office is a desk, a mouse and a lot of fields at once, and at those
   sizes three reference blocks stood 1488px tall - mostly air.

   So the tighter sizing is scoped to .fgrid, which only the HR screens
   use. .fld-in itself is left alone, because it is shared with the
   applicant packet where that 16px is load-bearing. If .fgrid is ever
   put on an applicant-facing page, give it back the 16px. */

   The numbers below are read off BridgesReporting's /admin/access,
   which is the house style for an internal desk tool: 12px labels at
   weight 600, 12px inside the controls, 9px/12px padding, 8px radii,
   10px cards, a 23px/600 h1. The character of that page is SMALLER
   TYPE, not smaller boxes - its inputs still stand 38px tall, which is
   comfortable for a mouse. A first pass here shrank the boxes to 30px
   instead and read as cramped rather than tidy. */

.fgrid { gap: 0 16px; }
.fgrid .fld {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 5px 0 2px;
  /* A label inherits the body's 1.55, so a 13px label stood in a 20px
     line box - 7px of nothing between every label and its field, three
     times over in each row. It only needs to clear its own text. */
  line-height: 1.2;
}

/* THE BOX HEIGHT IS NOT THE FONT. A control's height is its line box
   plus padding plus border, so the type can grow while the box stays
   exactly where it is - the padding just gives back what the text
   takes. 12px/9px and 14px/8px both land on 38px, and 14px is the
   readable one:

     12px x 1.5 = 18  + 18 padding + 2 border = 38
     14px x 1.4 = 20  + 16 padding + 2 border = 38

   Matching BridgesReporting's 12px was the wrong lesson to draw from
   it; what makes that page look tidy is the 38px rhythm, not small
   type. */
.fgrid .fld-in {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 5px;
  /* Form controls default to line-height:normal rather than inheriting
     the body's, so this is set rather than left to chance. 14px x 1.25
     + 12 padding + 2 border = 32px, down from 38, with the text the
     same size - the box loses the padding, not the type. */
  line-height: 1.25;
}
.fgrid .chk-row { padding: 4px 0 0; gap: 3px 16px; }
.fgrid .chk { font-size: 13px; }

/* The reference blocks become cards in the same idiom. */
fieldset.choice.ref {
  padding: 1px 14px 8px;
  margin-bottom: 7px;
  border-radius: 8px;
}
fieldset.choice.ref legend { font-size: 12px; font-weight: 600; }

/* Page chrome on the desk layout only - the applicant side and Mobile
   view keep the larger type they are read at. */
.wrap.wide h1 { font-size: 23px; font-weight: 600; }
.wrap.wide .fac-where { font-size: 12px; }
.wrap.wide .note { padding: 12px 16px; font-size: 12px; }
.wrap.wide .note p { margin: 0; }

/* The offer page is an HR form but NOT a wide one - it is seven fields
   and does not want 1160px - so the rules above miss it and it would
   wear 12px fields under 15px chrome. A page holding an .fgrid is an HR
   form page whatever width it chose. Unsupported :has() just leaves the
   chrome at its old size, which is where it is today. */
body:has(.fgrid) h1 { font-size: 23px; font-weight: 600; }
body:has(.fgrid) .fac-where { font-size: 12px; }
body:has(.fgrid) .note { padding: 12px 16px; font-size: 12px; }
body:has(.fgrid) .note p { margin: 0; }
body:has(.fgrid) .note .small { font-size: 12px; }

/* ---------- the desk, tightened --------------------------------------
   The remaining air was vertical rhythm rather than control size: a
   masthead sized for a phone, an h1 with a phone's margins above it,
   and a gap between every reference card. The controls keep the 38px
   they were matched to - this is the space BETWEEN things. */

.wrap.wide, body:has(.fgrid) .wrap { padding-top: 14px; }

body:has(.fgrid) .masthead,
.wrap.wide ~ .masthead { padding: 9px 18px; }

body:has(.fgrid) h1,
.wrap.wide h1 { margin: 6px 0 0; }

body:has(.fgrid) .hr-bar,
.wrap.wide .hr-bar { margin-bottom: 10px; }

body:has(.fgrid) .hr-tools,
.wrap.wide .hr-tools { padding-top: 6px; gap: 12px; }

body:has(.fgrid) .fac-where { margin-top: 1px; }

/* The standing note is reference text. It reads as a rule with words on
   it rather than a card competing with the fields. */
body:has(.fgrid) .note {
  padding: 9px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  margin: 10px 0 12px;
}

body:has(.fgrid) fieldset.choice.ref { margin-bottom: 8px; }
body:has(.fgrid) .btn { font-size: 13px; padding: 9px 18px; width: auto; }
body:has(.fgrid) .btn-sm { padding: 8px 14px; }

/* ---------- the theme button in the masthead -------------------------
   Pushed to the right of the bar with margin-left:auto, so it needs no
   change to the masthead's own flex rules and the wordmark keeps its
   place. A form, not a link: see the note in _themetoggle.html for why
   this cannot be MTO's onclick handler. */
.theme-form { margin: 0; margin-left: auto; display: flex; }

.theme-toggle {
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  opacity: .85;
  /* The glyph is drawn in the emoji font, so it carries its own colour
     and does not inherit the masthead's white. */
}
.theme-toggle:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.theme-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  opacity: 1;
}

/* The fields may use the whole width; a paragraph should not. */
body:has(.fgrid) .note { max-width: 100ch; }

/* ---------- the 27-inch tier ----------------------------------------
   Everyone here is on a 27" monitor, so the wrap goes to 2240px - and
   at that size simply stretching the same three rows gave an 889px box
   to type a company name into, which is worse than the gap it filled.

   Width should buy MORE PER ROW, not bigger boxes. Above a 1500px
   container one reference is two rows instead of three, and every
   field lands at a width that suits what goes in it: a company name is
   wide, a month and year is narrow. */
@container (min-width: 1500px) {
  .fgrid > .f-emp      { grid-column: span 3; }
  .fgrid > .f-phone    { grid-column: span 2; }
  .fgrid > .f-contact  { grid-column: span 3; }
  .fgrid > .f-called   { grid-column: span 2; }
  .fgrid > .f-from     { grid-column: span 1; }
  .fgrid > .f-to       { grid-column: span 1; }

  .fgrid > .f-position { grid-column: span 3; }
  .fgrid > .f-rehire   { grid-column: span 5; }
  .fgrid > .f-noresp   { grid-column: span 4; }

  /* The offer form is seven fields and fits one row with room over. */
  .fgrid > .f-pos      { grid-column: span 4; }
  .fgrid > .f-rate     { grid-column: span 2; }
  .fgrid > .f-per      { grid-column: span 2; }
  .fgrid > .f-start    { grid-column: span 2; }
  .fgrid > .f-shift    { grid-column: span 2; }
  .fgrid > .f-reports  { grid-column: span 3; }
  .fgrid > .f-days     { grid-column: span 2; }
}

/* fieldset.choice gives EVERY label 7px of padding top and bottom - it
   was written for the stacked Yes/No/Not asked lists, where the padding
   is the tap target. On a field label it is 14px of nothing wrapped
   around 13px of text, in every label on the page, and it is most of
   what still read as wasted space between a label and its field. The
   radio labels keep theirs via .chk-row above. */
.fgrid label.fld { padding: 0; }

/* The masthead sticks only on pages that HAVE the theme button, which
   is the reason it was made sticky: the forms run past a screen and the
   button was reachable only at the very top, which reads as "there is
   no button".

   Applicant pages have no button, so a sticky bar there would cost 58px
   of a phone screen to keep a logo in view. :has(.theme-toggle) is
   exactly "this page has something worth keeping in reach". */
body:has(.theme-toggle) .masthead {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Offer details and Reference checks share a row. */
.act-pair { display: flex; flex-wrap: wrap; gap: 8px; }
.act-pair .btn { width: auto; }

/* Cancelling a link sits under the two buttons that create one, on a
   row of its own, and deliberately does not look like them: it is the
   rarer action and the one reached for when something has gone wrong.
   .bare is the form it actually submits - it carries only the CSRF
   token and must not be drawn as another card. */
.cancel-link { flex-basis: 100%; margin: 2px 0 0; text-align: left; }
.actions form.bare { display: none; }

/* ---------- the packet table ----------------------------------------
   37 rows at 38px each is most of a second screen for a list that is
   one short phrase and one word per line. The padding comes down and
   the type goes to 13px, which is what the rest of the HR chrome uses.
   Scoped to the desk layout so the applicant side is untouched. */
.wrap.wide table.grid { font-size: 13px; }
.wrap.wide table.grid th { padding: 5px 10px; }
.wrap.wide table.grid td { padding: 4px 10px; }

/* An inline control in a cell should not re-inflate the row it is in. */
.wrap.wide table.grid td .fld-in { padding: 4px 8px; font-size: 13px; }
.wrap.wide table.grid td .btn,
.wrap.wide table.grid td .btn-sm { padding: 4px 12px; font-size: 13px; width: auto; }
.wrap.wide table.grid td form { margin: 0; }

/* The checks list beside it, same idea. */
.wrap.wide ul.checks li { padding: 5px 12px; margin-bottom: 4px; }

/* The applicant name now sits at the top of the left column rather than
   above both, so it needs the margins a column heading wants, not the
   ones a page heading had. */
.hr-col > h1:first-child { margin: 2px 0 0; font-size: 22px; }
.hr-col > h1:first-child + .fac-where { margin: 2px 0 14px; }

/* ---------- the promote screen --------------------------------------
   Fourteen fields, one per row, on the screen every hire passes
   through. Grouped as they are read: who they are, where they live,
   and the two the application deliberately never asked for. */

/* Headings and prose inside a field grid take the whole width. */
.fgrid > h2,
.fgrid > .form-note { grid-column: 1 / -1; }
.fgrid > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px;
              color: var(--muted); margin: 14px 0 2px; }
.fgrid > h2:first-child { margin-top: 2px; }
.fgrid > .form-note { color: var(--muted); font-size: 12px; margin: 2px 0 4px; }

@container (min-width: 560px) {
  .fgrid > .f-first { grid-column: span 6; }
  .fgrid > .f-last  { grid-column: span 6; }
  .fgrid > .f-mi    { grid-column: span 4; }
  .fgrid > .f-email { grid-column: span 8; }
  .fgrid > .f-addr1 { grid-column: span 8; }
  .fgrid > .f-addr2 { grid-column: span 4; }
  .fgrid > .f-city  { grid-column: span 6; }
  .fgrid > .f-state { grid-column: span 2; }
  .fgrid > .f-zip   { grid-column: span 4; }
  .fgrid > .f-ssn   { grid-column: span 6; }
  .fgrid > .f-dob   { grid-column: span 6; }
  .fgrid > .f-dept  { grid-column: span 8; }
  .fgrid > .f-sex   { grid-column: span 4; }
}

/* Three rows on a desk: name, address, and the two it does not ask. */
@container (min-width: 1500px) {
  .fgrid > .f-first { grid-column: span 3; }
  .fgrid > .f-last  { grid-column: span 3; }
  .fgrid > .f-mi    { grid-column: span 1; }
  .fgrid > .f-email { grid-column: span 3; }

  .fgrid > .f-addr1 { grid-column: span 4; }
  .fgrid > .f-addr2 { grid-column: span 2; }
  .fgrid > .f-city  { grid-column: span 3; }
  .fgrid > .f-state { grid-column: span 1; }
  .fgrid > .f-zip   { grid-column: span 2; }

  .fgrid > .f-ssn   { grid-column: span 3; }
  .fgrid > .f-dob   { grid-column: span 3; }
  .fgrid > .f-dept  { grid-column: span 4; }
  .fgrid > .f-sex   { grid-column: span 2; }
}

/* ---------- label/value lists on a wide page ------------------------
   ul.checks is a flex row per item with the value pushed to the far
   right. In the 340px sidebar it reads as a tidy pair; given 2240px it
   put "Address" at one end of the screen and the address itself at the
   other, 1700px away, with nothing in between.

   Flowing the list into columns fixes both halves at once - the pair
   stays together AND the width gets used. auto-fill means the column
   count follows the space: four at 2240, three at a 1920 screen, and
   one in the sidebar, where the track is wider than the container and
   it collapses back to the single column it always was. */
.wrap.wide ul.checks {
  display: grid;
  /* min(480px, 100%), not a bare 480px: a bare minimum forces a track
     wider than its container, and the same list lives in the 340px
     sidebar on the applicant page - where it promptly overflowed by
     140px. This way the track shrinks to the container when the
     container is the smaller of the two. */
  grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr));
  gap: 5px 14px;
  align-content: start;
}
.wrap.wide ul.checks li { margin-bottom: 0; }

/* ---------- the opening form ----------------------------------------
   Sixteen fields to post a job, one per row, was four screens. Two
   groups: what the building uses, then what goes out in public. */
.fgrid > .f-wide { grid-column: 1 / -1; }
.fgrid > .f-wide .note { margin: 2px 0 4px; }

@container (min-width: 560px) {
  .fgrid > .f-fac       { grid-column: span 6; }
  .fgrid > .f-title     { grid-column: span 6; }
  .fgrid > .f-dept      { grid-column: span 6; }
  .fgrid > .f-deptgroup { grid-column: span 6; }
  .fgrid > .f-emptype   { grid-column: span 4; }
  .fgrid > .f-flsa      { grid-column: span 4; }
  .fgrid > .f-jobcode   { grid-column: span 4; }
  .fgrid > .f-shift     { grid-column: span 6; }
  .fgrid > .f-reports   { grid-column: span 6; }
  .fgrid > .f-summary   { grid-column: 1 / -1; }
  .fgrid > .f-salary     { grid-column: span 6; }
  .fgrid > .f-education  { grid-column: span 6; }
  .fgrid > .f-experience { grid-column: span 6; }
  .fgrid > .f-expiry     { grid-column: span 6; }
  .fgrid > .f-requisition{ grid-column: span 6; }
  .fgrid > .f-billing    { grid-column: span 6; }
}

@container (min-width: 1500px) {
  .fgrid > .f-fac       { grid-column: span 3; }
  .fgrid > .f-title     { grid-column: span 5; }
  .fgrid > .f-dept      { grid-column: span 4; }

  .fgrid > .f-deptgroup { grid-column: span 3; }
  .fgrid > .f-emptype   { grid-column: span 3; }
  .fgrid > .f-flsa      { grid-column: span 3; }
  .fgrid > .f-jobcode   { grid-column: span 3; }

  .fgrid > .f-shift     { grid-column: span 6; }
  .fgrid > .f-reports   { grid-column: span 6; }

  .fgrid > .f-salary     { grid-column: span 4; }
  .fgrid > .f-education  { grid-column: span 4; }
  .fgrid > .f-experience { grid-column: span 4; }

  /* The date stays narrow; its warning takes the row beneath. */
  .fgrid > .f-expiry      { grid-column: span 3; }
  .fgrid > .f-requisition { grid-column: span 5; }
  .fgrid > .f-billing     { grid-column: span 4; }
}

/* A textarea is the one control that should not be 38px tall. */
.fgrid textarea.fld-in { line-height: 1.45; min-height: 96px; }

/* ---------- a public page that is a grid, not a column ---------------
   The applicant side is deliberately a 680px phone column: an
   application form and pages of prose, read mostly on a handset. The
   communities index is neither - it is 43 logo tiles, and at 680px on
   a desktop that is three columns, fifteen rows and 3111px of
   scrolling with 603px of empty page down each side.

   NOT .wrap.wide, which has accumulated the HR desk typography -
   23px headings, 12px notes, tight tables. This is width only, so the
   public page keeps the type it is read at. The tile grid is already
   auto-fill/minmax(190px), so it simply takes the room. */
/* max() on the outside so this can only ever ADD width. A bare
   min(1760px, 94vw) is 352px on a 375px phone - narrower than the
   680px column it was widening, which would have quietly taken 23px
   off the content on the devices most applicants use. */
.wrap.roomy { max-width: max(680px, min(1760px, 94vw)); }

/* --- the hiring pipeline (Madi's fifteen stages, 19 Nov 2026) --------
   One live stage, the rest either recorded or waiting. The states have
   to be tellable apart at a glance in both themes, so they differ by
   weight and a left border rather than by colour alone - "later" is
   the muted one, and muted-on-card is the only pair here that has to
   stay legible when the theme flips. */
.stages { list-style: none; margin: 0 0 1rem; padding: 0; }
.stages li {
  border-left: 3px solid var(--track);
  /* A rule under each row. With the name at one end and the controls
     at the other, 1400px apart, nothing tied them together and the
     list read as floating pieces. */
  border-bottom: 1px solid var(--line);
  padding: .16rem 0 .16rem .6rem;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .6rem;
  align-items: center;
}
.stages li.done  {
  border-left-color: var(--ok-line);
  background: var(--ok-bg);
}
/* Skipped keeps the cross and the muted title but NOT the green.
   The tint says the thing happened, and a skipped licence check
   did not happen. */
.stages li.skipped { background: none; }
/* --- what is finished, at a glance -----------------------------------
   A done row used to differ from a pending one by a 3px border and
   nothing else, which is no cue at all in a list of nineteen. A mark
   in front of the name does the work, and it is a GLYPH and not a
   colour: the same reason the states differ by weight and border
   rather than hue, and it survives both themes and a monochrome
   screen.

   Done and skipped get DIFFERENT marks on purpose. A skipped licence
   check is not a verified licence, and OnShift's own list used a tick
   and a cross for exactly that distinction. Written as CSS escapes so
   the stylesheet stays ASCII. */
.stages li.done .st-title::before {
  content: "\2713\00a0";
  color: var(--ok-line);
  font-weight: 700;
}
.stages li.skipped .st-title::before {
  content: "\00d7\00a0";
  color: var(--muted);
  font-weight: 700;
}
/* Finished work steps back so the eye lands on what is outstanding. */
.stages li.done .st-title { color: var(--muted); }
.stages li.done .st-undo { opacity: .45; }
.stages li.next  { border-left-color: var(--accent); background: var(--chip); }
.stages li.later { color: var(--muted); }
/* The name takes the space its text needs and no more - it used to
   claim 14rem and push everything after it onto new lines. */
.stages .st-title { flex: 0 1 auto; }
.stages li.next .st-title { font-weight: 600; }
.stages li.later .st-title { font-weight: 400; }
/* The blurb takes the slack in the middle, so the controls end up at
   the right of the SAME line. Both of these used to be flex 1 1 100%,
   which is a whole line each and most of why the list was so tall. */
.stages .st-when {
  font-size: .8rem;
  color: var(--muted);
  flex: 0 1 auto;
}
.stages .st-note {
  font-size: .8rem;
  color: var(--muted);
  flex: 1 1 10rem;
}
.stages li.next .st-note { color: var(--ink); }
/* The note box and its button sit on one line where there is room and
   stack on a phone; the skip tickbox always takes its own line, so it
   cannot be mistaken for a label on the button next to it. */
/* MEASURED IN A BROWSER, after guessing wrong at it twice. The note
   box is 208px and the button renders 184px, so the controls need
   397px - but the browser computes this form's max-content as 379px,
   so with wrapping allowed the button dropped under the box on every
   actionable row. Neither flex-shrink: 0 nor min-width: max-content
   touched it, because the form was never the thing being squeezed.
   nowrap is what fixes it. */
.stages .st-form {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  /* Shrinkable by default: on a phone the controls must be allowed to
     come in under the column rather than set its width. The desk
     layout pins it at 0 0 below, where one line a row is wanted. */
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
}
/* The two that wrap on purpose: the skip tickbox keeps a line of its
   own, and a drop zone is the full width of the row. */
.stages .st-form.drop { flex-wrap: wrap; }

/* One line a row is a DESK decision, so it is scoped to the desk
   layout - same breakpoint as .hr-cols. Below it the controls wrap
   again, because a button that refuses to wrap overflows a phone:
   measured at 420px, a 399px form in a 403px column and the page
   scrolling sideways by 16px. It has to sit AFTER the base rule, not
   up in the earlier media query, because the specificity is equal and
   source order is what decides. */
@media (min-width: 900px) {
  .stages .st-form { flex-wrap: nowrap; flex: 0 0 auto; }
  .stages .st-form.drop { flex-wrap: wrap; flex: 1 1 100%; }
}
/* And the label does not wrap either. Without this the button simply
   took the squeeze instead of the row: "Called to schedule interview"
   broke across two lines and the row grew to 68px. Refusing to wrap
   makes the button's min-content its full width, so the form has to
   ask for the 397px it needs and the blurb gives up the pixels - it
   has plenty. */
.stages .st-form button { white-space: nowrap; }
/* Capped, not greedy. An optional note does not need 1400px. */
.stages .st-form .fld-in { flex: 0 1 13rem; min-width: 8rem; margin: 0; }
/* The skip tickbox KEEPS its own line. Beside a button reading
   "Licensure verified" it would read as that button's label, which is
   a safety point and not a spacing one.

   It does mean that form wraps to two lines while its neighbours are
   one, so Verify Licensure's button sits ~165px short of the others.
   I tried squaring that with justify-content/margin-left on the form
   and it cost the thing that mattered: the form stopped being wide
   enough for the note box AND the button, so every row stacked them.
   A 165px ragged edge on one row is worth less than one-line rows, so
   the ragged edge stays. */

/* --- back-office controls are controls, not calls to action ---------
   Tighter and squarer than the applicant-facing buttons, and
   deliberately only here: `.wrap.wide` is what every HR page carries,
   and neither the careers site nor the application wizard does. A
   thumb on a phone wants the big rounded target; a hiring list forty
   rows long does not. (HR had a mobile-view toggle of its own until
   23 Nov, when it went - HR works at a desk.) */
.wrap.wide .btn {
  border-radius: 4px;
  padding: 9px 14px;
  font-size: 15px;
}
.wrap.wide .btn-sm {
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
/* Matched to the buttons they sit beside - a 3px button against an
   8px text box reads as two different kits. */
.wrap.wide .fld-in {
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 14px;
  line-height: 1.3;
}
.wrap.wide .stages .fld-in { font-size: 13px; }
/* The skip tickbox sits at the FRONT of the form now, left of the
   reason box, rather than on a line of its own. The reason it had its
   own line still holds - beside a button reading "Licensure verified"
   it would read as that button's label - and this answers it better,
   because what ends up next to the button is the reason box. Benjy's
   call, 23 Nov. The row drops to one line and its button finally
   lines up with every other one. */
.stages .st-form .chk {
  flex: 0 0 auto;
  font-size: .8rem;
  margin: 0;
  white-space: nowrap;
}
/* A drag target the size of a text field is not a drag target. */
.stages .st-form.drop { flex: 1 1 100%; margin: .2rem 0 0; }

/* --- one row per document a stage is recorded by (sql/58) ------------
   Two ways of accepting an offer come back as two different documents,
   so the stage lists them rather than taking one file. Each gets its
   own name, its own "on file", and its own upload - which is the whole
   visible difference between a document that supersedes another and one
   that does not. */
.stages .st-ev {
  flex: 1 1 100%;
  margin: .3rem 0 0;
  padding-left: .55rem;
  border-left: 2px solid var(--track);
}
.stages .st-evname { font-size: .86rem; font-weight: 600; }

/* --- form rows inside the one list (23 Nov) --------------------------
   A form and a stage sit in the same list now, so they have to be
   tellable apart without reading: a stage has a solid rule, a form a
   dotted one, and the small grey word says which kind of form it is.
   Not colour alone - the same reason the stage states differ by weight
   and border rather than by hue. */
.stages li.form { border-left-style: dotted; }
.stages li.form .st-title { font-weight: 400; }
.stages .who {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

/* --- the application resume link -------------------------------------
   Quiet, but it has to be findable: it is the only way back into a
   half-finished application now that the token has left the address
   bar. The URL itself breaks anywhere so a long token does not push
   the page sideways on a phone. */
.resume-link {
  margin: 1.25rem 0 0;
  padding: .6rem .75rem;
  border-left: 3px solid var(--track);
  font-size: .85rem;
  color: var(--muted);
}
.resume-url {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .8rem;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* --- the undo on a stage already done (sql/59) -----------------------
   Deliberately quiet. It sits on rows that are FINISHED, where the
   useful information is the stamp and not the button, and an
   administrator looking for it will find it. */
.stages li.done .st-undo { opacity: .65; }
.stages li.done .st-undo:focus-within,
.stages li.done .st-undo:hover { opacity: 1; }
.stages .st-undo .fld-in { flex: 1 1 10rem; font-size: .82rem; }
.stages .st-ev .st-when { display: inline; margin-left: .35rem; }

/* --- the signed-offer drop zone (stage 11, sql/53) -------------------
   The file input is kept reachable rather than hidden behind a styled
   label: a hidden input is what breaks keyboard and screen-reader use,
   and this is a back-office screen somebody may well be driving from
   the keyboard. So the label is the drop target and the input sits
   inside it. */
.drop .drop-label {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  align-items: center;
  margin: 0;
  padding: .5rem .6rem;
  border: 1px dashed var(--dash);
  border-radius: 4px;
  background: var(--card);
  cursor: pointer;
}
.drop .drop-hint {
  font-size: .82rem;
  color: var(--muted);
  flex: 1 1 10rem;
}
/* Dragging over, and a file chosen. Both change the border as well as
   the colour, so neither depends on hue alone. */
.drop.over .drop-label {
  border-style: solid;
  border-color: var(--accent);
  background: var(--chip);
}
.drop.has-file .drop-label { border-style: solid; border-color: var(--ok-line); }
.drop.has-file .drop-hint  { color: var(--ink); }
.drop.too-big .drop-label  { border-color: var(--warn-line); background: var(--warn-bg); }
.drop.too-big .drop-hint   { color: var(--ink); }
/* The warn tokens are light surfaces in both themes, so pin readable
   ink on them rather than inheriting a pale --ink in dark mode. */
:root[data-theme="dark"] .drop.too-big .drop-label,
:root[data-theme="dark"] .drop.too-big .drop-hint { color: #1d2430; }

/* --- several stages can be open at once (sql/57) ---------------------
   "next" is the earliest open one and keeps the chip background;
   "open" is the others - same accent border so they read as live, no
   fill, so the eye still lands on one row first. "later" stays muted
   and now carries a line saying what it waits for. */
.stages li.open { border-left-color: var(--accent); }
.stages li.open .st-title { font-weight: 600; }

/* Admin mode (sql/76). The risk of a mode is forgetting you are in
   it, so the ON state is a band across the top of the page rather
   than a tick somewhere - and the OFF state still says which rules
   are in force, because "no banner" reads as "no mode". */
.adminmode {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); font-size: 0.92rem; color: var(--muted);
}
.adminmode.on {
  border-color: #b4571a; background: #fdf1e5; color: #6b3310;
}
.adminmode.on strong { color: #8a3f12; }
@media (prefers-color-scheme: dark) {
  .adminmode.on { background: #3a2410; border-color: #b4571a; color: #f5d5b8; }
  .adminmode.on strong { color: #ffc389; }
}

/* The applicant tabs (sql/77). Three states, one of them always on,
   with the count in the tab so an empty one reads as empty rather
   than as a page that failed to load. */
.tabs { display: flex; gap: 4px; margin: 0 0 12px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 6px 6px 0 0; border-bottom: none;
  background: var(--panel); color: var(--muted); text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab.on { background: var(--bg); color: var(--ink); font-weight: 600;
          box-shadow: inset 0 2px 0 var(--accent); }
.tab-n { font-size: 0.8rem; color: var(--muted); }
.tab.on .tab-n { color: var(--ink); }

/* Rejected band and the two buttons (sql/77). Red to stop, green to
   put back - Madi asked for those colours by name. */
.rejected-band {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid #b03030; border-radius: 6px;
  background: #fdeaea; color: #6d1b1b;
}
.rejected-band strong { color: #8a1f1f; }
.btn-stop { background: #a52828; border-color: #8a1f1f; color: #fff; }
.btn-stop:hover { background: #8a1f1f; }
.btn-go { background: #1d7a46; border-color: #166036; color: #fff; }
.btn-go:hover { background: #166036; }
.rejectform { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rejectform .fld-in { min-width: 320px; }
@media (prefers-color-scheme: dark) {
  .rejected-band { background: #3b1414; border-color: #b03030; color: #f6cfcf; }
  .rejected-band strong { color: #ff9f9f; }
}

/* The per-stage magnifier (sql/78). Quiet until hovered: it sits on
   every recorded stage, and a row of bright icons would compete with
   the controls that actually do something. */
.st-peek { text-decoration: none; opacity: 0.5; margin-left: 6px; }
.st-peek:hover, .st-peek:focus { opacity: 1; }
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* The facility's own logo in the masthead (note 6). Height-capped so a
   tall logo cannot push the bar around, and width-capped so a wide one
   cannot crowd out the name beside it. */
.masthead .mark-logo {
  height: 28px; width: auto; max-width: 150px; object-fit: contain;
  border-radius: 4px; background: #fff; padding: 2px 4px;
}
