/* Public website theme. Colours and the header gradient come from Website Settings. */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100%;
  margin: 0;
  padding: 22px 0 42px;
  background: var(--page-bg);
  color: #111;
  font-family: var(--body-font);
  font-size: 15.5px;
  line-height: 1.55;
}

a {
  color: #064f9d;
  text-decoration: underline;
}

a:visited {
  color: #5d3b7e;
}

a:hover,
a:focus {
  color: var(--accent);
}

img {
  max-width: 100%;
}

form {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
  z-index: 999;
  padding: 10px 12px;
  border: 2px solid #000;
  background: #fff;
}

.site-shell {
  width: min(var(--site-width, 1400px), calc(100vw - 48px));
  min-width: min(1100px, calc(100vw - 48px));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #5d6570;
  background: var(--content-bg);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.24);
}

.utility-bar {
  min-height: 30px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #999;
  background: #efefef;
  color: #333;
  font-size: 12.5px;
}

.utility-links {
  white-space: nowrap;
}

.agency-header {
  min-height: 148px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 125px;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-top: 2px solid #fff;
  border-bottom: 3px double #fff;
  background: var(--header-background);
  color: var(--primary-text);
}

.agency-logo-wrap,
.secondary-logo-wrap {
  text-align: center;
}

.agency-logo {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.secondary-logo {
  width: 104px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.agency-titles {
  min-width: 0;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.government-name {
  font-family: var(--heading-font);
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agency-titles h1 {
  margin: 3px 0 5px;
  color: inherit;
  font-family: var(--heading-font);
  font-size: 42px;
  font-weight: normal;
  line-height: 1.05;
}

.tagline {
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.03em;
}

.top-navigation {
  min-height: 40px;
  display: flex;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #6d7480;
  background: var(--secondary);
}

.top-navigation a {
  flex: 1;
  padding: 10px 10px 9px;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
  color: var(--secondary-text);
  font-size: 14.5px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.top-navigation a:last-child {
  border-right: 0;
}

.top-navigation a:hover,
.top-navigation a:focus {
  background: var(--content-bg);
  color: var(--accent);
}

.content-frame {
  flex: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 650px;
}

.left-column {
  padding: 12px 10px 16px;
  border-right: 1px solid #9fa4aa;
  background: var(--page-bg);
}

.side-box {
  margin-bottom: 13px;
  border: 1px solid #777f89;
  background: #fff;
}

.side-box-title,
.section-title {
  padding: 7px 9px;
  background: var(--primary);
  color: var(--primary-text);
  font-family: var(--heading-font);
  font-size: 15.5px;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.side-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav li {
  border-top: 1px solid #ddd;
}

.side-nav li:first-child {
  border-top: 0;
}

.side-nav a {
  display: block;
  padding: 9px 10px;
  color: #173d72;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--secondary);
  color: var(--secondary-text);
  text-decoration: underline;
}

.contact-box p {
  margin: 10px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.small-print-box {
  font-size: 12.5px;
}

.main-content {
  min-width: 0;
  padding: 18px 24px 32px;
  background: var(--content-bg);
}

.breadcrumb {
  margin: -2px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px dotted #a1a1a1;
  color: #555;
  font-size: 12.5px;
}

h2 {
  margin: 4px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--secondary);
  color: var(--primary);
  font-family: var(--heading-font);
  font-size: 30px;
  font-weight: normal;
  line-height: 1.15;
}

h3 {
  margin: 20px 0 7px;
  color: var(--primary);
  font-family: var(--heading-font);
  font-size: 21px;
}

h4 {
  margin: 16px 0 5px;
  color: #333;
  font-family: var(--heading-font);
  font-size: 17px;
}

p {
  margin: 0 0 12px;
}

ul,
ol {
  margin-top: 5px;
  padding-left: 30px;
}

blockquote {
  margin: 14px 20px;
  padding: 10px 12px;
  border: 1px solid #b6b690;
  border-left: 5px solid var(--accent);
  background: #f7f7ea;
}

.page-summary {
  padding: 10px 12px;
  border: 1px solid #b5c2d3;
  background: #eef2f7;
  color: #2d3c50;
  font-weight: bold;
}

.page-copy table,
.government-table {
  width: 100%;
  margin: 12px 0 18px;
  border-collapse: collapse;
}

.page-copy th,
.page-copy td,
.government-table th,
.government-table td {
  padding: 8px 9px;
  border: 1px solid #888;
  vertical-align: top;
}

.page-copy th,
.government-table th {
  background: var(--secondary);
  color: var(--secondary-text);
  text-align: left;
}

.notice-board {
  margin: 0 0 16px;
  border: 1px solid #757c85;
}

.public-notice {
  margin: 0;
  padding: 11px 13px;
  border-bottom: 1px dotted #9a9a9a;
  background: #fff;
}

.public-notice:last-of-type {
  border-bottom: 0;
}

.public-notice.notice-important,
.public-notice.notice-closure {
  border-left: 6px solid var(--accent);
  background: #fff8f2;
}

.public-notice.notice-meeting {
  border-left: 6px solid #705a22;
  background: #fffdf2;
}

.notice-heading {
  margin-bottom: 3px;
  font-size: 16px;
  font-weight: bold;
}

.notice-label {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

.notice-date,
.notice-meta {
  margin-bottom: 6px;
  color: #666;
  font-size: 12.5px;
}

.public-notice p:last-child {
  margin-bottom: 0;
}

.more-link {
  margin: 0;
  padding: 8px 11px;
  background: var(--secondary);
  color: var(--secondary-text);
  font-size: 12.5px;
  text-align: right;
}

.more-link a,
.more-link a:visited {
  color: var(--secondary-text);
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.period-panel {
  border: 1px solid #858b93;
  background: #fff;
}

.period-panel>p,
.period-panel>ul {
  margin: 10px 12px;
}

.document-list {
  padding-left: 25px;
  list-style-image: none;
}

.document-list li {
  margin: 7px 0;
}

.document-list span,
.document-description,
.site-map-list div {
  color: #666;
  font-size: 12.5px;
}

.document-description {
  margin-top: 4px;
}

.document-category {
  margin-bottom: 20px;
}

.related-pages {
  margin-top: 24px;
  border: 1px solid #888;
}

.related-pages ul {
  margin: 12px;
}

.page-updated {
  margin-top: 28px;
  padding-top: 7px;
  border-top: 1px dotted #999;
  color: #666;
  font-size: 11.5px;
  text-align: right;
}

.site-map-list li {
  margin: 8px 0;
}

.login-panel {
  max-width: 600px;
  padding: 18px;
  border: 1px solid #7c8490;
  background: #f1f3f6;
}

.period-button {
  display: inline-block;
  padding: 7px 12px;
  border: 2px outset #d9d9d9;
  background: var(--secondary);
  color: var(--secondary-text) !important;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

.period-button:active {
  border-style: inset;
}

.warning-box,
.preview-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #9a7618;
  background: #fff4c7;
  color: #4d3a00;
  font-weight: bold;
}

.preview-banner {
  text-align: center;
}

.flash-stack {
  margin-bottom: 12px;
}

.flash-message {
  margin-bottom: 7px;
  padding: 10px 12px;
  border: 1px solid;
}

.flash-success {
  border-color: #5f8e54;
  background: #ecf7e8;
  color: #244b1d;
}

.flash-error {
  border-color: #a44b42;
  background: #fff0ed;
  color: #6b1711;
}

.flash-info {
  border-color: #5b78a1;
  background: #edf4ff;
  color: #173b6a;
}

.muted {
  color: #666;
}

.error-detail {
  overflow: auto;
  padding: 12px;
  border: 1px solid #aaa;
  background: #f5f5f5;
  white-space: pre-wrap;
}

.site-footer {
  padding: 12px 16px;
  border-top: 3px double #777;
  background: var(--secondary);
  color: var(--secondary-text);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}

.roleplay-disclaimer {
  margin-top: 4px;
  color: #8B1E1E;
  font-weight: bold;
}

@media (max-width: 900px) {
  body {
    padding: 0;
  }

  .site-shell {
    width: 100%;
    min-height: 100vh;
    border-left: 0;
    border-right: 0;
  }

  .agency-header {
    grid-template-columns: 110px minmax(0, 1fr);
    min-height: 120px;
  }

  .agency-logo {
    width: 96px;
    height: 96px;
  }

  .secondary-logo-wrap {
    display: none;
  }

  .government-name {
    font-size: 16px;
  }

  .agency-titles h1 {
    font-size: 32px;
  }

  .content-frame {
    grid-template-columns: 205px minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .utility-bar {
    display: block;
    text-align: center;
  }

  .utility-links {
    display: block;
    margin-top: 3px;
  }

  .agency-header {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 100px;
    gap: 8px;
    padding: 7px;
  }

  .agency-logo {
    width: 72px;
    height: 72px;
  }

  .government-name {
    font-size: 12px;
  }

  .agency-titles h1 {
    font-size: 24px;
  }

  .tagline {
    font-size: 11px;
  }

  .top-navigation {
    flex-wrap: wrap;
  }

  .top-navigation a {
    flex: 1 1 50%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  }

  .content-frame {
    display: block;
  }

  .left-column {
    border-right: 0;
    border-bottom: 1px solid #999;
  }

  .side-box:not(:first-child) {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .side-nav li {
    border: 1px solid #ddd;
  }

  .main-content {
    padding: 14px;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .government-table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  body {
    padding: 0;
    background: #fff;
  }

  .site-shell {
    width: 100%;
    border: 0;
    box-shadow: none;
  }

  .utility-bar,
  .top-navigation,
  .left-column,
  .site-footer {
    display: none;
  }

  .agency-header {
    min-height: 80px;
    border-bottom: 2px solid #000;
    background: #fff;
    color: #000;
  }

  .agency-logo {
    width: 70px;
    height: 70px;
  }

  .secondary-logo {
    width: 58px;
    height: 58px;
  }

  .content-frame {
    display: block;
  }

  .main-content {
    padding: 10px 0;
  }
}

/* =========================================================
   ONLINE FORMS
   ========================================================= */
.online-form-list { display: grid; gap: 14px; margin: 18px 0; }
.online-form-card { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px; border: 1px solid #8b8b8b; background: #fff; }
.online-form-card-image { width: 100px; height: 100px; object-fit: contain; }
.online-form-card h3 { margin-top: 0; }
.form-access-note { color: #666; font-size: 12px; }
.form-track-panel { margin-top: 22px; }
.form-page-heading { display: flex; align-items: center; gap: 16px; }
.form-header-image { width: 100px; height: 100px; object-fit: contain; }
.public-form { margin: 18px 0; }
.compact-public-form { max-width: 560px; }
.form-progress { margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.form-progress > div { flex: 1; height: 12px; border: 1px solid #777; background: #eee; }
.form-progress > div > span { display: block; height: 100%; background: var(--accent); }
.form-progress strong { font-size: 12px; white-space: nowrap; }
.form-section { border: 1px solid #8a8a8a; background: #fff; }
.form-section-heading { padding: 14px 16px; border-bottom: 1px solid #aaa; background: var(--secondary); color: var(--secondary-text, #111); }
.form-section-heading > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.form-section-heading h3 { margin: 3px 0; color: inherit; }
.form-section-heading p { margin: 4px 0 0; }
.form-question-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.public-field { grid-column: span 6; min-width: 0; }
.public-field.width-half { grid-column: span 3; }
.public-field.width-third { grid-column: span 2; }
.public-field > label { display: block; margin-bottom: 5px; font-weight: bold; }
.public-field input[type="text"], .public-field input[type="email"], .public-field input[type="tel"], .public-field input[type="number"], .public-field input[type="date"], .public-field input[type="time"], .public-field input[type="datetime-local"], .public-field input[type="file"], .public-field textarea, .public-field select, .compact-public-form input, .public-message-form textarea { width: 100%; padding: 8px; border: 1px solid #888; background: #fff; }
.field-help { display: block; margin: -2px 0 6px; color: #666; }
.required-mark { color: #8b1e1e; }
.choice-list { display: grid; gap: 6px; }
.choice-list label { display: flex; align-items: flex-start; gap: 7px; padding: 6px 8px; border: 1px solid #ddd; background: #fafafa; }
/* FORM CHOICE COLOUR PRESETS */
.choice-themed {
  --choice-accent: var(--accent);
  --choice-soft: #f7f4eb;
  --choice-border: #c5bda8;
  --choice-ink: #2b241d;
}
.choice-themed.choice-style-green {
  --choice-accent: #2f6f3e;
  --choice-soft: #eaf4ec;
  --choice-border: #87aa8e;
  --choice-ink: #173c20;
}
.choice-themed.choice-style-red {
  --choice-accent: #8b1e1e;
  --choice-soft: #faeaea;
  --choice-border: #bc8585;
  --choice-ink: #5d1515;
}
.choice-themed.choice-style-gold {
  --choice-accent: #a88632;
  --choice-soft: #f7f0dc;
  --choice-border: #c9ae65;
  --choice-ink: #4b3810;
}
.choice-themed.choice-style-blue {
  --choice-accent: #315f8a;
  --choice-soft: #eaf1f7;
  --choice-border: #86a5bf;
  --choice-ink: #1e405f;
}
.choice-themed.choice-style-gray {
  --choice-accent: #62676d;
  --choice-soft: #eff0f1;
  --choice-border: #a4a8ac;
  --choice-ink: #34383c;
}
.choice-themed.choice-style-custom {
  --choice-soft: color-mix(in srgb, var(--choice-accent) 11%, white);
  --choice-border: color-mix(in srgb, var(--choice-accent) 48%, white);
  --choice-ink: color-mix(in srgb, var(--choice-accent) 70%, black);
}
.choice-themed input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--choice-accent);
}
.choice-themed label {
  border-color: var(--choice-border);
  background: var(--choice-soft);
  color: var(--choice-ink);
}
.choice-themed label:has(input:checked) {
  border-color: var(--choice-accent);
  background: color-mix(in srgb, var(--choice-accent) 18%, white);
  box-shadow: inset 4px 0 0 var(--choice-accent);
}
.agreement-field {
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
}
.agreement-field > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  cursor: pointer;
}
.agreement-field > label > span {
  min-width: 0;
}
.agreement-field strong {
  display: block;
  color: var(--choice-ink);
  font-size: 15px;
}
.agreement-field .field-help {
  margin: 4px 0 0;
  color: color-mix(in srgb, var(--choice-ink) 78%, white);
  font-weight: normal;
}
.agreement-field:has(input:checked) {
  border-color: var(--choice-accent);
  box-shadow: inset 5px 0 0 var(--choice-accent);
}

.scale-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scale-options { display: flex; gap: 7px; }
.scale-options label { text-align: center; }
.scale-options span { display: block; min-width: 30px; padding: 6px; border: 1px solid #aaa; background: #f5f5f5; }
.form-information-block { padding: 12px; border-left: 5px solid var(--accent); background: #f4f1e8; }
.form-divider { margin: 4px 0; padding-bottom: 4px; border-bottom: 1px solid #999; }
.form-section-actions { padding: 12px 18px; display: flex; justify-content: space-between; border-top: 1px solid #aaa; background: #f3f3f3; }
.autosave-status { margin-top: 8px; color: #555; font-size: 12px; }
.tracking-code-box { margin: 14px 0; padding: 12px; border: 2px solid var(--accent); background: #fff8d8; }
.submission-reference { margin: 12px 0; padding: 8px; border: 1px solid #888; background: #eee; }
.review-section { margin: 16px 0; border: 1px solid #999; }
.review-section h3 { margin: 0; padding: 8px 10px; background: var(--secondary); color: var(--secondary-text, #111); }
.review-list { margin: 0; }
.review-list > div { display: grid; grid-template-columns: minmax(180px, 35%) 1fr; border-top: 1px solid #ddd; }
.review-list > div:first-child { border-top: 0; }
.review-list dt, .review-list dd { margin: 0; padding: 9px 10px; }
.review-list dt { font-weight: bold; background: #f4f4f4; }
.review-actions, .receipt-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.submission-receipt { border: 2px solid var(--primary); background: #fff; }
.receipt-header { display: flex; align-items: center; gap: 15px; padding: 14px; background: var(--header-background, var(--primary)); color: var(--primary-text, #fff); }
.receipt-header h2 { margin: 2px 0; padding: 0; border: 0; color: inherit; }
.receipt-logo { width: 78px; height: 78px; object-fit: contain; }
.receipt-government { text-transform: uppercase; letter-spacing: .07em; font-size: 12px; }
.receipt-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid #999; }
.receipt-grid > div { padding: 10px 12px; border-right: 1px solid #ccc; border-top: 1px solid #ccc; }
.receipt-grid span, .receipt-grid strong { display: block; }
.receipt-grid span { color: #666; font-size: 11px; text-transform: uppercase; }
.submission-receipt > .review-section, .submission-receipt > h3, .submission-receipt > ul, .submission-receipt > .tracking-code-box, .submission-receipt > .receipt-actions { margin-left: 14px; margin-right: 14px; }
.message-thread article { padding: 10px 12px; border-bottom: 1px solid #ccc; }
.message-thread article:last-child { border-bottom: 0; }
.message-thread article > strong, .message-thread article > span { display: block; }
.message-thread article > span { color: #666; font-size: 11px; }
.public-message-form { padding: 12px; }
.responsive-table { overflow-x: auto; }
@media (max-width: 700px) {
  .online-form-card { grid-template-columns: 1fr; }
  .online-form-card-image { width: 80px; height: 80px; }
  .public-field.width-half, .public-field.width-third { grid-column: span 6; }
  .scale-field { display: block; }
  .receipt-grid { grid-template-columns: 1fr; }
  .review-list > div { grid-template-columns: 1fr; }
}
@media print {
  .breadcrumb, .receipt-actions, .public-message-form, .period-panel, .roleplay-disclaimer { display: none !important; }
  .submission-receipt { border: 1px solid #000; }
}



/* =========================================================
   FORM CHOICE COLOURS — ALL CHOICE TYPES
   ========================================================= */

.choice-themed input[type="checkbox"],
.choice-themed input[type="radio"] {
  accent-color: var(--choice-accent);
}

.choice-list.choice-themed label {
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
  color: var(--choice-ink);
  cursor: pointer;
  transition:
    background 100ms ease,
    border-color 100ms ease,
    box-shadow 100ms ease;
}

.choice-list.choice-themed label:hover {
  border-color: var(--choice-accent);
}

.choice-list.choice-themed label:has(input:checked) {
  border-color: var(--choice-accent);
  background:
    color-mix(in srgb,
      var(--choice-accent) 18%,
      white);
  color: var(--choice-ink);
  box-shadow: inset 5px 0 0 var(--choice-accent);
}

.choice-list.choice-themed label span {
  color: inherit;
}

/* Likert and numeric ratings */

.scale-field.choice-themed {
  padding: 12px;
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
}

.scale-field.choice-themed .scale-label {
  color: var(--choice-ink);
  font-weight: bold;
}

.scale-field.choice-themed .scale-options label {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--choice-ink);
  box-shadow: none;
  cursor: pointer;
}

.scale-field.choice-themed .scale-options label:has(input:checked) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.scale-field.choice-themed .scale-options input {
  accent-color: var(--choice-accent);
}

.scale-field.choice-themed .scale-options span {
  min-width: 38px;
  padding: 8px;
  border: 1px solid var(--choice-border);
  background: #ffffff;
  color: var(--choice-ink);
  font-weight: bold;
  text-align: center;
}

.scale-field.choice-themed .scale-options input:checked+span {
  border-color: var(--choice-accent);
  background: var(--choice-accent);
  color: #ffffff;
  box-shadow: 0 0 0 2px var(--choice-soft);
}

.scale-field.choice-themed .scale-options label:hover span {
  border-color: var(--choice-accent);
}


/* =========================================================
   NICER RADIO / CHECKBOX CONTROLS
   ========================================================= */

/* Base layout for option rows */
.choice-list.choice-themed label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
  color: var(--choice-ink);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease;
}

.choice-list.choice-themed label+label {
  margin-top: 10px;
}

.choice-list.choice-themed label:hover {
  border-color: var(--choice-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--choice-accent) 12%, transparent);
}

.choice-list.choice-themed label:has(input:focus-visible) {
  outline: 2px solid var(--choice-accent);
  outline-offset: 2px;
}

/* =========================================================
   CUSTOM RADIO BUTTONS
   ========================================================= */

.choice-list.choice-themed input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid var(--choice-border);
  border-radius: 50%;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease;
}

.choice-list.choice-themed input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 120ms ease;
  background: var(--choice-accent);
}

.choice-list.choice-themed input[type="radio"]:checked {
  border-color: var(--choice-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--choice-accent) 16%, transparent);
}

.choice-list.choice-themed input[type="radio"]:checked::before {
  transform: scale(1);
}

.choice-list.choice-themed input[type="radio"]:hover {
  border-color: var(--choice-accent);
}

/* Checked row styling */
.choice-list.choice-themed label:has(input[type="radio"]:checked) {
  border-color: var(--choice-accent);
  background: color-mix(in srgb, var(--choice-accent) 10%, #ffffff);
  box-shadow: inset 5px 0 0 var(--choice-accent);
}

/* Option text */
.choice-list.choice-themed label span {
  display: block;
  color: inherit;
  font-size: 18px;
  line-height: 1.35;
}

/* =========================================================
   CUSTOM CHECKBOXES TOO
   ========================================================= */

.choice-list.choice-themed input[type="checkbox"],
.agreement-field.choice-themed input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid var(--choice-border);
  border-radius: 4px;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease;
}

.choice-list.choice-themed input[type="checkbox"]::before,
.agreement-field.choice-themed input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: transform 120ms ease;
  background: var(--choice-accent);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}

.choice-list.choice-themed input[type="checkbox"]:checked,
.agreement-field.choice-themed input[type="checkbox"]:checked {
  border-color: var(--choice-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--choice-accent) 16%, transparent);
}

.choice-list.choice-themed input[type="checkbox"]:checked::before,
.agreement-field.choice-themed input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* =========================================================
   AGREEMENT FIELD CLEANUP
   ========================================================= */

.agreement-field.choice-themed label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.agreement-field.choice-themed label:hover {
  border-color: var(--choice-accent);
}

.agreement-field.choice-themed label:has(input:checked) {
  border-color: var(--choice-accent);
  background: color-mix(in srgb, var(--choice-accent) 10%, #ffffff);
  box-shadow: inset 5px 0 0 var(--choice-accent);
}

/* =========================================================
   LIKERT / RATING BUTTONS
   ========================================================= */

.scale-field.choice-themed {
  padding: 16px;
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
}

.scale-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.scale-options label {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

/* Visually hide the native radio while retaining accessibility */
.scale-options input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0 !important;
}

/* Number tile */
.scale-options label>span {
  min-width: 58px;
  height: 58px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--choice-border);
  background: #ffffff;
  color: var(--choice-ink);

  font-size: 21px;
  font-weight: bold;
  line-height: 1;

  cursor: pointer;

  transition:
    border-color 120ms ease,
    background-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease;
}

.scale-options label:hover>span {
  border-color: var(--choice-accent);

  background:
    color-mix(in srgb,
      var(--choice-accent) 8%,
      #ffffff);

  transform: translateY(-1px);
}

/* Selected rating */
.scale-options input[type="radio"]:checked+span {
  border-color: var(--choice-accent);
  background: var(--choice-accent);
  color: #ffffff;

  box-shadow:
    0 0 0 3px color-mix(in srgb,
      var(--choice-accent) 20%,
      transparent);
}

/* Keyboard focus */
.scale-options input[type="radio"]:focus-visible+span {
  outline: 2px solid var(--choice-accent);
  outline-offset: 3px;
}

/* Low and high labels used by Likert scales */
.scale-field .scale-label {
  display: block;
  margin: 0 0 9px;
  color: var(--choice-ink);
  font-size: 13px;
  font-weight: bold;
}

.scale-field .scale-options+.scale-label {
  margin: 9px 0 0;
  text-align: right;
}

/* Wider screens: labels on either side of the scale */
@media (min-width: 760px) {
  .scale-field:has(.scale-label) {
    display: grid;
    grid-template-columns:
      minmax(100px, auto) minmax(0, 1fr) minmax(100px, auto);
    align-items: center;
    gap: 14px;
  }

  .scale-field:has(.scale-label) .scale-label {
    margin: 0;
  }

  .scale-field:has(.scale-label) .scale-options+.scale-label {
    margin: 0;
    text-align: right;
  }
}

/* =========================================================
   COMPACT FORM CONTROLS
   Keep this at the very bottom of site.css
   ========================================================= */

/* Question headings */
.public-field>label {
  font-size: 15px;
  line-height: 1.35;
}

.public-field .field-help {
  font-size: 13px;
  line-height: 1.4;
}

/* Radio and checkbox option rows */
.choice-list.choice-themed label {
  min-height: 0;
  padding: 9px 12px;
  gap: 10px;
}

.choice-list.choice-themed label+label {
  margin-top: 7px;
}

/* Option text */
.choice-list.choice-themed label>span {
  font-size: 15px;
  line-height: 1.3;
}

/* Radio circles */
.choice-list.choice-themed input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-width: 2px;
}

.choice-list.choice-themed input[type="radio"]::before {
  width: 8px;
  height: 8px;
}

.choice-list.choice-themed input[type="radio"]:checked {
  box-shadow:
    0 0 0 2px color-mix(in srgb,
      var(--choice-accent) 16%,
      transparent);
}

/* Checkboxes */
.choice-list.choice-themed input[type="checkbox"],
.agreement-field.choice-themed input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  flex-basis: 18px;
}

.choice-list.choice-themed input[type="checkbox"]::after,
.agreement-field.choice-themed input[type="checkbox"]::after {
  width: 9px;
  height: 5px;
  border-left-width: 2px;
  border-bottom-width: 2px;
}

/* Agreement rows */
.agreement-field.choice-themed label {
  padding: 10px 12px;
  gap: 10px;
}

.agreement-field.choice-themed label strong {
  font-size: 15px;
}

/* Likert/rating tiles */
.scale-field.choice-themed {
  padding: 11px;
}

.scale-options {
  gap: 7px;
}

.scale-options label>span {
  min-width: 42px;
  height: 42px;
  padding: 0 9px;
  font-size: 16px;
}

/* Back, Continue and Review buttons */
.form-section-actions .period-button {
  padding: 7px 12px;
  font-size: 14px;
}

/* Reduce the selected-row emphasis slightly */
.choice-list.choice-themed label:has(input[type="radio"]:checked),
.choice-list.choice-themed label:has(input[type="checkbox"]:checked) {
  box-shadow: inset 4px 0 0 var(--choice-accent);
}

/* =========================================================
   CENTERED / FULL-WIDTH LIKERT + RATING LAYOUT
   ========================================================= */

.scale-field.choice-themed {
  padding: 14px 18px;
  border: 1px solid var(--choice-border);
  background: var(--choice-soft);
}

.scale-field.choice-themed .scale-options {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.scale-field.choice-themed .scale-options label {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
}

.scale-field.choice-themed .scale-options label>span {
  width: min(100%, 58px);
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* If the scale has left/right labels, make the whole row balanced */
@media (min-width: 760px) {
  .scale-field:has(.scale-label) {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 140px;
    align-items: center;
    gap: 18px;
  }

  .scale-field:has(.scale-label) .scale-label {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
  }

  .scale-field:has(.scale-label) .scale-label:first-of-type {
    text-align: left;
  }

  .scale-field:has(.scale-label) .scale-options+.scale-label {
    text-align: right;
  }
}



/* =========================================================
   DRAFT ACTIONS
   ========================================================= */

.submission-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-action-form {
  display: inline;
}

.public-text-button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #064f9d;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.public-text-button:hover,
.public-text-button:focus {
  color: var(--accent);
}

.public-text-button.danger {
  color: #8b1e1e;
}

.submission-status-draft {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #9a7618;
  background: #fff4c7;
  color: #5c4500;
  font-size: 12px;
  font-weight: bold;
}

.draft-management-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dotted #999;
  text-align: right;
}

.period-button.danger {
  border-color: #641717;
  background: #8b1e1e;
  color: #ffffff !important;
}

.period-button.danger:hover,
.period-button.danger:focus {
  background: #6f1616;
}

/* =========================================================
   PUBLIC CONFIRMATION MODAL
   ========================================================= */

.public-modal-open {
  overflow: hidden;
}

.public-confirm-backdrop[hidden] {
  display: none;
}

.public-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;

  padding: 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(20, 17, 15, 0.72);

  opacity: 0;

  transition:
    opacity 100ms ease;
}

.public-confirm-backdrop.is-visible {
  opacity: 1;
}

.public-confirm-modal {
  width: min(520px, 100%);
  overflow: hidden;

  border: 1px solid var(--primary);
  border-top: 5px solid var(--accent);

  background: var(--content-bg);
  color: #111;

  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.45);

  transform: translateY(-7px);

  transition:
    transform 100ms ease;
}

.public-confirm-backdrop.is-visible .public-confirm-modal {
  transform: translateY(0);
}

.public-confirm-header {
  min-height: 58px;
  padding: 10px 13px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  background: var(--header-background);
  color: var(--primary-text);
}

.public-confirm-header h2 {
  margin: 0;
  padding: 0;
  border: 0;

  color: inherit;

  font-family: var(--heading-font);
  font-size: 21px;
}

.public-confirm-close {
  width: 32px;
  height: 32px;

  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.55);

  background:
    rgba(0, 0, 0, 0.14);

  color: var(--primary-text);

  font-size: 24px;
  line-height: 27px;

  cursor: pointer;
}

.public-confirm-close:hover,
.public-confirm-close:focus {
  background: var(--secondary);
  color: var(--secondary-text);
}

.public-confirm-body {
  padding: 22px;

  display: grid;
  grid-template-columns:
    44px minmax(0, 1fr);

  gap: 15px;
  align-items: start;
}

.public-confirm-symbol {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px solid var(--accent);

  background: var(--secondary);
  color: var(--secondary-text);

  font-family: var(--heading-font);
  font-size: 25px;
  font-weight: bold;
}

.public-confirm-modal[data-tone="danger"] .public-confirm-symbol {
  border-color: #641717;
  background: #8b1e1e;
  color: #ffffff;
}

.public-confirm-body p {
  margin: 2px 0 0;

  font-size: 15px;
  line-height: 1.55;

  white-space: pre-line;
}

.public-confirm-footer {
  padding: 11px 14px;

  display: flex;
  justify-content: flex-end;
  gap: 9px;

  border-top: 1px solid #aaa;

  background: var(--page-bg);
}

.public-confirm-footer .period-button {
  min-width: 105px;
  text-align: center;
}

@media (max-width: 600px) {
  .public-confirm-backdrop {
    padding: 10px;
  }

  .public-confirm-body {
    grid-template-columns:
      36px minmax(0, 1fr);

    padding: 17px;
    gap: 11px;
  }

  .public-confirm-symbol {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .public-confirm-footer {
    flex-direction: column-reverse;
  }

  .public-confirm-footer .period-button {
    width: 100%;
  }
}

/* =========================================================
   SUBMISSION STATUS BADGES
   ========================================================= */

.submission-status-heading,
.submission-status-cell {
  width: 150px;
  text-align: center !important;
  vertical-align: middle !important;
}

.submission-status {
  min-width: 96px;
  min-height: 32px;
  padding: 5px 11px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #7f8994;
  background: #edf0f3;
  color: #27323d;

  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* Draft */
.submission-status-draft {
  border-color: #b68a16;
  background: #fff4c8;
  color: #674c00;
}

/* Newly received */
.submission-status-received,
.submission-status-submitted {
  border-color: #587da6;
  background: #edf4fc;
  color: #294f78;
}

/* Assigned */
.submission-status-assigned {
  border-color: #766293;
  background: #f1edf7;
  color: #4e3a6c;
}

/* Active review */
.submission-status-under-review,
.submission-status-in-review,
.submission-status-initial-review,
.submission-status-background-review {
  border-color: #47799a;
  background: #eaf4fa;
  color: #255675;
}

/* Waiting for the submitter */
.submission-status-awaiting-information,
.submission-status-awaiting-applicant-response {
  border-color: #b17b1d;
  background: #fff4d9;
  color: #704a08;
}

/* Approved */
.submission-status-approved,
.submission-status-completed {
  border-color: #4f8659;
  background: #eaf5ec;
  color: #285b32;
}

/* Denied */
.submission-status-denied,
.submission-status-rejected {
  border-color: #a84d48;
  background: #faeceb;
  color: #761f1b;
}

/* Withdrawn */
.submission-status-withdrawn {
  border-color: #8a7b70;
  background: #f1eeeb;
  color: #594c43;
}

/* Closed or archived */
.submission-status-closed,
.submission-status-archived {
  border-color: #646b73;
  background: #e8eaec;
  color: #353b41;
}

@media (max-width: 680px) {

  .submission-status-heading,
  .submission-status-cell {
    width: 125px;
  }

  .submission-status {
    min-width: 84px;
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Forms without a header image use the full card width */
.online-form-card:not(:has(.online-form-card-image)) {
  grid-template-columns: minmax(0, 1fr);
}

.online-form-card:not(:has(.online-form-card-image))>div {
  grid-column: 1 / -1;
  min-width: 0;
}

/* Keep titles and descriptions from breaking unnecessarily */
.online-form-card h3,
.online-form-card p {
  overflow-wrap: normal;
  word-break: normal;
}

/* =========================================================
   DOCUMENT LIBRARY AND PREVIEWS
   ========================================================= */

.document-library-table th:last-child,
.document-library-table td:last-child {
  width: 230px;
  text-align: center;
  vertical-align: middle;
}

.document-list-actions,
.document-page-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.document-action-button {
  min-width: 82px;
  padding: 6px 10px;
  font-size: 13px;
  text-align: center;
}

.period-button.secondary {
  border-color: #777;
  background: var(--content-bg);
  color: var(--primary) !important;
}

.period-button.secondary:hover,
.period-button.secondary:focus {
  border-color: var(--accent);
  background: var(--secondary);
  color: var(--secondary-text) !important;
}

.document-access-badge {
  min-width: 92px;
  padding: 6px 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #7f8994;

  background: #edf0f3;
  color: #37414b;

  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
}

.document-page-heading {
  margin-bottom: 14px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.document-page-heading>div:first-child {
  min-width: 0;
  flex: 1;
}

.document-page-heading h2 {
  margin-top: 0;
}

.document-page-heading p {
  margin-bottom: 0;
}

.document-page-actions {
  flex: 0 0 auto;
  padding-top: 3px;
}

.document-metadata {
  margin: 0 0 18px;

  display: grid;
  grid-template-columns:
    repeat(3, minmax(120px, 1fr));

  border: 1px solid #a7adb4;
  background: #f2f3f4;
}

.document-metadata>div {
  padding: 10px 12px;
  border-right: 1px solid #c1c5ca;
}

.document-metadata>div:last-child {
  border-right: 0;
}

.document-metadata dt {
  margin-bottom: 3px;

  color: #555f69;

  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-metadata dd {
  margin: 0;

  color: #222;

  font-size: 14px;
  font-weight: bold;
}

.document-preview-panel {
  border: 1px solid #7e858d;
  background: #ffffff;
}

.document-preview-frame {
  width: 100%;
  height: min(75vh, 900px);
  min-height: 620px;

  display: block;

  border: 0;
  background: #ffffff;
}

.document-image-preview {
  min-height: 400px;
  padding: 20px;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  background:
    repeating-conic-gradient(#eeeeee 0% 25%,
      #ffffff 0% 50%) 50% / 20px 20px;
}

.document-image-preview img {
  max-width: 100%;
  max-height: 900px;

  display: block;

  border: 1px solid #999;
  background: #ffffff;

  object-fit: contain;
}

.document-preview-unavailable {
  margin: 20px;
  padding: 22px;

  border: 1px solid #ad9a65;
  border-left: 5px solid var(--accent);

  background: #faf7ec;
}

.document-preview-unavailable strong {
  display: block;
  margin-bottom: 6px;

  color: var(--primary);

  font-family: var(--heading-font);
  font-size: 18px;
}

.document-preview-unavailable p {
  margin: 0;
}

.admin-document-file-actions {
  margin-top: 6px;

  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  font-size: 12px;
}

@media (max-width: 760px) {
  .document-page-heading {
    display: block;
  }

  .document-page-actions {
    margin-top: 12px;
    justify-content: flex-start;
  }

  .document-metadata {
    grid-template-columns: 1fr;
  }

  .document-metadata>div {
    border-right: 0;
    border-bottom: 1px solid #c1c5ca;
  }

  .document-metadata>div:last-child {
    border-bottom: 0;
  }

  .document-preview-frame {
    min-height: 500px;
  }

  .document-library-table th:last-child,
  .document-library-table td:last-child {
    width: auto;
  }
}
/* =========================================================
   THEME SYSTEM LAYOUT OVERRIDES
   ========================================================= */

.content-frame {
  grid-template-columns: var(--sidebar-width, 250px) minmax(0, 1fr);
}

.public-theme-preview-bar {
  width: min(var(--site-width, 1400px), calc(100vw - 48px));
  min-height: 44px;
  margin: 0 auto 8px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #9a7618;
  background: #fff4c7;
  color: #4d3a00;
  font-size: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
}

.public-theme-preview-bar span {
  margin-left: 7px;
  color: #6d5b26;
}

.public-theme-preview-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.top-navigation a.active {
  background: var(--content-bg);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.agency-header {
  background: var(--header-background);
}

.roleplay-disclaimer {
  color: #8b1e1e;
}

@media (max-width: 900px) {
  .content-frame {
    grid-template-columns: min(var(--sidebar-width, 205px), 230px) minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .public-theme-preview-bar {
    width: 100%;
    margin: 0;
    display: block;
  }

  .public-theme-preview-actions {
    margin-top: 8px;
  }

  .content-frame {
    display: block;
  }
}
