/* ─────────────────────────────────────────────
   iworkfor.sa.gov.au — Modern Redesign
   Legacy content bridge

   Applied on every NON job-search page (login, register, job alerts,
   application process, advert detail, and the static CMS pages). The page's
   original markup/functionality is untouched — this simply restyles it with
   the modern design tokens so the whole site looks consistent.
   ───────────────────────────────────────────── */

body.modern-mode {
  background: var(--bg);
  color: var(--text);
  font-family: 'South Australia Sans', Arial, Helvetica, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.55;
}

/* Legacy styles.css (loaded only on non-search pages) greys every .nav-item on
   hover. Keep the modern header nav identical to the job search page. */
.site-header .site-nav .nav-item:hover {
  background-color: transparent;
}

/* CMS-managed banners ---------------------------------------------------
   header-image / header-carousel / header-people / header-paths still render
   straight from the CMS — we only restyle their frame so they sit nicely in
   the modern layout. Collapses to nothing when the CMS supplies no banner. */
.modern-banner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.modern-banner .header-wrapper,
.modern-banner .header-wrapper-mob,
.modern-banner .carousel {
  margin-top: 26px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-2);
}
.modern-banner .row { margin-left: 0 !important; margin-right: 0 !important; }
.modern-banner .header-main,
.modern-banner .header_image_img {
  width: 100%;
  background-size: cover;
  background-position: center;
}
.modern-banner .header-wrapper-mob .header_image_img {
  background-size: contain;
}
/* Mobile banner box height follows the image's real proportion (set by
   modern-page.js), so wide CMS images don't letterbox. Default = legacy 60.1%. */
.modern-banner .header-wrapper-mob .header_image_img::before {
  padding-top: var(--mob-banner-ratio, 60.1%);
}
/* Carousel controls in brand colours */
.modern-banner .carousel-indicators li { background-color: rgba(255,255,255,.65); border-radius: 999px; }
.modern-banner .carousel-indicators .active { background-color: var(--brand); }

/* The page card sits directly under a banner */
.modern-banner + .modern-page { padding-top: 26px; }

/* Page shell ------------------------------------------------------------
   Same max-width as the job search page so the header, body and footer all
   share one set of edges. Long-form text inside is kept readable by the
   measure cap on .modern-content below rather than by narrowing the shell. */
.modern-page {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 34px var(--pad-x) 70px;
}
/* The legacy markup lives in here */
.modern-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: clamp(20px, 3vw, 38px);
}

/* Typography ------------------------------------------------------------ */
.modern-content h1,
.modern-content h2,
.modern-content h3,
.modern-content h4 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 1.6em 0 .55em;
}
.modern-content h1:first-child,
.modern-content h2:first-child,
.modern-content h3:first-child { margin-top: 0; }
.modern-content h1 { font-size: var(--fs-4xl); }
.modern-content h2 { font-size: var(--fs-3xl); }
.modern-content h3 { font-size: var(--fs-xl); }
.modern-content h4 { font-size: var(--fs-lg); }
.modern-content h5,
.modern-content h6 {
  font-size: var(--fs-lg);
  color: var(--ink);
  font-weight: 800;
  line-height: var(--lh-tight);
  margin: 1.6em 0 .55em;
}
.modern-content .faq-body,
.modern-content .faq-body :where(p, ul, ol, li, div, span, a, strong, b, i, em, td, blockquote) {
  font-weight: 400 !important;
}
.modern-content .faq-body :is(h1, h2, h3, h4, h5, h6),
.modern-content .faq-body :is(h1, h2, h3, h4, h5, h6) * {
  font-weight: 700 !important;
}
body.modern-mode .modern-content .faq-body button.faq-question {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none;
  color: inherit !important;
  font: inherit;
  text-align: left;
  white-space: normal;
  transform: none;
}
body.modern-mode .modern-content .faq-body button.faq-question:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Body copy -------------------------------------------------------------
   The legacy stylesheet sizes p/li in pt (p and li are 16pt ~= 21px, and
   .highlighted p is 19pt !important). That is why content pages used to
   render noticeably larger text than the job search page, and pt - like px -
   ignores the reader's default font size. These rules put legacy content
   back on the shared rem scale so every page matches.
   !important is required only where the legacy rule also uses it. */
.modern-content p,
.modern-content li,
.modern-content td,
.modern-content dd,
.modern-content dt {
  font-size: var(--fs-md);
  line-height: var(--lh-body);
}
.modern-content p { margin: 0 0 1em; }
.modern-content ul,
.modern-content ol { margin: 0 0 1.1em 1.25em; }
.modern-content li { margin-bottom: .4em; }

/* Readable measure -------------------------------------------------------
   The card now spans the full shell so it lines up with the header, footer
   and job cards. Running text is capped near 75 characters so lines stay
   readable at that width (WCAG 1.4.8 asks for 80 or fewer).

   Applied at any depth, because CMS body HTML nests inconsistently. Text
   inside tables is excluded so table cells keep the full column width.
   To let a page run edge to edge, remove the cap for that page's wrapper. */
.modern-content p,
.modern-content ul,
.modern-content ol,
.modern-content h2,
.modern-content h3,
.modern-content h4 { max-width: 75ch; }

.modern-content table p,
.modern-content table ul,
.modern-content table ol { max-width: none; }
.modern-content a,
.modern-content a:visited {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.modern-content a:hover {
  color: var(--brand-700);
  text-decoration-thickness: 2px;
}
.modern-content a:focus-visible {
  color: var(--brand-700);
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
body.modern-mode .modern-content :is(p, li) a:not(.btn):not([role="button"]):not(.promo-cta):not(.confirm-action) {
  text-decoration-line: underline !important;
  text-underline-offset: 3px;
}
body.modern-mode .modern-content a:not(.btn):not([role="button"]):not(.promo-cta):not(.confirm-action),
body.modern-mode .modern-content a:not(.btn):not([role="button"]):not(.promo-cta):not(.confirm-action) span {
  color: var(--brand-700) !important;
}
.modern-content hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
body.modern-mode a#tipsheader {
  display: inline-block;
  margin-block: 8px;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.5;
  color: var(--brand-700) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.modern-mode a#tipsheader:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
body.modern-mode .modern-content label.remember-me-label {
  display: inline;
  margin: 0;
  font: inherit;
  color: inherit;
}
body.modern-mode .modern-content label.recovery-email-label { display: block; }
.modern-content #rss-wrapper .share-fallback { margin-right: 8px; }
.modern-content #rss-wrapper a:has(.a2a_svg) .share-fallback { display: none; }
.modern-content img { max-width: 100%; height: auto; }
/* CMS-authored body copy can embed fixed-width media (e.g. a 560px video
   iframe), which forces the whole page to scroll sideways on a phone. */
body.modern-mode .modern-content iframe,
body.modern-mode #brs_mainContent iframe,
body.modern-mode .modern-content embed,
body.modern-mode .modern-content object,
body.modern-mode .modern-content video { max-width: 100%; }

/* Forms ----------------------------------------------------------------- */
.modern-content label,
.modern-content .FormLabel,
.modern-content .formlabel,
.modern-content .requiredFieldHead,
.modern-content .head,
.modern-content .headTop {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink) !important;
  letter-spacing: -0.005em;
}
.modern-content input:not([type]),
.modern-content input[type="text"],
.modern-content input[type="password"],
.modern-content input[type="email"],
.modern-content input[type="tel"],
.modern-content input[type="number"],
.modern-content input[type="date"],
.modern-content input[type="search"],
.modern-content select,
.modern-content textarea {
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  max-width: 100%;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.modern-content textarea { line-height: 1.5; }
body.modern-mode .modern-content form#loginform input[type="text"],
body.modern-mode .modern-content form#loginform input[type="password"] {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 11px 14px;
  font-weight: 400;
}
body.modern-mode .modern-content form#loginform input[type="text"]:focus,
body.modern-mode .modern-content form#loginform input[type="password"]:focus,
body.modern-mode .modern-content .legacy-form-table input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):focus,
body.modern-mode .modern-content .legacy-form-table select:focus,
body.modern-mode .modern-content .legacy-form-table textarea:focus {
  background: var(--surface);
  border-color: var(--brand);
  outline: none;
  box-shadow: none;
}
.modern-content input:focus,
.modern-content select:focus,
.modern-content textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.modern-content input[type="checkbox"],
.modern-content input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* Shared legacy forms ---------------------------------------------------
   Authentication, password recovery, registration and tenant-defined
   utility pages all use table.Form. modern-page.js adds these hooks without
   moving controls, so original validation and submit handlers remain intact. */
body.modern-mode .modern-content form.legacy-form-modern {
  width: 100%;
  max-width: 880px;
  margin: 0;
}
body.modern-mode .modern-content table.legacy-form-table {
  display: block;
  width: 100% !important;
  margin: 0;
  border: 0;
  border-collapse: separate;
  background: transparent !important;
}
body.modern-mode .modern-content table.legacy-form-table > tbody {
  display: block;
  width: 100%;
}
body.modern-mode .modern-content table.legacy-form-table > tbody > tr.legacy-form-row {
  display: grid !important;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 10px 22px;
  align-items: center;
  width: 100% !important;
  margin: 0;
  padding: 10px 0;
  border: 0;
  background: transparent !important;
}
body.modern-mode .modern-content table.legacy-form-table > tbody > tr.legacy-form-row > td {
  display: block !important;
  width: auto !important;
  min-width: 0;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  vertical-align: middle;
}
body.modern-mode .modern-content .legacy-form-label {
  align-self: start;
  padding-top: 12px !important;
  color: var(--ink) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 700 !important;
  line-height: 1.35;
  text-align: left !important;
  white-space: normal;
}
body.modern-mode .modern-content .legacy-form-field {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}
body.modern-mode .modern-content .legacy-form-table input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body.modern-mode .modern-content .legacy-form-table select,
body.modern-mode .modern-content .legacy-form-table textarea {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 520px !important;
  min-height: 44px;
  margin: 0 !important;
}
body.modern-mode .modern-content .legacy-form-table select[multiple] {
  min-height: 150px;
}
body.modern-mode .modern-content .legacy-form-unlabelled > td:first-child:empty {
  display: block !important;
}
body.modern-mode .modern-content .legacy-form-choice .legacy-form-field {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
body.modern-mode .modern-content .legacy-form-choice input[type="checkbox"],
body.modern-mode .modern-content .legacy-form-choice input[type="radio"] {
  flex: none;
  width: 18px !important;
  height: 18px;
  margin: 0 !important;
}
body.modern-mode .modern-content .legacy-form-actions {
  padding-top: 16px !important;
}
body.modern-mode .modern-content .legacy-form-actions br,
body.modern-mode .modern-content .legacy-form-links br {
  display: none;
}
body.modern-mode .modern-content .legacy-form-actions .legacy-form-field {
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.modern-mode .modern-content .legacy-form-actions .legacy-action-secondary {
  color: var(--text) !important;
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}
body.modern-mode .modern-content .legacy-form-actions .legacy-action-secondary:hover {
  color: var(--brand) !important;
  background: var(--brand-50) !important;
  border-color: var(--brand) !important;
}
body.modern-mode .modern-content .legacy-form-actions .legacy-action-danger {
  color: var(--brand) !important;
  background: var(--surface) !important;
  border-color: var(--brand) !important;
  box-shadow: none !important;
}
body.modern-mode .modern-content .legacy-form-actions .legacy-action-danger:hover {
  color: var(--brand-700) !important;
  background: var(--brand-50) !important;
  border-color: var(--brand-700) !important;
}
body.modern-mode .modern-content .legacy-form-links {
  padding: 3px 0 !important;
}
body.modern-mode .modern-content .legacy-form-links a,
body.modern-mode .modern-content .legacy-form-links a:visited,
body.modern-mode .modern-content a.brs_terms {
  color: var(--brand) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.modern-mode .modern-content .legacy-form-links a:hover,
body.modern-mode .modern-content a.brs_terms:hover {
  color: var(--brand-700) !important;
}
body.modern-mode .modern-content fieldset {
  min-width: 0;
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
body.modern-mode .modern-content legend {
  width: auto;
  margin: 0;
  padding: 0 8px;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: 700;
}
body.modern-mode .modern-content .badMessage,
body.modern-mode .modern-content .goodMessage,
body.modern-mode .modern-content #JSWarning {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 75ch;
  margin: 0 0 20px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--r) !important;
  background: var(--surface-soft) !important;
  color: var(--text);
  font-size: var(--fs-base) !important;
}
body.modern-mode .modern-content .badMessage {
  border-color: var(--brand-200) !important;
  background: var(--brand-50) !important;
  color: var(--brand-700);
}
body.modern-mode .modern-content .goodMessage {
  border-color: #b8d8c6 !important;
  background: #edf7f1 !important;
  color: var(--success);
}

/* Authentication and public registration pages use the same compact card
   and field rhythm as the search/apply interfaces instead of a wide empty
   legacy table. */
body.modern-mode .modern-page.is-auth {
  max-width: 980px;
}
body.modern-mode .modern-page.is-auth .modern-content {
  padding: clamp(24px, 4vw, 44px);
}
body.modern-mode .modern-page.is-auth .modern-content h1 {
  margin: 0 0 28px;
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 700;
  text-transform: none !important;
}
body.modern-mode .modern-page.is-auth form.legacy-form-modern {
  max-width: 680px;
}
body.modern-mode .modern-page.is-auth .legacy-form-table input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]) {
  max-width: 440px !important;
}
@media (max-width: 767px) {
  body.modern-mode .modern-page.is-auth .legacy-form-table :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea) {
    font-size: 16px !important;
  }
}
body.modern-mode .modern-page.is-auth .tr-google-captcha .legacy-form-field {
  overflow: hidden;
}
body.modern-mode .modern-page.is-auth .g-recaptcha,
body.modern-mode .modern-page.is-auth iframe {
  max-width: 100% !important;
}

/* Buttons ---------------------------------------------------------------
   Geometry below is the prototype's .btn rule verbatim: pill radius,
   14px/700 text, -0.1px tracking and the same press transform. Role
   colours (primary / save / back) are applied further down so every
   button on every modern page resolves to one of the prototype's three
   treatments and nothing is left on a browser default. */
.modern-content .btn,
.modern-content button,
.modern-content input[type="submit"],
.modern-content input[type="button"],
.modern-content input[type="reset"],
.modern-content .button,
.modern-content a.btn-orange,
.modern-content .btn-grey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.1px;
  line-height: 1;
  min-height: 44px;
  text-transform: none !important;
  color: #fff !important;
  background: var(--brand) !important;
  border: 1px solid var(--brand) !important;
  border-radius: 999px !important;
  padding: 11px 22px !important;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow: var(--sh-1);
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
}
.modern-content .btn:hover,
.modern-content button:hover,
.modern-content input[type="submit"]:hover,
.modern-content input[type="button"]:hover,
.modern-content .button:hover,
.modern-content .btn-grey:hover {
  color: #000 !important;
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.modern-content .btn:active,
.modern-content button:active,
.modern-content input[type="submit"]:active,
.modern-content input[type="button"]:active,
.modern-content .button:active { transform: translateY(0.5px) scale(0.99); }

/* Keyboard focus must stay obvious: these are pill buttons on a tinted
   page, where the UA default ring is easy to lose. */
body.modern-mode .modern-content #forgottenPassword .resetBtn:focus,
body.modern-mode .modern-content #forgottenPassword .resetBtn:active {
  box-shadow: none;
}
body.modern-mode .modern-content #forgottenPassword .resetBtn:focus:not(:focus-visible) {
  outline: none;
}
.modern-content .btn:focus-visible,
.modern-content button:focus-visible,
.modern-content input[type="submit"]:focus-visible,
.modern-content input[type="button"]:focus-visible,
.modern-content input[type="reset"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* The page disables both buttons for the duration of a save, so the
   disabled state is a state users will actually see. */
.modern-content button[disabled],
.modern-content input[type="button"][disabled],
.modern-content input[type="submit"][disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Secondary — the prototype's .btn-save treatment.
   Prefixed with body.modern-mode purely for weight: the generic rule
   above matches input[type="button"] with !important, and an attribute
   selector counts the same as a class, so a plain `.modern-content
   .btn-save` would lose the tie and every button would render filled.
   The extra class puts these rules decisively ahead. */
body.modern-mode .modern-content .btn-secondary,
body.modern-mode .modern-content .btn-save,
body.modern-mode .modern-content input[type="reset"] {
  color: var(--text) !important;
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}
body.modern-mode .modern-content .btn-secondary:hover,
body.modern-mode .modern-content .btn-save:hover,
body.modern-mode .modern-content input[type="reset"]:hover {
  color: var(--brand) !important;
  background: var(--brand-50) !important;
  border-color: var(--brand) !important;
}

/* Primary — the prototype's .btn-next treatment. */
body.modern-mode .modern-content .btn-next {
  color: #fff !important;
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}
body.modern-mode .modern-content .btn-next:hover {
  color: #000 !important;
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
}

/* Tertiary — the prototype's .btn-back-step treatment. */
body.modern-mode .modern-content .btn-back-step {
  color: var(--muted) !important;
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
body.modern-mode .modern-content .btn-back-step:hover {
  color: var(--ink) !important;
  background: var(--surface) !important;
  border-color: var(--ink) !important;
}

/* Tables (report / results / generic) ------------------------------------ */
.modern-content table { border-collapse: collapse; width: 100%; }
.modern-content .Report,
.modern-content table.Report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: var(--fs-base);
}
.modern-content .Report td,
.modern-content .Report th { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.modern-content .Report tr:last-child td { border-bottom: 0; }
.modern-content .reportheading,
.modern-content .Report th {
  background: var(--bg-2) !important;
  color: var(--ink) !important;
  font-size: var(--fs-xs) !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
}
.modern-content .Report tbody tr:hover { background: var(--surface-soft); }

/* Attachment questions ---------------------------------------------------
   modern-page.js keeps every authoritative legacy control and handler, then
   presents each attachment question as its own compact Option 4 chooser.
   Nothing here assumes attachments share a page or step. */
body.modern-mode .modern-content .modern-attachment {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 4px 0 8px;
  font-size: var(--fs-base);
}
body.modern-mode .modern-content .modern-attachment-empty {
  display: none;
  padding: 11px 13px;
  border: 1px solid var(--brand-100);
  border-radius: var(--r);
  background: var(--brand-50);
}
body.modern-mode .modern-content .modern-attachment.has-no-saved .modern-attachment-empty:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.modern-mode .modern-content .modern-attachment-empty strong {
  color: var(--ink);
  font-size: var(--fs-base);
}
body.modern-mode .modern-content .modern-attachment-empty span {
  color: var(--ink);
  font-size: var(--fs-sm);
}
body.modern-mode .modern-content .modern-attachment-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
/* Only one choice is offered when the account has no saved files left to
   attach, so let it use the full width rather than sitting half-empty. */
body.modern-mode .modern-content .modern-attachment.has-no-saved .modern-attachment-choices {
  grid-template-columns: minmax(0, 1fr);
}
body.modern-mode .modern-content button.modern-attachment-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 12px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--r) !important;
  color: var(--text) !important;
  background: var(--surface) !important;
  text-align: left;
  box-shadow: none !important;
  transition: border-color var(--t-fast), background var(--t-fast);
}
body.modern-mode .modern-content button.modern-attachment-choice:hover,
body.modern-mode .modern-content button.modern-attachment-choice[aria-expanded="true"] {
  border-color: var(--brand) !important;
  color: var(--ink) !important;
  background: var(--brand-50) !important;
  transform: none;
  box-shadow: none !important;
}
body.modern-mode .modern-content button.modern-attachment-choice:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
body.modern-mode .modern-content .modern-attachment-choice-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--brand-700);
  background: var(--brand-50);
}
body.modern-mode .modern-content .modern-attachment-choice-icon svg {
  width: 18px;
  height: 18px;
}
body.modern-mode .modern-content .modern-attachment-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
body.modern-mode .modern-content .modern-attachment-choice-copy strong {
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 750;
}
body.modern-mode .modern-content .modern-attachment-choice-copy > span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
body.modern-mode .modern-content .modern-attachment-panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-soft);
}
body.modern-mode .modern-content .modern-attachment-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.modern-mode .modern-content .modern-attachment-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
body.modern-mode .modern-content .modern-attachment-file-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  border-radius: 6px;
  color: var(--brand-700);
  background: var(--brand-50);
  font-size: 0.625rem;
  font-weight: 800;
}
body.modern-mode .modern-content .modern-attachment-file-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body.modern-mode .modern-content .modern-attachment-file-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.modern-mode .modern-content .modern-attachment-file-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.modern-mode .modern-content button.modern-attachment-file-view,
body.modern-mode .modern-content button.modern-attachment-file-use {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 750;
}
body.modern-mode .modern-content button.modern-attachment-file-view {
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  background: var(--surface) !important;
}
body.modern-mode .modern-content button.modern-attachment-file-use {
  border: 1px solid var(--brand) !important;
  color: #fff !important;
  background: var(--brand) !important;
}
body.modern-mode .modern-content button.modern-attachment-file-view,
body.modern-mode .modern-content button.modern-attachment-file-use {
  padding: 6px 11px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  transform: none;
}
body.modern-mode .modern-content button.modern-attachment-file-view:hover {
  border-color: var(--ink) !important;
  color: var(--ink) !important;
  background: var(--surface) !important;
}
body.modern-mode .modern-content button.modern-attachment-file-use:hover {
  border-color: var(--brand-600) !important;
  color: var(--ink) !important;
  background: var(--brand-600) !important;
}
body.modern-mode .modern-content button.modern-attachment-file-view:focus-visible,
body.modern-mode .modern-content button.modern-attachment-file-use:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
body.modern-mode .modern-content .modern-attachment-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 16px;
}
body.modern-mode .modern-content .modern-attachment-upload-copy {
  display: flex;
  flex-direction: column;
}
body.modern-mode .modern-content .modern-attachment-upload-copy strong {
  color: var(--ink);
  font-size: var(--fs-base);
}
body.modern-mode .modern-content .modern-attachment-upload-copy span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
/* The real Plupload container carries raw legacy text nodes and <br>s.
   Zeroing its font hides only those remnants; the browse control and live
   progress span explicitly restore the type size. */
body.modern-mode .modern-content .modern-attachment-upload-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 2;
  grid-row: 1;
  width: auto;
  font-size: 0;
}
body.modern-mode .modern-content .modern-attachment-upload-controls br,
body.modern-mode .modern-content .modern-attachment-upload-controls input[type="checkbox"] {
  display: none;
}
body.modern-mode .modern-content input.modern-attachment-browse {
  min-height: 40px;
  padding: 8px 16px !important;
  border: 1px solid var(--brand) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: var(--brand) !important;
  font-size: var(--fs-base) !important;
  font-weight: 750 !important;
  box-shadow: none !important;
}
body.modern-mode .modern-content .modern-attachment-upload-controls [id^="filelist"] {
  color: var(--muted);
  font-size: var(--fs-xs);
}
body.modern-mode .modern-content .modern-attachment-save {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  grid-column: 1 / -1;
  color: var(--text);
  font-size: var(--fs-sm);
}
body.modern-mode .modern-content .modern-attachment-save input {
  display: inline-block !important;
  flex: none;
  width: 18px !important;
  height: 18px;
  margin: 1px 0 0 !important;
  accent-color: var(--brand);
}
body.modern-mode .modern-content .modern-attachment-rules {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}
body.modern-mode .modern-content .modern-attachment-status:empty { display: none; }
body.modern-mode .modern-content .modern-attachment-status {
  grid-column: 1 / -1;
  color: var(--success);
  font-size: var(--fs-xs);
  font-weight: 700;
}
body.modern-mode .modern-content .modern-attachment-selected-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.modern-mode .modern-content .modern-attachment-remaining {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}
body.modern-mode .modern-content .modern-attachment-selected {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #b8d8c6;
  border-radius: var(--r);
  background: #edf7f1;
}
body.modern-mode .modern-content .modern-attachment-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-weight: 800;
}
body.modern-mode .modern-content .modern-attachment-selected-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
body.modern-mode .modern-content .modern-attachment-selected-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.modern-mode .modern-content .modern-attachment-selected-name {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.modern-mode .modern-content .modern-attachment-selected-actions {
  display: flex;
  gap: 6px;
}
body.modern-mode .modern-content input.modern-attachment-action,
body.modern-mode .modern-content button.modern-attachment-action {
  min-height: 34px;
  padding: 6px 11px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  background: var(--surface) !important;
  font-size: var(--fs-xs) !important;
  font-weight: 750 !important;
}
body.modern-mode .modern-content button.modern-attachment-action {
  box-shadow: none !important;
  cursor: pointer;
  transform: none;
}
body.modern-mode .modern-content input.modern-attachment-action.is-remove,
body.modern-mode .modern-content button.modern-attachment-action.is-remove {
  color: var(--brand) !important;
}
body.modern-mode .modern-content button.modern-attachment-action:hover {
  background: var(--surface-soft) !important;
}
body.modern-mode .modern-content input.modern-attachment-action:focus-visible,
body.modern-mode .modern-content button.modern-attachment-action:focus-visible {
  outline: 3px solid var(--ink) !important;
  outline-offset: 2px !important;
}

/* Messages -------------------------------------------------------------- */
.modern-content .alert,
.modern-content .error,
.modern-content .message {
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: var(--fs-base);
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  margin-bottom: 16px;
}
.modern-content .alert-success { background: #EAF6EF; border-color: #BFE2CD; color: var(--success); }
.modern-content .alert-danger,
.modern-content .error { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }

/* Server-managed maintenance notices are emitted immediately before the page
   content. Keep their text untouched while presenting them as a first-class
   product notification rather than an inline red legacy message. */
body.modern-mode .maintenance-notice {
  box-sizing: border-box;
  max-width: calc(var(--shell) - var(--pad-x) * 2);
  margin: 24px auto 0;
  padding: 14px 18px;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-left: 4px solid var(--brand);
  border-radius: var(--r);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: var(--lh-body);
  text-align: left;
}
body.modern-mode .maintenance-notice a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Neutralise legacy chrome that would clash with the modern shell -------- */
body.modern-mode #brs_header,
body.modern-mode #brs_footer,
body.modern-mode #brs_customheader,
body.modern-mode #brs_customfooter { display: none !important; }

body.modern-mode #brs_mainContent { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; width: auto; }

/* Flatten the legacy Bootstrap grid inside the modern card so content isn't
   double-indented by the col- and offset- wrappers. */
body.modern-mode .modern-content .container,
body.modern-mode .modern-content .container-fluid { padding-left: 0; padding-right: 0; max-width: none; width: auto; }
body.modern-mode .modern-content .row { margin-left: 0; margin-right: 0; }
body.modern-mode .modern-content [class*="col-"] {
  flex: 0 0 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}
body.modern-mode .modern-content [class*="offset-"] { margin-left: 0 !important; }

/* Legacy "highlighted" intro band → modern lead paragraph.
   The legacy rule is `div.highlighted p { font-size: 19pt !important }`, so
   matching !important here is the only way to bring it onto the scale. */
body.modern-mode .modern-content .highlighted {
  background: var(--surface-soft);
  min-height: 0;
  border-left: 4px solid var(--brand);
  border-radius: var(--r);
  padding: 16px 20px !important;
  margin: 0 0 22px;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
}
body.modern-mode .modern-content .highlighted p {
  font-size: var(--fs-base) !important;
  line-height: var(--lh-body);
  margin-bottom: 0;
}
body.modern-mode .modern-content .highlighted p + p { margin-top: 1em; }

/* Page title. Uses the same clamp as the search page's h1 so headings line
   up in size across the whole site. */
body.modern-mode .modern-content .heading1 { font-size: clamp(1.625rem, 3.2vw, 2.375rem); }

/* Primary-navigation content pages --------------------------------------
   These CMS pages contain short, structured copy. The general 75ch measure
   leaves a conspicuous empty column, while their legacy Bootstrap utilities
   add generous spacing inside the modern card. Use the available card width
   and the same compact type rhythm as the rest of the modern site. */
body.modern-mode .modern-page.is-content-page .modern-content #brs_mainContent {
  font-family: inherit;
}
body.modern-mode .modern-page.is-content-page .modern-content p,
body.modern-mode .modern-page.is-content-page .modern-content ol,
body.modern-mode .modern-page.is-content-page .modern-content ul,
body.modern-mode .modern-page.is-content-page .modern-content h2,
body.modern-mode .modern-page.is-content-page .modern-content h3,
body.modern-mode .modern-page.is-content-page .modern-content h4 {
  max-width: none;
}
body.modern-mode .modern-page.is-content-page .modern-content p,
body.modern-mode .modern-page.is-content-page .modern-content li,
body.modern-mode .modern-page.is-content-page .modern-content h1,
body.modern-mode .modern-page.is-content-page .modern-content h2,
body.modern-mode .modern-page.is-content-page .modern-content h3,
body.modern-mode .modern-page.is-content-page .modern-content h4,
body.modern-mode .modern-page.is-content-page .modern-content h5,
body.modern-mode .modern-page.is-content-page .modern-content h6,
body.modern-mode .modern-page.is-content-page .modern-content label,
body.modern-mode .modern-page.is-content-page .modern-content input,
body.modern-mode .modern-page.is-content-page .modern-content select,
body.modern-mode .modern-page.is-content-page .modern-content textarea {
  font-family: inherit !important;
}
/* CMS rich-text editors can leave inline font faces and point sizes on spans.
   They fragment otherwise uniform paragraphs (for example, 16pt text embedded
   inside 15px body copy). Let structural elements define the modern type
   scale, while inline phrasing elements inherit it. Bold and italics remain. */
body.modern-mode .modern-page.is-content-page .modern-content span,
body.modern-mode .modern-page.is-content-page .modern-content font {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit;
}
/* A few CMS pages use a 24pt span as a section label instead of a heading
   element. Preserve that hierarchy on the shared modern scale rather than
   either displaying the arbitrary point size or flattening it to body copy. */
body.modern-mode .modern-page.is-content-page .modern-content span[style*="font-size: 24pt"] {
  font-size: var(--fs-xl) !important;
}
body.modern-mode .modern-page.is-content-page #brs_mainContent > .row:first-child {
  padding-top: 0 !important;
  padding-bottom: 18px !important;
}
body.modern-mode .modern-page.is-content-page .modern-content .highlighted {
  margin-bottom: 18px;
}
body.modern-mode .modern-page.is-content-page #brs_mainContent > .row:not(.highlighted) > [class*="col-"] {
  padding-top: 0 !important;
}
body.modern-mode .modern-page.is-content-page #brs_mainContent > .grid {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
body.modern-mode .modern-page.is-content-page .modern-content h6 {
  font-size: var(--fs-xl);
  margin: 0 0 12px;
}
body.modern-mode .modern-page.is-content-page .modern-content ol {
  padding-left: 1.4em;
}

/* Contact ---------------------------------------------------------------
   The introductory copy is CMS-managed, but help-contact.php owns the form
   markup. Keep that local form on the same field, label and spacing system as
   sign-in and application pages instead of inheriting Bootstrap's full-width
   legacy controls. */
body.modern-mode .modern-page.is-contact-page #contact_form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 760px;
  margin: 8px 0 0;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-soft);
}
body.modern-mode .modern-page.is-contact-page #contact_form .form-group {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.modern-mode .modern-page.is-contact-page #contact_form label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink) !important;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.35;
}
body.modern-mode .modern-page.is-contact-page #contact_form label span {
  color: var(--muted);
  font-size: inherit !important;
  font-weight: 500;
}
body.modern-mode .modern-page.is-contact-page #contact_form .form-control {
  box-sizing: border-box;
  display: block;
  width: 100% !important;
  max-width: none !important;
  min-height: 48px;
  margin: 0 !important;
  padding: 11px 14px !important;
  color: var(--ink) !important;
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--r) !important;
  box-shadow: none !important;
}
body.modern-mode .modern-page.is-contact-page #contact_form textarea.form-control {
  min-height: 140px;
  resize: vertical;
}
body.modern-mode .modern-page.is-contact-page #contact_form .form-control:hover {
  border-color: var(--muted) !important;
}
body.modern-mode .modern-page.is-contact-page #contact_form .form-control:focus {
  background: #fff !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}
body.modern-mode .modern-page.is-contact-page #response {
  min-height: 0;
  margin: 0 0 12px !important;
  color: var(--success) !important;
  font-size: var(--fs-sm);
}
body.modern-mode .modern-page.is-contact-page #response:empty {
  display: none;
}
body.modern-mode .modern-page.is-contact-page #contact_form #contactSubmit {
  min-width: 118px;
  min-height: 44px;
}

/* Legal destinations use the full modern content card. Their CMS structure
   already supplies short paragraphs and section breaks; the former 920px cap
   left a large, unused white column on desktop. */
body.modern-mode .modern-page.is-legal-page .modern-content #brs_mainContent {
  width: 100%;
  max-width: none;
}
/* CMS images without an authored display width should render at their
   intrinsic size and only shrink when the content column is narrower. This
   prevents low-resolution assets being enlarged and blurred on wide screens.
   Explicit CMS width attributes are preserved. */
body.modern-mode .modern-page.is-content-page .modern-content img:not([width]) {
  width: auto !important;
  max-width: 100% !important;
  height: auto;
}
/* CMS body banners are followed by another full-width content column. The
   compact column reset removes Bootstrap's original 24px top padding from
   that column, so preserve the same deliberate image-to-copy gap here. */
body.modern-mode .modern-page.is-content-page #brs_mainContent .header-wrapper,
body.modern-mode .modern-page.is-content-page #brs_mainContent .header-wrapper-mob {
  margin-bottom: 24px;
}

/* Our People ------------------------------------------------------------
   This retired-from-navigation CMS route remains directly reachable. Its
   legacy carousel positioned the next arrow almost a full column outside the
   video, which forced a 2395px document on a 1440px viewport after the shared
   grid reset. Keep the content and carousel behaviour, but give the route the
   same contained, responsive card treatment as the rest of the redesign. */
body.modern-mode .modern-page.is-people-page #brs_mainContent,
body.modern-mode .modern-page.is-people-profile #brs_mainContent {
  width: 100%;
  max-width: none;
}
body.modern-mode .modern-page.is-people-page #brs_mainContent > .row,
body.modern-mode .modern-page.is-people-profile #brs_mainContent > .row {
  margin-right: 0;
  margin-left: 0;
}
body.modern-mode .modern-page.is-people-page .people-video-main {
  overflow: hidden;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  background: var(--ink);
}
body.modern-mode .modern-page.is-people-page .video-caption {
  color: #fff;
  background: var(--brand-700);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
}
body.modern-mode .modern-page.is-people-page .people-video-main .carousel-control-prev,
body.modern-mode .modern-page.is-people-page .people-video-main .carousel-control-next {
  width: 48px;
}
body.modern-mode .modern-page.is-people-page .people-video-main .carousel-control-prev {
  left: 0;
}
body.modern-mode .modern-page.is-people-page .people-video-main .carousel-control-next {
  right: 0;
}
body.modern-mode .modern-page.is-people-page .people-video-main .carousel-control-prev-icon,
body.modern-mode .modern-page.is-people-page .people-video-main .carousel-control-next-icon {
  filter: brightness(0) invert(1);
}
body.modern-mode .modern-page.is-people-page .people-grid {
  margin-right: 0;
}
body.modern-mode .modern-page.is-people-page .people-grid .item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
body.modern-mode .modern-page.is-people-page .people-grid .item .caption {
  min-height: 0;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface-soft);
  background-image: none;
}
body.modern-mode .modern-page.is-people-page .people-grid .item .title,
body.modern-mode .modern-page.is-people-page .people-grid .item .name {
  color: var(--text);
  overflow-wrap: anywhere;
}
@media (min-width: 1200px) {
  body.modern-mode .modern-page.is-people-page .people-video-main {
    flex: 0 0 58.333333%;
    width: 58.333333%;
    max-width: 58.333333%;
  }
  body.modern-mode .modern-page.is-people-page .video-caption {
    flex: 0 0 41.666667%;
    width: 41.666667%;
    max-width: 41.666667%;
  }
}
@media (max-width: 1199px) {
  body.modern-mode .modern-page.is-people-page .people-video-main,
  body.modern-mode .modern-page.is-people-page .video-caption {
    border-radius: var(--r-lg);
  }
}

/* Six reasons -----------------------------------------------------------
   The CMS supplies each reason as two Bootstrap columns. The general legacy
   grid reset above intentionally flattens columns for ordinary prose pages,
   but here it enlarged 656px images to nearly 1200px and stacked them above
   their copy. Restore the production page's 1142px content measure and its
   original Bootstrap column spacing: 24px beside the image plus 15px inside
   the text column. Images remain below their native width for a crisp result. */
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid {
  width: 100%;
  max-width: 1142px;
  margin-right: auto !important;
  margin-left: auto !important;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 48px;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row > [class*="col-"] {
  flex: 0 0 50%;
  min-width: 0;
  width: 50%;
  max-width: 50%;
  margin-top: 0 !important;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.odd > div:first-child {
  padding: 0 24px 16px 0 !important;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.odd > div:last-child {
  padding: 0 15px 16px !important;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.even > div:first-child {
  padding: 0 0 16px 24px !important;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.even > div:last-child {
  padding: 0 15px 16px !important;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.even > .order-sm-first {
  order: -1;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row img {
  display: block;
  border-radius: var(--r);
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row h2 {
  margin-top: 0;
}
body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > p {
  display: none;
}

@media (max-width: 720px) {
  .modern-page { padding: 24px 18px 52px; }
  .modern-content { padding: 18px 16px; }
  body.modern-mode .modern-content table.legacy-form-table > tbody > tr.legacy-form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 9px 0;
  }
  body.modern-mode .modern-content .legacy-form-label {
    padding-top: 0 !important;
  }
  body.modern-mode .modern-content .legacy-form-unlabelled > td:first-child:empty {
    display: none !important;
  }
  body.modern-mode .modern-content .legacy-form-table input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  body.modern-mode .modern-content .legacy-form-table select,
  body.modern-mode .modern-content .legacy-form-table textarea {
    max-width: none !important;
  }
  body.modern-mode .modern-content .legacy-form-actions .legacy-form-field {
    align-items: stretch;
  }
  body.modern-mode .modern-content .legacy-form-actions input[type="button"],
  body.modern-mode .modern-content .legacy-form-actions input[type="submit"],
  body.modern-mode .modern-content .legacy-form-actions input[type="reset"],
  body.modern-mode .modern-content .legacy-form-actions button {
    width: 100%;
    min-height: 44px;
  }
  body.modern-mode .modern-page.is-auth {
    padding-right: 14px;
    padding-left: 14px;
  }
  body.modern-mode .modern-page.is-auth .modern-content {
    padding: 22px 18px;
  }
  body.modern-mode .modern-content fieldset {
    padding: 16px 14px;
  }
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row {
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
  }
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row > [class*="col-"] {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 0 !important;
  }
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.odd > div:first-child,
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.odd > div:last-child,
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.even > div:first-child,
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row.even > div:last-child {
    padding: 0 !important;
  }
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row > div:first-child {
    order: 0 !important;
  }
  body.modern-mode .modern-page.is-six-reasons #brs_mainContent > .grid > .row > div:last-child {
    order: 1 !important;
  }
  /* Legacy CMS and report tables are built for desktop widths. Let them scroll
     inside the content column instead of forcing the whole page sideways. */
  .modern-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Long unbroken URLs in CMS copy are another common cause of sideways scroll. */
  .modern-content p,
  .modern-content li,
  .modern-content a { overflow-wrap: anywhere; }
}

/* ═══════════════════════════════════════════════════════════════════
   ADVERT DETAIL PAGE  (pageID 160)
   Reproduces the prototype's detail layout: a back band, a sticky action
   bar, and a full-bleed white column for the advert body.

   The action bar's buttons are the LEGACY <input type="button"> nodes,
   relocated here by js/modern-page.js. Each one rewrites its own
   className on hover (applyBtn → applyBtn-hover), so every rule below
   lists BOTH names — styling only the base class would make the button
   lose its appearance the moment the pointer touched it.
   ═══════════════════════════════════════════════════════════════════ */
.modern-page.is-advert {
  /* The band, bar and body run to their own edges, like the prototype. */
  max-width: none;
  padding: 0 0 70px;
}

.detail-band {
  background: linear-gradient(180deg, #FBF5EB 0%, var(--bg) 100%);
  padding: 18px var(--pad-x);
}
.detail-band-inner,
.detail-actions-inner {
  max-width: 920px;
  margin: 0 auto;
}
.detail-actions-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color var(--t-fast), gap var(--t-fast);
}
.detail-back:hover { color: var(--brand); gap: 10px; }
.detail-back:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.detail-actions {
  padding: 14px var(--pad-x);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  /* Sits directly beneath the sticky site header. --header-h is published
     by modern-page.js; the fallback matches the desktop header. */
  position: sticky;
  top: var(--header-h, 104px);
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* The advert body: a white column matching the prototype's measure. */
.modern-page.is-advert .modern-content {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px clamp(20px, 4vw, 48px) 48px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0;
  box-shadow: none;
}

/* The legacy advert template supplies its own Helvetica-based styles after
   this stylesheet. These deliberately more-specific rules map its existing
   content onto the prototype without changing tenant-authored copy. */
.modern-page.is-advert .advert-modern,
.modern-page.is-advert .advert-modern .aBody,
.modern-page.is-advert .advert-modern .aText {
  width: auto;
  margin: 0;
  padding: 0;
}
.modern-page.is-advert .advert-modern .aJobTitle[hidden] { display: none !important; }
.modern-page.is-advert .advert-modern .advert-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1.625rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}
.modern-page.is-advert .advert-modern .detail-meta {
  margin: 0 0 28px;
  padding: 16px 20px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: 2;
}
.modern-page.is-advert .advert-modern .detail-meta b,
.modern-page.is-advert .advert-modern .detail-meta strong {
  color: var(--ink);
  font-weight: 700;
}
.modern-page.is-advert .advert-modern .aText .close-date {
  margin: 18px 0;
  padding: 12px 16px;
  color: var(--brand);
  background: #FFF0EB;
  border: 1px solid #FBC0A8;
  border-radius: var(--r);
  font-size: var(--fs-base);
  font-weight: 600;
}
.modern-page.is-advert .advert-modern .aText .close-date b,
.modern-page.is-advert .advert-modern .aText .close-date strong {
  color: var(--brand);
  font-weight: 800;
}
.modern-page.is-advert .advert-modern .aText .flexibility-statement {
  margin: 22px 0;
  padding: 16px 20px;
  color: var(--text);
  background: var(--surface-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--r);
  font-size: 16px;
  line-height: var(--lh-body);
}
.modern-page.is-advert .advert-modern .aText .flexibility-statement b,
.modern-page.is-advert .advert-modern .aText .flexibility-statement strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: 800;
}
/* The report table is layout-only. Removing its intrinsic sizing lets the
   advert fill the same 920px content column as the prototype. */
.modern-page.is-advert #report > table.advert-layout-table,
.modern-page.is-advert #report > table.advert-layout-table > tbody,
.modern-page.is-advert #report > table.advert-layout-table > tbody > tr,
.modern-page.is-advert #report > table.advert-layout-table > tbody > tr > td {
  display: block;
  width: 100%;
}

/* ── Relocated legacy action buttons ─────────────────────────────── */
body.modern-mode .modern-page.is-advert .detail-actions input[type="button"],
body.modern-mode .modern-page.is-advert .detail-actions button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px !important;
  font-family: 'South Australia Sans', Arial, Helvetica, sans-serif !important;
  font-size: var(--fs-base) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -0.1px !important;
  text-transform: none !important;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast),
              background var(--t-fast), transform var(--t-fast);
}
body.modern-mode .modern-page.is-advert .detail-actions input[type="button"]:hover,
body.modern-mode .modern-page.is-advert .detail-actions button:hover {
  border-color: var(--ink) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  transform: translateY(-1px);
}
body.modern-mode .modern-page.is-advert .detail-actions input[type="button"]:focus-visible,
body.modern-mode .modern-page.is-advert .detail-actions button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Apply is the primary action. data-primary is set by modern-page.js and —
   unlike a class — survives the button rewriting its own className.

   The selector MUST name the element type as well as the attribute.
   An attribute selector scores the same as a class, so the obvious
   `.detail-actions [data-primary]` is (0,2,0) and LOSES to the base rule
   `.detail-actions input[type="button"]` at (0,2,1) — the type selector
   is the tie-breaker. The primary button then rendered identically to the
   secondary ones at rest and only turned brand on :hover, because the
   base :hover rule happens not to set a background.

   Verified in Chrome: resting background was rgb(255,255,255) with
   rgb(42,36,30) text before this rule; see browser-verify.js section I,
   which now asserts the resting appearance rather than only the hover. */
body.modern-mode .modern-page.is-advert .detail-actions input[type="button"][data-primary],
body.modern-mode .modern-page.is-advert .detail-actions input[type="submit"][data-primary],
body.modern-mode .modern-page.is-advert .detail-actions button[data-primary],
body.modern-mode .modern-page.is-advert .detail-actions [data-primary] {
  background: var(--brand) !important;
  color: #fff !important;
  border-color: var(--brand) !important;
  box-shadow: 0 8px 20px -10px rgba(225, 84, 62, 0.55);
}
body.modern-mode .modern-page.is-advert .detail-actions input[type="button"][data-primary]:hover,
body.modern-mode .modern-page.is-advert .detail-actions input[type="submit"][data-primary]:hover,
body.modern-mode .modern-page.is-advert .detail-actions button[data-primary]:hover,
body.modern-mode .modern-page.is-advert .detail-actions [data-primary]:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #000 !important;
}

/* Apply page: just the prototype's "Back to job" link above the card. The
   page keeps the standard shell width, so the band is flush, not full-bleed. */
.modern-page.is-apply .detail-band {
  background: none;
  padding: 0 0 14px;
}

@media (max-width: 720px) {
  .modern-page.is-advert .modern-content {
    padding: 22px 16px 32px;
    border-left: 0;
    border-right: 0;
  }
  .detail-actions { padding: 12px 16px; }
  .detail-band { padding: 14px 16px; }
  /* Four pills wrap awkwardly on narrow screens; let them share the row. */
  .detail-actions input[type="button"],
  .detail-actions button { flex: 1 1 auto; }
  .modern-page.is-advert .advert-modern .detail-meta { padding: 14px 16px; }
}

/* The action bar sticks; honour users who don't want motion-linked UI. */
@media (prefers-reduced-motion: reduce) {
  .detail-actions input[type="button"]:hover,
  .detail-actions button:hover { transform: none; }
  .detail-back:hover { gap: 6px; }
}



/* ======================================================================
   APPLY PAGE - PROTOTYPE LAYOUT  (pageID 268 and the later steps)

   modern-page.js rewrites the server's <table class="Form"> into the
   prototype's .apply-header + .apply-layout + .form-section structure.
   These rules style that result.

   The legacy-table fallback at the end of this section covers the no-JS
   case, where the server's original markup is left exactly as rendered.
   ====================================================================== */
/* Later application steps use tenant-configured page IDs, so PHP cannot
   suppress the CMS banner from an allow-list. modern-page.js adds this
   class only when the server's real #steps control is present. */
body.modern-mode.application-wizard .modern-banner { display: none !important; }

body.modern-mode .apply-header {
  /*background: linear-gradient(180deg, #F0BEC3 0%, var(--bg) 100%);*/
  padding: 28px var(--pad-x) 0;
  border-bottom: 1px solid var(--border);
}
body.modern-mode .apply-header-inner {
  /* .modern-page caps at --shell then pads by --pad-x, so the band's
     inner box must subtract that padding or the heading sits --pad-x
     to the left of the form below it. */
  max-width: calc(var(--shell) - var(--pad-x) * 2);
  margin: 0 auto;
}

/* The server's own progress bar and "step 1 of 4" caption are replaced by
   .stepper. The transform sets [hidden] on them, but the server emits its
   #steps rules inline in the body - after this stylesheet - so the hidden
   attribute needs defending or the floated bar keeps its box and leaves a
   gap at the top of the form. */
body.modern-mode #steps[hidden],
body.modern-mode #brsStepCount[hidden] { display: none !important; }
body.modern-mode .apply-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  padding: 6px 0;
  margin-bottom: 18px;
  transition: color var(--t-fast), gap var(--t-fast);
}
body.modern-mode .apply-back-link:hover { color: var(--brand); gap: 10px; }

body.modern-mode .apply-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
body.modern-mode .apply-title-row h1 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin: 0 0 8px;
}
body.modern-mode .apply-title-row .meta {
  font-size: var(--fs-sm);
  color: var(--muted);
}
body.modern-mode .apply-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
body.modern-mode .apply-status .dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Stepper -------------------------------------------------------- */
body.modern-mode .stepper {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 5px 5px 21px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
body.modern-mode .stepper .step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
body.modern-mode .stepper .circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
body.modern-mode .stepper .label {
  font-size: var(--fs-sm);
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  max-width: min(34vw, 360px);
  line-height: 1.35;
}
body.modern-mode .stepper .step.is-active .circle {
  background: var(--muted); /* spec: Active Page Indicator, #6E665E background */
  border-color: var(--muted);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(110,102,94,0.16);
}
body.modern-mode .stepper .step.is-done .circle {
  background: var(--surface);
  border-color: var(--muted);
  color: var(--muted);
}
body.modern-mode .stepper .step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  min-width: 24px;
}
body.modern-mode .stepper .step.is-done + .step-line { background: var(--brand); }
/* With six or more server-configured steps, reserve the horizontal space
   for the complete sequence. The current page remains named by the h1,
   sidebar progress list and the stepper's accessible label. */
body.modern-mode .stepper.has-many-steps .label { display: none; }
body.modern-mode .stepper.has-many-steps .step-line {
  min-width: 8px;
  margin-inline: 7px;
}
/* ---- Two-column layout + sidebar ------------------------------------
   The prototype floats form cards on the page background rather than
   inside one large white panel. .apply-modern and .apply-passthrough are
   set by modern-page.js only after the transform has succeeded, so the
   card chrome is dropped exactly when there is a new layout to replace
   it; if the transform bails out the legacy card remains.

   display:contents removes the wrapper's box - background, border,
   padding and all - without removing the element, so #report and any
   other legacy wrapper keep their ids and stay findable by the server's
   own scripts. */
body.modern-mode .modern-page.apply-modern { padding-top: 28px; }
body.modern-mode .modern-page.apply-modern .apply-passthrough {
  display: contents !important;
}
/* Belt and braces for any wrapper that cannot be display:contents.
   Matched by descendant rather than child combinator: the renderer nests
   #report at different depths depending on the step, so a > chain here
   silently stops matching and the panel comes back. */
body.modern-mode .modern-page.apply-modern .apply-passthrough,
body.modern-mode .modern-page.apply-modern .modern-content,
body.modern-mode .modern-page.apply-modern #report {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body.modern-mode .modern-content .apply-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  /* modern.css carries the prototype's standalone .apply-layout rule,
     which caps itself at 1200px and centres. Inside .modern-page that
     cap applies on top of the shell's own max-width and padding, so the
     form ends up inset from the header band above it. The band and the
     layout must share one set of edges. */
  max-width: none;
  margin: 0;
}
body.modern-mode .modern-content .apply-main { min-width: 0; }

/* ── Confirmation (terminal) step ──────────────────────────────────
   No sidebar: the application is already submitted, so there is nothing
   left to summarise or save. A single centred column keeps the receipt
   as the only thing on the page. */
body.modern-mode .modern-content .apply-layout.is-confirm {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
body.modern-mode .modern-content .apply-layout.is-confirm .apply-main {
  width: 100%;
  max-width: 760px;
}
body.modern-mode .modern-content .confirm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: 0 18px 44px -32px rgba(21, 17, 14, .45);
  text-align: center;
}
body.modern-mode .modern-content .confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--success);
  box-shadow: 0 0 0 8px rgba(47, 122, 79, .12);
}
body.modern-mode .modern-content .confirm-icon svg { width: 30px; height: 30px; }

body.modern-mode .modern-content .confirm-body {
  color: var(--text);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  text-align: left;
}
body.modern-mode .modern-content .confirm-body p { margin: 0 0 14px; }
body.modern-mode .modern-content .confirm-body p:last-of-type { margin-bottom: 0; }
body.modern-mode .modern-content .confirm-body a:not(.confirm-action) {
  color: var(--brand);
  text-decoration: underline;
}

/* The attachment caption and list sit in their own panel so the
   filenames read as data rather than as more prose. */
body.modern-mode .modern-content .confirm-files-caption,
body.modern-mode .modern-content .confirm-files-empty {
  display: block;
  margin-top: 26px;
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
body.modern-mode .modern-content .confirm-files {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
body.modern-mode .modern-content .confirm-files li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: var(--fs-base);
  word-break: break-word;
}
body.modern-mode .modern-content .confirm-file-icon {
  flex: none;
  display: flex;
  color: var(--muted);
}
body.modern-mode .modern-content .confirm-file-icon svg { width: 17px; height: 17px; }

body.modern-mode .modern-content .confirm-actions {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
body.modern-mode .modern-content a.confirm-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--t-fast), transform var(--t-fast);
}
body.modern-mode .modern-content a.confirm-action:hover {
  color: #000;
  background: var(--brand-600);
  transform: translateY(-1px);
}
body.modern-mode .modern-content a.confirm-action:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* The form and the column that holds it are pure layout here - the
   prototype's white panels are the .form-section cards inside them, not
   the container. Anything the legacy stylesheets painted on the form
   itself has to go, or it reads as one large card behind the sections. */
body.modern-mode .modern-page.apply-modern .apply-main,
body.modern-mode .modern-page.apply-modern .apply-main > form,
body.modern-mode .modern-page.apply-modern form[name="mainForm"] {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Legacy table markup salvaged into the new field cells keeps whatever
   the old stylesheets painted on it (table.Form and its cells carry a
   panel background). Inside a .form-section card that reads as a second
   nested panel, so it is flattened. The .Report tables are left alone -
   they are styled deliberately elsewhere. */
body.modern-mode .modern-page.apply-modern .form-section table:not(.Report),
body.modern-mode .modern-page.apply-modern .form-section table:not(.Report) > tbody > tr,
body.modern-mode .modern-page.apply-modern .form-section table:not(.Report) > tbody > tr > td {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.modern-mode .modern-content .apply-aside {
  position: sticky;
  top: calc(var(--header-h, 104px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.modern-mode .modern-content .apply-aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
}
body.modern-mode .modern-content .apply-aside-card h3 {
  font-size: var(--fs-base);
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
body.modern-mode .modern-content .apply-aside-card .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  gap: 12px;
}
body.modern-mode .modern-content .apply-aside-card .row .lbl {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
body.modern-mode .modern-content .apply-aside-card .row .val {
  font-size: var(--fs-sm);
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}
body.modern-mode .modern-content .apply-aside-card .aside-position {
  font-weight: 700;
  color: var(--ink);
  font-size: var(--fs-sm);
  margin: 2px 0 10px;
  line-height: 1.35;
}

body.modern-mode .modern-content .progress-list {
  font-size: var(--fs-sm);
  line-height: 2;
  color: var(--muted);
}
body.modern-mode .modern-content .progress-list .pl-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.modern-mode .modern-content .progress-list .pl-row::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}
body.modern-mode .modern-content .progress-list .pl-row.active {
  color: var(--ink);
  font-weight: 600;
}
body.modern-mode .modern-content .progress-list .pl-row.active::before { background: var(--brand); }
body.modern-mode .modern-content .progress-list .pl-row.done::before { background: var(--brand-200); }

body.modern-mode .modern-content .progress-note {
  background: var(--surface-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--r);
  padding: 16px 20px;
  font-size: var(--fs-base);
  color: var(--text);
  line-height: var(--lh-body);
}
body.modern-mode .modern-content .progress-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: 800;
}

body.modern-mode .modern-content .apply-legend {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 14px;
}
body.modern-mode .modern-content .apply-legend .requiredField {
  color: var(--brand);
  font-weight: 800;
}
/* ---- Form section cards --------------------------------------------- */
body.modern-mode .modern-content .form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 28px 28px;
  margin-bottom: 14px;
}
body.modern-mode .modern-content .form-section .section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
body.modern-mode .modern-content .form-section .section-head h2 {
  font-size: var(--fs-base);
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}
/* The small "Tell us about yourself" / "Where we can reach you" line that
   sits beside each of the prototype's three section headings. */
body.modern-mode .modern-content .form-section .section-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Two-up grid; labels sit above their control, as in the prototype. */
body.modern-mode .modern-content .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
body.modern-mode .modern-content .form-grid .field { min-width: 0; }
body.modern-mode .modern-content .form-grid .field.full-width { grid-column: 1 / -1; }

/* A row whose control cell turned out to be empty (hidden inputs, stray
   markup) must not reserve a grid cell. display:contents keeps any
   salvaged children in the DOM without painting a box. */
body.modern-mode .modern-content .form-grid .field.is-empty { display: contents; }

/* A lone checkbox/radio row (e.g. "My suburb/post code is not listed")
   sits beside its own label, prototype-style, instead of stacked above
   it like every other control. */
body.modern-mode .modern-content .field.inline-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
body.modern-mode .modern-content .field.inline-check > label {
  margin: 0 0 0 0;
  font-size: var(--fs-base);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

body.modern-mode .modern-content .field > label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 7px;
  line-height: 1.35;
}
/* The transform marks required labels with <span class="req">*</span>. */
body.modern-mode .modern-content .field label .req {
  color: var(--brand);
  font-weight: 800;
  margin-left: 3px;
}
/* Controls are moved straight out of the table cell, so the server's
   single-control wrapper tables end up as direct children of .field. */
body.modern-mode .modern-content .field > table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
}
body.modern-mode .modern-content .field > table td {
  padding: 0;
  border: 0;
  vertical-align: middle;
}

/* Controls */
body.modern-mode .modern-content .field input[type="text"],
body.modern-mode .modern-content .field input[type="email"],
body.modern-mode .modern-content .field input[type="tel"],
body.modern-mode .modern-content .field input[type="number"],
body.modern-mode .modern-content .field input[type="password"],
body.modern-mode .modern-content .field input[type="date"],
body.modern-mode .modern-content .field select,
body.modern-mode .modern-content .field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
body.modern-mode .modern-content .field textarea { min-height: 120px; resize: vertical; }

/* Legacy application fields can carry Bootstrap's .form-control class,
   whose fixed 35px height and square !important radius otherwise win. */
body.modern-mode .modern-content .field input.form-control,
body.modern-mode .modern-content .field select.form-control,
body.modern-mode .modern-content .field textarea.form-control {
  height: auto;
  min-height: 44px;
  border-radius: var(--r) !important;
}

/* The application's State field is server-rendered with Bootstrap's
   `class="form-control custom-select"` (Applicant_f.inc's cmbStateID). Two
   collisions follow, and both are fixed here in CSS rather than by changing
   the server markup, which other boards also render:

   1. Bootstrap pins `height: calc(1.5em + .75rem + 2px)` ≈ 35px, but the
      control above asks for 11px padding + a 21px line box ≈ 45px. The fixed
      height won, so the selected value was vertically clipped — the reported
      bug. `height: auto` lets the padding size the box, matching every other
      dropdown on the page.
   2. Bootstrap also sets `appearance: none` to swap in its own SVG arrow,
      which our `background` shorthand then removes — leaving the field with
      no dropdown indicator at all. Restoring `appearance: auto` brings back
      the native arrow, so State looks identical to Country beside it.

   Scoped to selects that actually carry those classes so no other control is
   affected, and it stays inert if the markup ever drops them. */
body.modern-mode .modern-content .field select.custom-select,
body.modern-mode .modern-content .field select.form-control,
body.modern-mode .modern-content select.custom-select,
body.modern-mode .modern-content select.form-control {
  height: auto;
  min-height: 44px;
  line-height: 1.5;
  -webkit-appearance: auto;
  appearance: auto;
}
body.modern-mode .modern-content .field input:focus,
body.modern-mode .modern-content .field select:focus,
body.modern-mode .modern-content .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
body.modern-mode .modern-content .field input[type="checkbox"],
body.modern-mode .modern-content .field input[type="radio"] {
  width: auto;
  margin-right: 6px;
  accent-color: var(--brand);
}

/* ---- Declaration and final-review steps ----------------------------- */
body.modern-mode .modern-content .wizard-review-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 34px rgba(42, 36, 30, 0.06);
}
body.modern-mode .modern-content .wizard-review-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #F0BEC3, #fff 50%);
  border-bottom: 1px solid var(--border);
}
body.modern-mode .modern-content .wizard-review-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--brand-200);
  border-radius: 12px;
}
body.modern-mode .modern-content .wizard-review-icon svg {
  width: 24px;
  height: 24px;
}
body.modern-mode .modern-content .wizard-review-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
body.modern-mode .modern-content .wizard-review-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.35px;
}
body.modern-mode .modern-content .wizard-review-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
body.modern-mode .modern-content .wizard-review-body {
  padding: 26px 28px 30px;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.65;
}
body.modern-mode .modern-content .wizard-review-body p {
  max-width: 76ch;
  margin: 0 0 16px;
}
/* Legacy declaration templates use repeated <br> elements for vertical
   spacing. Keep their sequence but cap each break so the modern card does
   not inherit large empty bands between the checkbox and review notes. */
body.modern-mode .modern-content .wizard-review-body > br {
  display: block;
  content: '';
  margin-top: 6px;
}
body.modern-mode .modern-content .wizard-review-body strong,
body.modern-mode .modern-content .wizard-review-body b {
  color: var(--ink);
  font-weight: 750;
}
body.modern-mode .modern-content .wizard-review-body a {
  color: var(--brand);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
body.modern-mode .modern-content .wizard-review-body ul,
body.modern-mode .modern-content .wizard-review-body ol {
  margin: 10px 0 20px;
  padding-left: 24px;
}
body.modern-mode .modern-content .wizard-review-body li { margin: 6px 0; }
body.modern-mode .modern-content .wizard-review-confirmation {
  display: block;
  margin: 20px 0 24px;
  padding: 16px 18px !important;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--r);
  color: var(--ink);
  font-weight: 650;
  line-height: 1.5;
}
body.modern-mode .modern-content .wizard-review-confirmation input[type="checkbox"],
body.modern-mode .modern-content .wizard-review-confirmation input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0 10px 0 0;
  vertical-align: -4px;
  accent-color: var(--brand);
}
body.modern-mode .modern-content .wizard-review-body table {
  width: 100%;
  margin: 16px 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
body.modern-mode .modern-content .wizard-review-body th,
body.modern-mode .modern-content .wizard-review-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
body.modern-mode .modern-content .wizard-review-body tr:last-child > * {
  border-bottom: 0;
}

/* ---- Action bar ------------------------------------------------------ */
body.modern-mode .modern-content .apply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  /* The prototype's .form-actions is a card, not a bare strip. */
  margin-top: 22px;
  margin-bottom: 40px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
body.modern-mode .modern-content .apply-actions .actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
  /* With no Back button the pair must still sit right, which
     space-between alone would not do for a single child. */
  margin-left: auto;
}
body.modern-mode .modern-content .apply-actions br { display: none; }
body.modern-mode .modern-content .apply-actions input[type="button"],
body.modern-mode .modern-content .apply-actions input[type="submit"],
body.modern-mode .modern-content .apply-actions button {
  min-height: 44px;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.1px;
  padding: 11px 22px !important;
  border-radius: 999px !important;
  /* !important throughout: the generic button rule earlier in this file
     also uses !important, so without it these would lose and every
     action would render as a filled brand pill. */
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast);
}
body.modern-mode .modern-content .apply-actions input[type="button"]:hover,
body.modern-mode .modern-content .apply-actions input[type="submit"]:hover,
body.modern-mode .modern-content .apply-actions button:hover {
  background: var(--brand-50) !important;
  border-color: var(--brand) !important;
  color: var(--brand) !important;
}
/* The compound input[type=...] forms are required, not redundant: the
   base rule above matches input[type="button"], which scores one element
   higher than a bare class, so `.btn-next` alone would lose to it. */
body.modern-mode .modern-content .apply-actions #BtnNext,
body.modern-mode .modern-content .apply-actions .btn-next,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-next,
body.modern-mode .modern-content .apply-actions input[type="submit"].btn-next {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}
body.modern-mode .modern-content .apply-actions #BtnNext:hover,
body.modern-mode .modern-content .apply-actions .btn-next:hover,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-next:hover,
body.modern-mode .modern-content .apply-actions input[type="submit"].btn-next:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #000 !important;
}
body.modern-mode .modern-content .apply-actions .btn-back-step,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-back-step {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
}
body.modern-mode .modern-content .apply-actions .btn-back-step:hover,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-back-step:hover {
  border-color: var(--ink) !important;
  color: var(--ink) !important;
  background: var(--surface) !important;
}

/* The prototype pairs these labels with directional arrows. An
   <input type="button"> can hold neither child elements nor generated
   content, and the server renders inputs - so the arrow is drawn as a
   background image rather than by replacing the element, which would mean
   rebuilding the control that carries the whole save handler.

   These selector lists deliberately MIRROR the colour rules above,
   including #BtnNext. That is not redundancy: the colour rules set the
   `background` shorthand with !important, which resets background-image,
   and an id scores (1,3,1) - higher than any class/attribute combination.
   Matching the lists makes each pair tie on specificity, so these later
   declarations win. Drop #BtnNext here and the arrow silently vanishes on
   the one button that actually has that id. The :hover variants are
   repeated for the same reason. */
body.modern-mode .modern-content .apply-actions #BtnNext,
body.modern-mode .modern-content .apply-actions .btn-next,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-next,
body.modern-mode .modern-content .apply-actions input[type="submit"].btn-next,
body.modern-mode .modern-content .apply-actions #BtnNext:hover,
body.modern-mode .modern-content .apply-actions .btn-next:hover,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-next:hover,
body.modern-mode .modern-content .apply-actions input[type="submit"].btn-next:hover {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 18px center !important;
  padding-right: 44px !important;
}
body.modern-mode .modern-content .apply-actions .btn-back-step,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-back-step {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E665E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 18px center !important;
  padding-left: 44px !important;
}
body.modern-mode .modern-content .apply-actions .btn-back-step:hover,
body.modern-mode .modern-content .apply-actions input[type="button"].btn-back-step:hover {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2315110E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 18px center !important;
}

/* Keyboard focus ring for the action buttons.

   This has to be stated here, at this specificity and with !important,
   because of a cascade collision that is not obvious:

     body.modern-mode .modern-content .field input:focus   -> (0,4,2)
     .modern-content input[type="button"]:focus-visible    -> (0,3,1)

   The first is the TEXT-FIELD focus treatment, which deliberately trades
   the outline for a box-shadow ring. It also matches these buttons,
   because they are <input> elements sitting inside the transformed form,
   and at (0,4,2) it beats the generic focus-visible rule - so the
   buttons were left with `outline: none` and no ring of any kind.

   A box-shadow cannot be used to restore it either: the .apply-actions
   button rule above sets `box-shadow: none !important`.

   Verified in Chrome by tabbing to each button and reading the computed
   style - see browser-verify.js, section D. A keyboard or switch user
   would otherwise have no idea which of Previous/Save/Continue they were
   about to activate: WCAG 2.4.7 (Focus Visible).

   outline-offset puts the ring just outside the pill, on the white card
   rather than on the filled brand background, so it stays clearly
   visible on the solid Continue button as well as the outlined ones. */
body.modern-mode .modern-content .apply-actions input[type="button"]:focus-visible,
body.modern-mode .modern-content .apply-actions input[type="submit"]:focus-visible,
body.modern-mode .modern-content .apply-actions input[type="reset"]:focus-visible,
body.modern-mode .modern-content .apply-actions button:focus-visible,
body.modern-mode .modern-content .apply-actions .btn:focus-visible {
  outline: 3px solid var(--ink, #15110E) !important;
  outline-offset: 2px !important;
}

/* The same collision applies to every other button inside the transformed
   content (the advert page's actions, any in-form buttons), so restate it
   there too rather than leaving the defect to resurface elsewhere. */
body.modern-mode .modern-content input[type="button"]:focus-visible,
body.modern-mode .modern-content input[type="submit"]:focus-visible,
body.modern-mode .modern-content input[type="reset"]:focus-visible,
body.modern-mode .modern-content button:focus-visible {
  outline: 3px solid var(--ink, #15110E) !important;
  outline-offset: 2px !important;
}

/* The advert band belongs to the detail page only; when the apply header
   is present it must not also render. */
body.modern-mode .apply-header + .modern-page .detail-band { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   APPLICATION HISTORY — pages 187 (current) and 257 (past)
   The legacy form remains authoritative. modern-page.js adds these hooks
   to its existing filter links, fieldsets, status controls and Save action.
   ═══════════════════════════════════════════════════════════════════ */
body.modern-mode.current-applications-page .modern-page.is-applications,
body.modern-mode.past-applications-page .modern-page.is-applications {
  padding-top: clamp(28px, 4vw, 48px);
}
body.modern-mode .modern-page.is-applications .modern-content {
  padding: clamp(24px, 4vw, 48px);
}
body.modern-mode .applications-modern form.GPUAcc {
  width: 100%;
  max-width: none;
  margin: 0;
}
body.modern-mode .applications-modern form.GPUAcc > br {
  display: none;
}

.applications-header {
  position: relative;
  margin: 0 0 24px;
  padding: 0 180px 24px 0;
  border-bottom: 1px solid var(--border);
}
.applications-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.modern-content .applications-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
}
.applications-header > p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
}
.applications-summary {
  position: absolute;
  top: 2px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 14px;
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  background: #F0BEC3;
  color: var(--brand-700);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}
.applications-summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-sm);
}

.applications-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.applications-filter-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 10px;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
}
.applications-filter a.applications-filter-item:hover {
  background: var(--surface);
  color: var(--brand);
}
.applications-filter a.applications-filter-item:visited {
  color: var(--text);
}
.applications-filter-item[aria-current="page"] {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh-1);
}

.applications-list {
  display: grid;
  gap: 16px;
}
body.modern-mode .applications-modern .application-record {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border) !important;
  border-left: 4px solid var(--brand) !important;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
body.modern-mode .applications-modern .application-record:hover {
  border-color: var(--border-strong) !important;
  border-left-color: var(--brand) !important;
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
}
body.modern-mode .applications-modern .application-record > table {
  display: table;
  width: 100% !important;
  max-width: none;
  margin: 0;
  border: 0;
  overflow: visible;
}
body.modern-mode .applications-modern .application-record > table > tbody {
  display: table-row-group;
}
body.modern-mode .applications-modern .application-record > table > tbody > tr {
  display: table-row;
}
body.modern-mode .applications-modern .application-record > table > tbody > tr > td {
  display: table-cell;
  border: 0;
}
.application-record-head > td {
  padding: 22px 24px 16px !important;
  vertical-align: top;
}
.application-record-title {
  width: auto !important;
}
.application-record-title strong {
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.35;
}
.application-record-title a {
  color: var(--ink) !important;
  text-decoration: none !important;
}
.application-record-title a:visited {
  color: var(--ink) !important;
}
.application-record-title a:hover {
  color: var(--brand) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.application-record-updated {
  width: 210px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}
.application-record-status > td {
  padding: 15px 24px 20px !important;
  border-top: 1px solid var(--border) !important;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.application-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 12px 0 5px;
  padding: 4px 10px;
  border: 1px solid #e7c76a;
  border-radius: 999px;
  background: #fff8df;
  color: #6b4d00;
  font-size: var(--fs-xs);
  font-weight: 800;
}
.application-record[data-status="submitted"] .application-status,
.application-record[data-status="application-submitted"] .application-status,
.application-record[data-status="complete"] .application-status,
.application-record[data-status="completed"] .application-status {
  border-color: #b7dfc6;
  background: #eaf6ef;
  color: var(--success);
}
.application-record-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 6px 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff !important;
  font-size: var(--fs-xs);
  font-weight: 800;
  text-decoration: none !important;
}
body.modern-mode .modern-content a.application-record-action.btn,
body.modern-mode .modern-content a.application-record-action.btn:visited,
body.modern-mode .modern-content a.application-record-action.btn:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: var(--brand-700) !important;
}
.application-record select {
  width: auto;
  max-width: 100%;
  min-height: 42px;
  margin: 6px 8px;
}
.application-record .appointment-tr > td {
  min-width: 0;
  padding: 12px 24px !important;
}
.applications-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
body.modern-mode .applications-save {
  min-height: 44px;
  padding: 10px 22px !important;
  border: 1px solid var(--brand) !important;
  border-radius: 999px !important;
  background: var(--brand) !important;
  color: #fff !important;
  font-family: inherit;
  font-size: var(--fs-sm) !important;
  font-weight: 800 !important;
}
body.modern-mode .applications-save:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  color: #000 !important;
}

@media (max-width: 720px) {
  body.modern-mode .modern-page.is-applications .modern-content {
    padding: 22px 16px;
  }
  .applications-header {
    padding-right: 0;
  }
  .applications-summary {
    position: static;
    width: fit-content;
    margin-top: 18px;
  }
  .applications-filter {
    align-items: stretch;
    flex-direction: column;
  }
  .applications-filter-item {
    width: 100%;
  }
  body.modern-mode .applications-modern .application-record > table,
  body.modern-mode .applications-modern .application-record > table > tbody,
  body.modern-mode .applications-modern .application-record > table > tbody > tr,
  body.modern-mode .applications-modern .application-record > table > tbody > tr > td {
    display: block;
    width: 100% !important;
  }
  .application-record-head > td {
    padding: 18px 18px 0 !important;
  }
  .application-record-head > .application-record-updated {
    padding: 8px 18px 16px !important;
    text-align: left;
    white-space: normal;
  }
  .application-record-status > td {
    padding: 14px 18px 18px !important;
  }
  .application-status {
    margin-left: 4px;
  }
  .application-record-action {
    display: flex;
    width: 100%;
    margin-top: 12px;
  }
  .application-record .appointment-tr > td {
    padding: 10px 18px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   ACCOUNT PAGES — details, alerts, attachments and administration
   Values remain in the original server-rendered controls. These rules
   only style the page-specific hooks added by modern-page.js.
   ═══════════════════════════════════════════════════════════════════ */
body.modern-mode.modern-account-page .modern-page.is-account {
  padding-top: clamp(28px, 4vw, 48px);
}
body.modern-mode .modern-page.is-account .modern-content {
  padding: clamp(24px, 4vw, 48px);
}
body.modern-mode .account-modern #report {
  width: 100%;
}
.account-page-header {
  position: relative;
  margin: 0 0 28px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
}
.account-page-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.modern-content .account-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
}
.account-page-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
}
.account-duplicate-heading {
  display: none !important;
}

/* Presentation-only rows of the legacy account tab strip: the tab cells, the
   rules around them and the duplicated page title. */
.account-legacy-tab-row {
  display: none !important;
}

body.modern-mode .account-form {
  width: 100%;
  max-width: none;
  margin: 0;
}
body.modern-mode .account-form + .account-form {
  margin-top: 22px;
}
body.modern-mode .account-form .form-section,
body.modern-mode .account-form-table,
body.modern-mode .account-attachment-card {
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 18px;
  border: 1px solid var(--border) !important;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--sh-1);
}
body.modern-mode .account-form-table {
  overflow: hidden;
}
body.modern-mode .account-form-table > tbody > tr > td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
body.modern-mode .account-form-table > tbody > tr:last-child > td {
  border-bottom: 0;
}
body.modern-mode .account-form-table .head,
body.modern-mode .account-form-table .headTop,
body.modern-mode .account-form-table .FormLabel,
body.modern-mode .account-form-table .requiredFieldHead {
  width: 34%;
  color: var(--ink);
  background: var(--surface-soft) !important;
  font-size: var(--fs-sm);
  font-weight: 750;
}
body.modern-mode .account-form-table input[type="text"],
body.modern-mode .account-form-table input[type="password"],
body.modern-mode .account-form-table input[type="email"],
body.modern-mode .account-form-table input[type="tel"],
body.modern-mode .account-form-table select,
body.modern-mode .account-form-table textarea {
  width: 100%;
  max-width: 680px;
}

/* My Details uses the same Personal / Address / Contact cards as application
   Step 1. The original BRSFormItem rows and controls remain intact. */
body.modern-mode .account-details .account-details-section {
  margin-bottom: 14px;
}
body.modern-mode .account-details .account-details-section .section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
body.modern-mode .account-details .account-details-section .section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
body.modern-mode .account-details .account-details-section .section-sub {
  color: var(--muted);
  font-size: var(--fs-sm);
}
body.modern-mode .account-details .account-details-grid {
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
body.modern-mode .account-details .account-details-grid > tbody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
body.modern-mode .account-details .account-details-grid > tbody > tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  padding: 0;
  border: 0;
}
body.modern-mode .account-details .account-details-grid > tbody > tr > td {
  display: block;
  width: 100% !important;
  padding: 0;
  border: 0;
  background: transparent !important;
}
body.modern-mode .account-details .account-details-grid > tbody > tr > td:first-child {
  margin-bottom: 7px;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: .7px;
  line-height: 1.35;
  text-transform: uppercase;
}
body.modern-mode .account-details .account-form-table input:not([type="checkbox"]):not([type="radio"]),
body.modern-mode .account-details .account-form-table select,
body.modern-mode .account-details .account-form-table textarea {
  width: 100%;
  max-width: none;
}

/* Alert criteria keep the legacy table relationships used by
   searchFormJobAlert.js, but present as calm, borderless sections. */
body.modern-mode .account-alerts .job-alert-form {
  position: relative;
}
body.modern-mode .account-alerts .job-alert-section {
  margin: 0 0 28px;
  padding: 0;
}
body.modern-mode .account-alerts .job-alert-section-head {
  margin-bottom: 20px;
}
body.modern-mode .account-alerts .job-alert-section-head h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -.02em;
}
body.modern-mode .account-alerts .job-alert-section-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
body.modern-mode .account-alerts .job-alert-form .Form {
  display: table;
  overflow: visible;
  width: 100% !important;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-content: start;
  width: auto !important;
  float: none !important;
  padding: 0;
  border: 0;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr.job-alert-keywords {
  grid-column: 1 / -1;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr.job-alert-empty {
  display: none !important;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr > td {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr > td.head,
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr > td.headTop {
  display: block !important;
  margin-bottom: 8px !important;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr.job-alert-keywords > td.head,
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr.job-alert-keywords > td.headTop {
  font-size: 0;
}
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr.job-alert-keywords > td.head::after,
body.modern-mode .account-alerts .job-alert-form .Form > tbody > tr.job-alert-keywords > td.headTop::after {
  content: 'Keywords';
  font-size: var(--fs-sm);
}
body.modern-mode .account-alerts .job-alert-form .Form input:not([type="checkbox"]):not([type="radio"]),
body.modern-mode .account-alerts .job-alert-form .Form select,
body.modern-mode .account-alerts .job-alert-form .ms-parent {
  width: 100% !important;
  max-width: none !important;
  min-height: 44px;
}
body.modern-mode .account-alerts .job-alert-form .Form input:not([type="checkbox"]):not([type="radio"]),
body.modern-mode .account-alerts .job-alert-form .Form select,
body.modern-mode .account-alerts .job-alert-form .Form .ms-choice {
  height: 46px !important;
  padding: 0 14px !important;
  color: var(--ink) !important;
  font-family: inherit;
  font-size: var(--fs-base) !important;
  font-weight: 500 !important;
  line-height: 44px !important;
  text-transform: none !important;
  background: #f8f6f2 !important;
  border: 1px solid transparent !important;
  border-radius: var(--r) !important;
  box-shadow: none !important;
}
body.modern-mode .account-alerts .job-alert-form .Form input:not([type="checkbox"]):not([type="radio"]):hover,
body.modern-mode .account-alerts .job-alert-form .Form select:hover,
body.modern-mode .account-alerts .job-alert-form .Form .ms-choice:hover {
  background: #f3f0eb !important;
}
/* The component absolutely positions this span against .ms-parent, so the
   button's own padding never applies to it. Inset it explicitly so the
   selected value lines up with the text in the plain inputs beside it
   (1px border + 14px padding), clears the arrow, and sits on the same
   optical centre line as the 46px control. */
body.modern-mode .account-alerts .job-alert-form .Form .ms-choice > span {
  top: 0;
  right: 34px;
  left: 15px;
  padding-left: 0;
  color: var(--ink);
  line-height: 46px;
}
body.modern-mode .account-alerts .job-alert-form .Form .ms-choice > div {
  position: absolute !important;
  float: none !important;
  top: 10px;
  right: 8px;
}
body.modern-mode .account-alerts .job-alert-form .ms-drop .ms-search {
  padding: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
body.modern-mode .account-alerts .job-alert-form .ms-drop .ms-search input {
  width: 100% !important;
  height: 40px !important;
  padding: 0 12px 0 36px !important;
  color: var(--ink) !important;
  font-family: inherit;
  font-size: var(--fs-sm) !important;
  text-transform: none !important;
  background-color: #f8f6f2 !important;
  border: 1px solid transparent !important;
  border-radius: var(--r-sm) !important;
}
body.modern-mode .account-alerts .job-alert-form .ms-drop .ms-search input:focus {
  border-color: var(--brand) !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}
body.modern-mode .account-alerts .job-alert-form .Form input:focus,
body.modern-mode .account-alerts .job-alert-form .Form select:focus,
body.modern-mode .account-alerts .job-alert-form .Form .ms-choice:focus {
  outline: none;
  border-color: var(--brand) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}
body.modern-mode .account-alerts .job-alert-employee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 18px 0 0;
  color: var(--text);
  font-weight: 650;
}
body.modern-mode .account-alerts .job-alert-employee input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

/* Notification choices read as settings rather than another search grid. */
body.modern-mode .account-alerts .job-alert-section.is-notifications {
  max-width: 720px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: #faf8f5;
}
/* Scoped with .job-alert-form so these out-specify the two-column criteria
   grid above, which otherwise sits the notification rows side by side. */
body.modern-mode .account-alerts .job-alert-form .job-alert-notifications > tbody {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
body.modern-mode .account-alerts .job-alert-form .job-alert-notifications > tbody > tr {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
}
body.modern-mode .account-alerts .job-alert-form .job-alert-notifications > tbody > tr > td {
  width: auto !important;
}
body.modern-mode .account-alerts .job-alert-form .job-alert-notifications > tbody > tr > td.head {
  margin: 0 !important;
  font-size: var(--fs-base);
  font-weight: 600;
}
body.modern-mode .account-alerts .job-alert-notifications select {
  width: 104px !important;
  min-width: 104px !important;
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
body.modern-mode .account-alerts .job-alert-form > input[type="submit"],
body.modern-mode .account-alerts .job-alert-form > input[type="button"] {
  margin-top: 2px;
}

/* My Attachments: existing upload widgets and file actions remain live. */
body.modern-mode .account-attachments input[type="file"],
body.modern-mode .is-attachment-upload input[type="file"] {
  background-color: transparent;
}
body.modern-mode .account-attachments .account-attachment-card {
  min-width: 0;
  padding: 20px;
}
body.modern-mode .account-attachments .account-attachment-card legend {
  width: auto;
  margin: 0;
  padding: 0 8px;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: 800;
}
body.modern-mode .account-attachments .account-attachment-row > td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
body.modern-mode .account-attachments .account-attachment-row:last-child > td {
  border-bottom: 0;
}
body.modern-mode .account-attachments .account-upload-control {
  max-width: 100%;
  margin: 10px 0;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-soft);
}
body.modern-mode .account-attachments a {
  overflow-wrap: anywhere;
}
/* My Attachments (pageID 186) only — .account-attachments is set by
   header.php for page 186 and nowhere else.
   File names without spaces cannot wrap and stretch the table past the
   card, so the Filename column may break anywhere. */
body.modern-mode .account-attachments table.Report > tbody > tr > td:first-child {
  overflow-wrap: anywhere;
}
/* Centre the legacy inline pager ("Viewing records … Next > Last >|"). */
body.modern-mode .account-attachments td.reportcontrols {
  text-align: center;
}
/* Stacked/mobile layouts: also let long MIME types wrap. */
@media screen and (max-width: 1200px) {
  body.modern-mode .account-attachments table.Report td {
    overflow-wrap: anywhere;
  }
}
body.modern-mode .account-modern a:visited {
  color: var(--brand);
}

/* Password/account administration is deliberately compact and separated from
   lower-risk profile fields. Browser password managers and autocomplete
   attributes remain untouched. */
body.modern-mode .account-administration .account-form {
  max-width: 760px;
}
body.modern-mode .account-administration .account-form-table {
  padding: 8px;
}
body.modern-mode .account-administration .account-form-table > tbody > tr > td {
  padding: 14px 16px;
}
body.modern-mode .account-administration input[type="password"],
body.modern-mode .account-administration input[type="text"] {
  width: 100%;
}

body.modern-mode .account-form .account-action-primary {
  color: #fff !important;
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}
body.modern-mode .account-form .account-action-secondary {
  color: var(--text) !important;
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}
body.modern-mode .account-form .account-action-danger {
  color: var(--brand-700) !important;
  background: var(--brand-50) !important;
  border-color: var(--brand-200) !important;
  box-shadow: none !important;
}
body.modern-mode .account-administration .modern-content .account-delete-text {
  display: inline;
  min-height: 0;
  padding: 0 !important;
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-weight: 400;
  line-height: inherit;
  text-transform: none !important;
  transform: none;
}
body.modern-mode .account-administration .modern-content .account-delete-text:hover {
  text-decoration: underline !important;
}

@media (max-width: 720px) {
  body.modern-mode .modern-page.is-account .modern-content {
    padding: 22px 16px;
  }
  body.modern-mode .account-alerts .job-alert-form .Form > tbody {
    grid-template-columns: minmax(0, 1fr);
  }
  /* These nested tables contain controls, not scrollable report data. */
  body.modern-mode .account-alerts .job-alert-criteria > tbody > tr > td > table {
    display: table;
    overflow: visible;
  }
  body.modern-mode .account-alerts .job-alert-section-head {
    margin-bottom: 16px;
  }
  body.modern-mode .account-alerts .job-alert-form .job-alert-notifications > tbody > tr {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
  }
  body.modern-mode .account-details .account-details-grid > tbody {
    grid-template-columns: minmax(0, 1fr);
  }
  body.modern-mode .account-details .account-details-section .section-head {
    display: block;
  }
  body.modern-mode .account-details .account-details-section .section-sub {
    display: block;
    margin-top: 4px;
  }
  body.modern-mode .account-form-table,
  body.modern-mode .account-form-table > tbody,
  body.modern-mode .account-form-table > tbody > tr,
  body.modern-mode .account-form-table > tbody > tr > td {
    display: block;
    width: 100% !important;
  }
  body.modern-mode .account-form-table .head,
  body.modern-mode .account-form-table .headTop,
  body.modern-mode .account-form-table .FormLabel,
  body.modern-mode .account-form-table .requiredFieldHead {
    padding-bottom: 5px;
    border-bottom: 0;
  }
  body.modern-mode .account-attachments .account-attachment-row > td {
    padding: 9px 12px;
  }
}

/* ---- Responsive ------------------------------------------------------
   Breakpoints match the prototype exactly: the apply layout collapses at
   980px and the field grid stacks at 620px. */
@media (max-width: 980px) {
  body.modern-mode .modern-content .apply-layout { grid-template-columns: minmax(0, 1fr); }
  body.modern-mode .modern-content .apply-aside { position: static; }
}
@media (max-width: 620px) {
  body.modern-mode .apply-header { padding-top: 20px; }
  body.modern-mode .modern-content .form-grid { grid-template-columns: minmax(0, 1fr); }
  body.modern-mode .modern-content .form-section { padding: 20px 18px 22px; }
  body.modern-mode .apply-modern table.Report,
  body.modern-mode .apply-modern table.Report > tbody,
  body.modern-mode .apply-modern table.Report > tbody > tr,
  body.modern-mode .apply-modern table.Report > tbody > tr > td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  body.modern-mode .apply-modern table.Report > tbody > tr > td:empty { display: none; }
  body.modern-mode .apply-modern table.Report input,
  body.modern-mode .apply-modern table.Report select,
  body.modern-mode .apply-modern table.Report textarea { max-width: 100%; }
  body.modern-mode .modern-content button.modern-attachment-choice { white-space: normal; }
  body.modern-mode .stepper .step .label { display: none; }
  body.modern-mode .stepper .step-line { margin: 0 8px; }
  body.modern-mode .modern-content .apply-actions { justify-content: stretch; }
  body.modern-mode .modern-content .apply-actions .actions-right {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }
  body.modern-mode .modern-content .apply-actions input,
  body.modern-mode .modern-content .apply-actions button { flex: 1; }
  body.modern-mode .modern-content .wizard-review-head,
  body.modern-mode .modern-content .wizard-review-body { padding: 20px; }
  body.modern-mode .modern-content .wizard-review-head { gap: 12px; }
  body.modern-mode .modern-content .wizard-review-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }
  body.modern-mode .modern-content .modern-attachment-choices { grid-template-columns: minmax(0, 1fr); }
  body.modern-mode .modern-content .modern-attachment-upload { grid-template-columns: minmax(0, 1fr); }
  body.modern-mode .modern-content .modern-attachment-upload-controls {
    grid-column: 1;
    grid-row: auto;
  }
  body.modern-mode .modern-content input.modern-attachment-browse { width: 100%; }
  body.modern-mode .modern-content .modern-attachment-file {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  body.modern-mode .modern-content button.modern-attachment-file-view {
    grid-column: 2;
    justify-self: start;
  }
  body.modern-mode .modern-content button.modern-attachment-file-use {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  body.modern-mode .modern-content .modern-attachment-selected {
    grid-template-columns: auto minmax(0, 1fr);
  }
  body.modern-mode .modern-content .modern-attachment-selected-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* ---- No-JS fallback --------------------------------------------------
   If modern-page.js does not run, the server's original table layout is
   left intact. Give it readable spacing without changing its structure. */
body.modern-mode .is-apply .modern-content table.Form { width: 100%; border-collapse: collapse; }
body.modern-mode .is-apply .modern-content table.Form td { padding: 8px 10px; vertical-align: top; }
body.modern-mode .is-apply .modern-content td.head,
body.modern-mode .is-apply .modern-content td.requiredFieldHead {
  font-weight: 700;
  color: var(--ink);
  white-space: normal;
}
body.modern-mode .is-apply .modern-content td.requiredFieldHead { color: var(--brand); }
body.modern-mode .is-apply .modern-content .pageheading {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}

/* The server wraps single controls in little layout tables that
   sometimes carry align="center"; labels and controls must stay left
   aligned in the prototype's grid. */
body.modern-mode .modern-content .field > table td { text-align: left; }
body.modern-mode .modern-content .field input[type="checkbox"],
body.modern-mode .modern-content .field input[type="radio"] { margin-left: 0; }
