/**
 * Cairn Webforms — clean sizing/patterns with cwf-* class names only.
 * No third-party design-system prefixes or third-party design-system prefixes classes.
 *
 * Font and text colour inherit the host theme by default. Semantic colour
 * tokens ship with accessible defaults; control geometry stays
 * (2px borders, 0 radius, focus ring widths). Themes may override any --cwf-*
 * variable on :root or .cwf-webform.
 */

:root {
  /* Typography & colour — inherit host theme unless overridden.
     Use currentColor (not inherit) for --cwf-text so shadows/borders stay valid.
     Override any --cwf-* on :root or .cwf-webform for brand / dark hosts. */
  --cwf-font: inherit;
  --cwf-text: currentColor;
  --cwf-text-strong: #212b32;
  --cwf-secondary: #4c6272;
  --cwf-border: currentColor;
  /* Input border (grey-1) — independent of theme text colour */
  --cwf-border-input: #4c6272;
  --cwf-border-muted: #d8dde0;
  --cwf-focus: #ffeb3b;
  --cwf-focus-text: #212b32;
  --cwf-error: #d5281b;
  --cwf-warning: #ed8b00;
  --cwf-warning-callout-bg: #fff8f0;
  --cwf-warning-callout-border: #ed8b00;
  --cwf-button-warning: #d5281b;
  --cwf-button-warning-hover: #a81f16;
  --cwf-button-warning-shadow: #6b140e;
  --cwf-success: #007f3b;
  --cwf-success-text: #ffffff;
  --cwf-link: #005eb8;
  --cwf-link-hover: #7c2855;
  --cwf-link-visited: #330072;
  --cwf-button: #007f3b;
  --cwf-button-hover: #004e2a;
  --cwf-button-shadow: #00401e;
  --cwf-button-text: #ffffff;
  --cwf-button-secondary: #f0f4f5;
  --cwf-button-secondary-hover: #d8dde0;
  --cwf-button-secondary-shadow: #768692;
  --cwf-button-secondary-text: #212b32;
  --cwf-surface: #ffffff;
  --cwf-inset: #f0f4f5;
  --cwf-overlay: rgba(33, 43, 50, 0.5);
  /* Tag colours — neutral greys / blue / green / pale-yellow / red fills */
  --cwf-tag-bg: #d8dde0;
  --cwf-tag-text: #212b32;
  --cwf-tag-blue-bg: #d4e5f5;
  --cwf-tag-blue-text: #003087;
  --cwf-tag-grey-bg: #d8dde0;
  --cwf-tag-grey-text: #212b32;
  --cwf-tag-green-bg: #cce5d8;
  --cwf-tag-green-text: #004e2a;
  --cwf-tag-yellow-bg: #fff9c4;
  --cwf-tag-yellow-text: #4c3900;
  --cwf-tag-red-bg: #f7d4d1;
  --cwf-tag-red-text: #2b0705;
  --cwf-radius: 0;
  --cwf-input-border-width: 2px;
  --cwf-focus-width: 3px;
  --cwf-shadow-width: 2px;
  --cwf-width: 40.5rem;
  --cwf-body-size: 1.1875rem;
  --cwf-body-line: 1.31579;
  --cwf-space-1: 0.3125rem;
  --cwf-space-2: 0.625rem;
  --cwf-space-3: 0.9375rem;
  --cwf-space-4: 1.25rem;
  --cwf-space-5: 1.5625rem;
  --cwf-space-6: 1.875rem;
  --cwf-space-7: 2.5rem;
  --cwf-space-8: 3.125rem;
  --cwf-link-underline-thickness: max(1px, 0.0625rem);
  --cwf-link-underline-offset: 0.1578em;
  --cwf-transition: 120ms ease;
}

/* Shared interactive focus (links / link-buttons) */
.cwf-prose a:focus,
.cwf-back-link:focus,
.cwf-link:focus,
.cwf-link-button:focus,
.cwf-error-summary__list a:focus,
.cwf-summary-list__actions a:focus,
.cwf-task-list__link:focus,
.cwf-accordion__show-all:focus,
.cwf-accordion__section-button:focus {
  outline: var(--cwf-focus-width) solid transparent;
  color: var(--cwf-focus-text);
  background-color: var(--cwf-focus);
  box-shadow: 0 calc(var(--cwf-shadow-width) * -1) var(--cwf-focus), 0 4px var(--cwf-focus-text);
  text-decoration: none;
  text-decoration-thickness: auto;
}

.cwf-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Spam honeypot — always off-screen even if theme CSS fights visually-hidden */
.cwf-honeypot,
.cwf-webform .cwf-honeypot {
  display: none !important;
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.cwf-webform {
  /* Pull font + colour from the host theme; semantic tokens remain overridable */
  color: inherit;
  font-family: var(--cwf-font);
  font-size: var(--cwf-body-size);
  line-height: var(--cwf-body-line);
  max-width: var(--cwf-width);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.cwf-webform *,
.cwf-webform *::before,
.cwf-webform *::after {
  box-sizing: border-box;
}

.cwf-webform ::selection {
  background: var(--cwf-focus);
  color: var(--cwf-focus-text);
}

/* Backend Preview chrome — isolates the runner from October admin chrome */
.cwf-webform--preview {
  background: var(--cwf-surface);
  padding: var(--cwf-space-6);
  border: 1px solid var(--cwf-border-muted);
  color: var(--cwf-focus-text);
}

.cwf-main-wrapper {
  padding-top: var(--cwf-space-4);
  padding-bottom: var(--cwf-space-7);
}

/* Print or save a copy (check answers / confirmation) */
.cwf-print-link {
  margin: var(--cwf-space-4) 0 0;
}

.cwf-print-link[hidden] {
  display: none;
}

/* Type scale */
.cwf-heading-xl {
  font-family: inherit;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.09375;
  margin: 0 0 var(--cwf-space-6);
  color: inherit;
}

.cwf-heading-l {
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.04167;
  margin: 0 0 var(--cwf-space-4);
  color: inherit;
}

.cwf-heading-m {
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.31579;
  margin: 0 0 var(--cwf-space-4);
  color: inherit;
}

.cwf-caption {
  display: block;
  color: var(--cwf-secondary);
  font-size: 1.1875rem;
  font-weight: 400;
  margin-bottom: var(--cwf-space-1);
}

/* Caption nested in page title (caption-in-heading). */
.cwf-heading-xl > .cwf-caption {
  margin-bottom: var(--cwf-space-1);
  font-weight: 400;
  color: var(--cwf-secondary);
}

.cwf-body {
  margin: 0 0 var(--cwf-space-4);
}

/* Author markdown (start / exit / confirmation / declaration) */
.cwf-prose > :first-child {
  margin-top: 0;
}

.cwf-prose > :last-child {
  margin-bottom: 0;
}

.cwf-prose p {
  margin: 0 0 var(--cwf-space-4);
}

.cwf-prose ul,
.cwf-prose ol {
  margin: 0 0 var(--cwf-space-4);
  padding-left: 1.25rem;
}

.cwf-prose li {
  margin-bottom: var(--cwf-space-1);
}

.cwf-prose li > ul,
.cwf-prose li > ol {
  margin-top: var(--cwf-space-1);
  margin-bottom: 0;
}

.cwf-prose a {
  color: var(--cwf-link);
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
}

.cwf-prose a:hover {
  color: var(--cwf-link-hover);
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-prose a:visited {
  color: var(--cwf-link-visited);
}

.cwf-prose strong {
  font-weight: 700;
}

.cwf-prose h2,
.cwf-prose h3 {
  color: inherit;
  font-weight: 700;
  margin: 0 0 var(--cwf-space-3);
}

.cwf-prose h2 {
  font-size: 1.5rem;
  line-height: 1.25;
}

.cwf-prose h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
}

.cwf-prose--inline,
.cwf-prose--inline p {
  display: inline;
  margin: 0;
}

.cwf-panel__body.cwf-prose {
  font-size: 1.5rem;
}

.cwf-panel__body.cwf-prose p {
  margin-bottom: var(--cwf-space-3);
}

.cwf-back-link {
  display: inline-block;
  position: relative;
  margin-top: var(--cwf-space-3);
  margin-bottom: var(--cwf-space-3);
  padding-left: 0.875em;
  color: var(--cwf-focus-text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
}

/* Soft-save Back is a submit control — keep back-link look, not button chrome */
.cwf-webform button.cwf-back-link,
.cwf-webform--preview button.cwf-back-link {
  margin-top: var(--cwf-space-3);
  margin-bottom: var(--cwf-space-3);
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0.875em;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.cwf-back-link:hover {
  color: rgba(11, 12, 12, 0.99);
  text-decoration-thickness: max(3px, 0.1875rem, 0.12em);
}

.cwf-back-link:visited {
  color: var(--cwf-focus-text);
}

.cwf-back-link::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.1875em;
  width: 0.4375em;
  height: 0.4375em;
  margin: auto 0;
  transform: rotate(225deg);
  border: solid;
  border-width: max(1px, 0.0625em) max(1px, 0.0625em) 0 0;
  border-color: var(--cwf-secondary);
  font-size: max(16px, 1em);
}

.cwf-back-link:focus::before {
  border-color: var(--cwf-focus-text);
}

/* Larger tap target without changing layout */
.cwf-back-link::after {
  content: "";
  position: absolute;
  top: -14px;
  right: 0;
  bottom: -14px;
  left: 0;
}

.cwf-form-group {
  margin-bottom: var(--cwf-space-4);
}

.cwf-form-group--error {
  border-left: 5px solid var(--cwf-error);
  padding-left: var(--cwf-space-3);
}

.cwf-label {
  display: block;
  font-weight: 400;
  margin-bottom: var(--cwf-space-1);
}

/* Small bold label (e.g. date day/month/year) */
.cwf-label--s {
  font-weight: 700;
}

.cwf-hint {
  color: var(--cwf-secondary);
  margin-bottom: var(--cwf-space-3);
}

.cwf-error-message {
  display: block;
  clear: both;
  color: var(--cwf-error);
  font-weight: 700;
  margin: 0 0 var(--cwf-space-3);
}

/* Form controls — inherit font so theme typography applies.
   Dimensions / focus match frontend form inputs. */
.cwf-webform .cwf-input,
.cwf-webform .cwf-textarea,
.cwf-webform .cwf-select {
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.25;
  box-sizing: border-box;
  color: var(--cwf-text);
  background-color: var(--cwf-surface);
  border: var(--cwf-input-border-width) solid var(--cwf-border-input);
  border-radius: var(--cwf-radius);
  padding: 5px;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  -webkit-appearance: none;
  appearance: none;
}

.cwf-webform .cwf-input,
.cwf-webform .cwf-select {
  height: 2.5rem;
}

.cwf-webform .cwf-textarea {
  display: block;
  height: auto;
  min-height: 8rem;
  resize: vertical;
}

.cwf-webform .cwf-select {
  width: auto;
  min-width: 11.5em;
  max-width: 100%;
}

/* Match select option highlight (IE/Edge legacy + some browsers) */
.cwf-select option:active,
.cwf-select option:checked,
.cwf-select:focus::-ms-value {
  color: var(--cwf-button-text);
  background-color: var(--cwf-link);
}

.cwf-input:focus,
.cwf-textarea:focus,
.cwf-select:focus,
.cwf-file-upload:focus {
  outline: var(--cwf-focus-width) solid var(--cwf-focus);
  outline-offset: 0;
  /* Double the border without changing layout (focused form input) */
  box-shadow: inset 0 0 0 var(--cwf-input-border-width) var(--cwf-border-input);
}

.cwf-input--error,
.cwf-textarea--error,
.cwf-select--error,
.cwf-file-upload--error {
  border-color: var(--cwf-error);
}

/* Error + focus: restore dark border; yellow outline + inset shadow carry the focus state */
.cwf-input--error:focus,
.cwf-textarea--error:focus,
.cwf-select--error:focus,
.cwf-file-upload--error:focus {
  border-color: var(--cwf-border-input);
  box-shadow: inset 0 0 0 var(--cwf-input-border-width) var(--cwf-border-input);
}

.cwf-input:disabled,
.cwf-textarea:disabled,
.cwf-select:disabled {
  opacity: 0.5;
  color: inherit;
  background-color: transparent;
  cursor: not-allowed;
}

/* Fixed character widths — !important so they beat .cwf-input { max-width: 100% }
   and host theme width rules (same approach as input--width-*). */
.cwf-input--width-2 { max-width: 2.75em !important; }
.cwf-input--width-3 { max-width: 3.75em !important; }
.cwf-input--width-4 { max-width: 4.5em !important; }
.cwf-input--width-5 { max-width: 5.5em !important; }
.cwf-input--width-10 { max-width: 11.5em !important; }
.cwf-input--width-20 { max-width: 20.5em !important; }
.cwf-input--width-30 { max-width: 29.5em !important; }

/* GOV.UK-style OTP entry: wider tracking for 5-digit codes */
.cwf-input--extra-letter-spacing {
  letter-spacing: 0.15em;
  font-variant-numeric: tabular-nums;
}

.cwf-label--xl {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.09375;
  margin: 0 0 var(--cwf-space-3);
  display: block;
}

.cwf-details {
  margin-bottom: var(--cwf-space-5);
  font-size: 1.1875rem;
}

.cwf-details__summary {
  color: var(--cwf-link);
  cursor: pointer;
  display: inline-block;
  padding-left: 1.25rem;
  position: relative;
}

.cwf-details__summary:hover {
  color: var(--cwf-link-hover);
}

.cwf-details__summary:focus {
  outline: 3px solid transparent;
  color: var(--cwf-focus-text);
  background-color: var(--cwf-focus);
  box-shadow: 0 -2px var(--cwf-focus), 0 4px var(--cwf-focus-text);
  text-decoration: none;
}

.cwf-details__summary::before {
  content: "";
  position: absolute;
  top: 0.35em;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.35em 0 0.35em 0.55em;
  border-color: transparent transparent transparent currentColor;
}

.cwf-details[open] > .cwf-details__summary::before {
  top: 0.45em;
  left: 0.1em;
  border-width: 0.55em 0.35em 0 0.35em;
  border-color: currentColor transparent transparent transparent;
}

.cwf-details__text {
  margin: var(--cwf-space-3) 0 0;
  padding: var(--cwf-space-3);
  border-left: 5px solid var(--cwf-border-muted);
}

.cwf-details--help {
  margin-top: var(--cwf-space-2);
  margin-bottom: var(--cwf-space-3);
}

.cwf-notification-banner {
  margin-bottom: var(--cwf-space-6);
  border: 5px solid var(--cwf-link);
  background: var(--cwf-surface);
}

.cwf-notification-banner--success {
  border-color: var(--cwf-success);
}

.cwf-notification-banner__header {
  background: var(--cwf-link);
  padding: var(--cwf-space-2) var(--cwf-space-4);
}

.cwf-notification-banner--success .cwf-notification-banner__header {
  background: var(--cwf-success);
}

.cwf-notification-banner__title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  color: #fff;
}

.cwf-notification-banner__content {
  padding: var(--cwf-space-4);
}

.cwf-notification-banner__heading {
  margin: 0 0 var(--cwf-space-2);
  font-size: 1.5rem;
  font-weight: 700;
}

.cwf-notification-banner__body {
  margin: 0;
}

.cwf-form-footer__meta {
  margin-top: var(--cwf-space-4);
}

.cwf-input-wrapper {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.cwf-input-wrapper .cwf-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.cwf-input__prefix,
.cwf-input__suffix {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 5px;
  background-color: var(--cwf-inset);
  border: var(--cwf-input-border-width) solid var(--cwf-border-input);
  color: var(--cwf-secondary);
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  cursor: default;
}

.cwf-input__prefix {
  border-right: 0;
}

.cwf-input__suffix {
  border-left: 0;
}

.cwf-form-group--error .cwf-input__prefix,
.cwf-form-group--error .cwf-input__suffix {
  border-color: var(--cwf-error);
}

.cwf-input-wrapper .cwf-input:focus {
  z-index: 1;
  position: relative;
}

.cwf-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.cwf-fieldset__legend {
  box-sizing: border-box;
  display: table; /* shrink-wrap so focus outline hugs the text */
  max-width: 100%;
  margin-bottom: var(--cwf-space-2);
  padding: 0;
  font-weight: 400;
  white-space: normal;
}

/* Question legends — medium for most questions, larger when the legend is the page h1 */
.cwf-fieldset__legend--s {
  font-weight: 700;
}

.cwf-fieldset__legend--m,
.cwf-fieldset__legend--l,
.cwf-fieldset__legend--xl {
  font-weight: 700;
  margin-bottom: var(--cwf-space-3);
}

.cwf-fieldset__legend--m {
  font-size: 1.125rem;
  line-height: 1.11111;
}

.cwf-fieldset__legend--l {
  font-size: 1.5rem;
  line-height: 1.04167;
}

.cwf-fieldset__legend--xl {
  font-size: 2rem;
  line-height: 1.09375;
}

.cwf-fieldset__heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.cwf-fieldset__legend + .cwf-hint {
  margin-top: -5px;
}

.cwf-fieldset__children {
  margin-top: var(--cwf-space-3);
}

.cwf-radios__item,
.cwf-checkboxes__item {
  display: block;
  position: relative;
  min-height: 40px;
  margin-bottom: var(--cwf-space-2);
  padding-left: 40px;
  clear: left;
}

.cwf-radios__item:last-child,
.cwf-radios__item:last-of-type,
.cwf-checkboxes__item:last-child,
.cwf-checkboxes__item:last-of-type {
  margin-bottom: 0;
}

/* 44×44 hit area; absolutely positioned so host `input { width:100% }` cannot break layout */
.cwf-webform .cwf-radios__input,
.cwf-webform .cwf-checkboxes__input {
  position: absolute;
  z-index: 1;
  top: -2px;
  left: -2px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
}

.cwf-radios__label,
.cwf-checkboxes__label {
  display: inline-block;
  margin-bottom: 0;
  padding: 8px 15px 5px;
  cursor: pointer;
  font-weight: 400;
  touch-action: manipulation;
}

.cwf-radios__label::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: var(--cwf-input-border-width) solid var(--cwf-border-input);
  border-radius: 50%;
  background: transparent;
}

.cwf-radios__label::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 0;
  height: 0;
  border: 10px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  background: currentColor;
}

.cwf-radios__input:checked + .cwf-radios__label::after {
  opacity: 1;
}

/* Radios/checkboxes focus: thicker border + yellow outer ring */
.cwf-radios__input:focus + .cwf-radios__label::before {
  border-width: 4px;
  outline: var(--cwf-focus-width) solid transparent;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--cwf-focus);
}

.cwf-checkboxes__input:focus + .cwf-checkboxes__label::before {
  border-width: 4px;
  outline: var(--cwf-focus-width) solid transparent;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--cwf-focus);
}

.cwf-checkboxes__label::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: var(--cwf-input-border-width) solid var(--cwf-border-input);
  border-radius: var(--cwf-radius);
  background: transparent;
}

.cwf-checkboxes__label::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 11px;
  left: 9px;
  width: 23px;
  height: 12px;
  border: solid;
  border-width: 0 0 5px 5px;
  border-top-color: transparent;
  background: transparent;
  transform: rotate(-45deg);
  opacity: 0;
}

.cwf-checkboxes__input:checked + .cwf-checkboxes__label::after {
  opacity: 1;
}

.cwf-radios__input:disabled,
.cwf-checkboxes__input:disabled,
.cwf-radios__input:disabled + .cwf-radios__label,
.cwf-checkboxes__input:disabled + .cwf-checkboxes__label {
  cursor: not-allowed;
}

.cwf-radios__input:disabled + .cwf-radios__label,
.cwf-checkboxes__input:disabled + .cwf-checkboxes__label,
.cwf-radios__input:disabled ~ .cwf-hint,
.cwf-checkboxes__input:disabled ~ .cwf-hint {
  opacity: 0.5;
}

.cwf-checkboxes__divider {
  display: flex;
  align-items: center;
  gap: var(--cwf-space-2);
  margin: var(--cwf-space-1) 0 var(--cwf-space-3);
  color: var(--cwf-secondary);
  font-weight: 400;
}

.cwf-checkboxes__divider::before,
.cwf-checkboxes__divider::after {
  content: "";
  flex: 1 1 auto;
  border-bottom: 1px solid var(--cwf-border-muted);
}

.cwf-radios__conditional,
.cwf-checkboxes__conditional {
  margin-bottom: var(--cwf-space-3);
  margin-left: 15px;
  padding-left: 30px;
  border-left: 4px solid var(--cwf-border-muted);
}

/* Hint sits in the padded content column (item already has 40px left pad) */
.cwf-radios__hint,
.cwf-checkboxes__hint {
  display: block;
  margin-top: -5px;
  margin-bottom: 0;
  padding-right: 15px;
  padding-left: 15px;
}

.cwf-reveal-text {
  margin-bottom: var(--cwf-space-3);
}

.cwf-reveal-text:last-child {
  margin-bottom: 0;
}

/* !important: browsers may set inline display when focusing invalid controls
   inside a previously-hidden panel (native constraint validation). */
.cwf-radios__conditional--hidden,
.cwf-checkboxes__conditional--hidden,
.cwf-conditional--hidden {
  display: none !important;
}

.cwf-conditional {
  margin-bottom: var(--cwf-space-4);
}

.cwf-repeating__items {
  margin-bottom: var(--cwf-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--cwf-space-5);
}

.cwf-repeating__item {
  margin: 0;
  padding: 0 0 0 var(--cwf-space-3);
  border: 0;
  border-left: 4px solid var(--cwf-border-muted);
}

.cwf-repeating__item--error {
  border-left-color: var(--cwf-error);
}

.cwf-repeating__item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--cwf-space-2) var(--cwf-space-4);
  margin-bottom: var(--cwf-space-3);
}

.cwf-repeating__item-heading {
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0;
  color: inherit;
}

.cwf-repeating__item-body > .cwf-form-group:last-child {
  margin-bottom: 0;
}

.cwf-repeating__actions {
  margin-top: var(--cwf-space-1);
}

.cwf-repeating__add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* display:inline on .cwf-link-button beats the UA [hidden] rule */
.cwf-repeating__remove[hidden],
.cwf-webform button.cwf-repeating__remove[hidden],
.cwf-webform--preview button.cwf-repeating__remove[hidden] {
  display: none !important;
}

.cwf-link-button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent none;
  box-shadow: none;
  color: var(--cwf-link);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Beat host themes that style all button elements as solid buttons */
.cwf-webform button.cwf-link-button,
.cwf-webform--preview button.cwf-link-button {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent none;
  box-shadow: none;
  color: var(--cwf-link);
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
  text-transform: none;
  letter-spacing: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.cwf-link-button:hover,
.cwf-webform button.cwf-link-button:hover,
.cwf-webform--preview button.cwf-link-button:hover {
  color: var(--cwf-link-hover);
  background: transparent none;
  box-shadow: none;
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-link-button:visited,
.cwf-webform button.cwf-link-button:visited,
.cwf-webform--preview button.cwf-link-button:visited {
  color: var(--cwf-link);
}

.cwf-link-button:disabled,
.cwf-link-button[aria-disabled="true"],
.cwf-webform button.cwf-link-button:disabled,
.cwf-webform button.cwf-link-button[aria-disabled="true"] {
  color: var(--cwf-secondary);
  cursor: not-allowed;
  text-decoration: none;
  opacity: 0.7;
  background: transparent none;
  box-shadow: none;
}

.cwf-start-intro,
.cwf-start-before {
  margin-bottom: var(--cwf-space-6);
}

.cwf-date-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.cwf-date-input__item {
  margin-right: var(--cwf-space-4);
  margin-bottom: 0;
}

.cwf-date-input__label {
  font-weight: 700;
}

.cwf-file-upload {
  display: block;
  font-family: inherit;
  font-size: 1.1875rem;
  line-height: 1.25;
  color: var(--cwf-text);
  background: var(--cwf-surface);
  border: var(--cwf-input-border-width) solid var(--cwf-border-input);
  border-radius: var(--cwf-radius);
  max-width: 100%;
  margin-top: var(--cwf-space-2);
  padding: 0.3125rem;
}

.cwf-file-upload--error {
  border-color: var(--cwf-error);
  color: var(--cwf-text);
}

.cwf-file-upload__constraints {
  margin-top: var(--cwf-space-1);
}

.cwf-file-upload__constraint {
  margin: 0 0 var(--cwf-space-1);
}

.cwf-file-upload__banner {
  margin-bottom: var(--cwf-space-4);
}

.cwf-file-upload__banner[hidden] {
  display: none;
}

.cwf-file-upload__banner .cwf-notification-banner {
  margin-bottom: 0;
}

.cwf-file-upload__existing {
  margin-top: var(--cwf-space-2);
  margin-bottom: var(--cwf-space-2);
  font-weight: 700;
}

.cwf-file-upload__existing-block {
  margin: var(--cwf-space-2) 0;
}

.cwf-file-upload__files {
  margin: var(--cwf-space-4) 0;
}

.cwf-file-upload__files-heading {
  margin: 0 0 var(--cwf-space-3);
  font-weight: 700;
  color: var(--cwf-text);
}

.cwf-file-upload__summary {
  margin: 0;
}

.cwf-file-upload__summary .cwf-summary-list__actions {
  width: 25%;
  text-align: right;
  white-space: nowrap;
}

.cwf-file-upload__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--cwf-border-muted);
}

.cwf-file-upload__list-item {
  margin-bottom: var(--cwf-space-1);
}

.cwf-summary-list__row.cwf-file-upload__item[data-cwf-file-status="uploading"] {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 221, 0, 0.35),
    transparent
  );
  background-size: 200% 100%;
  animation: cwf-file-upload-pulse 1.4s ease-in-out infinite;
}

.cwf-summary-list__row.cwf-file-upload__item[data-cwf-file-status="error"] {
  background: rgba(212, 53, 28, 0.06);
}

.cwf-file-upload__item-value {
  display: flex;
  align-items: flex-start;
  gap: var(--cwf-space-3);
}

.cwf-file-upload__item-preview {
  flex: 0 0 auto;
  width: 3.75rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cwf-inset);
  border: 1px solid var(--cwf-border-muted);
  border-radius: var(--cwf-radius);
  overflow: hidden;
}

.cwf-file-upload__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cwf-file-upload__icon {
  display: block;
  width: 1.5rem;
  height: 1.875rem;
  border: 2px solid var(--cwf-secondary);
  border-radius: 0.15rem;
  position: relative;
  background:
    linear-gradient(var(--cwf-secondary), var(--cwf-secondary)) center 0.55rem / 0.85rem 2px no-repeat,
    linear-gradient(var(--cwf-secondary), var(--cwf-secondary)) center 0.95rem / 0.85rem 2px no-repeat,
    linear-gradient(var(--cwf-secondary), var(--cwf-secondary)) center 1.35rem / 0.55rem 2px no-repeat;
}

.cwf-file-upload__icon::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 0.65rem;
  height: 0.65rem;
  background:
    linear-gradient(135deg, transparent 50%, var(--cwf-secondary) 50%),
    linear-gradient(var(--cwf-inset), var(--cwf-inset));
  background-size: 100% 100%, 0.45rem 0.45rem;
  background-position: top right, top right;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 2px var(--cwf-secondary);
}

.cwf-file-upload__item-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cwf-file-upload__item-name {
  font-weight: 700;
  word-break: break-word;
  line-height: 1.3;
}

.cwf-file-upload__item-size {
  font-size: 1rem;
  color: var(--cwf-secondary);
}

.cwf-file-upload__item-status {
  display: inline-block;
  width: fit-content;
  margin-top: var(--cwf-space-1);
  padding: 2px 8px 3px;
  font-size: var(--cwf-body-size);
  font-weight: 700;
  line-height: var(--cwf-body-line);
  color: var(--cwf-tag-green-text);
  background-color: var(--cwf-tag-green-bg);
  border: 0;
  text-decoration: none;
  overflow-wrap: break-word;
}

.cwf-file-upload__item[data-cwf-file-status="uploading"] .cwf-file-upload__item-status {
  color: var(--cwf-tag-yellow-text);
  background-color: var(--cwf-tag-yellow-bg);
}

.cwf-file-upload__item[data-cwf-file-status="error"] .cwf-file-upload__item-status {
  color: var(--cwf-tag-red-text);
  background-color: var(--cwf-tag-red-bg);
}

.cwf-file-upload__item-actions {
  align-self: center;
}

.cwf-file-upload__remove {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: var(--cwf-space-2);
  font-weight: 400;
  font-size: 1rem;
  cursor: pointer;
}

.cwf-file-upload__remove-btn {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.cwf-file-upload-wrapper {
  display: block;
  position: relative;
  z-index: 0;
  margin-top: var(--cwf-space-2);
  background-color: var(--cwf-surface);
}

.cwf-file-upload-wrapper--disabled {
  cursor: not-allowed;
}

/* frontend 5.9+ improved file upload (cwf- namespace) */
.cwf-file-upload-wrapper--enhanced .cwf-file-upload {
  /* Native input stays in DOM for form posts / accept / multiple;
     visually replaced by .cwf-file-upload-button when JS runs. */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.cwf-file-upload-button__pseudo-button {
  width: auto;
  margin-right: var(--cwf-space-2);
  margin-bottom: calc(var(--cwf-input-border-width) + 1px);
  flex-shrink: 0;
}

.cwf-file-upload-button__instruction {
  margin-top: calc(var(--cwf-space-2) - var(--cwf-input-border-width) - 1px);
  margin-bottom: 0;
  text-align: left;
  font-size: var(--cwf-body-size);
  line-height: var(--cwf-body-line);
  color: var(--cwf-text);
}

.cwf-file-upload-button__status {
  display: block;
  margin-bottom: var(--cwf-space-2);
  padding: var(--cwf-space-3) var(--cwf-space-2);
  color: #ffffff;
  background-color: var(--cwf-link);
  text-align: left;
  font-size: var(--cwf-body-size);
  line-height: var(--cwf-body-line);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.cwf-file-upload-button__pseudo-button-container {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
}

.cwf-file-upload-button {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  /* Match notification banner / error summary padding, accounting for border */
  padding: calc(var(--cwf-space-3) + var(--cwf-input-border-width) - 2px);
  border: 2px solid var(--cwf-border-muted);
  border-radius: var(--cwf-radius);
  background-color: var(--cwf-surface);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 40.0625em) {
  .cwf-file-upload-button {
    padding: calc(var(--cwf-space-4) + var(--cwf-input-border-width) - 2px);
  }
}

.cwf-form-group--error .cwf-file-upload-button {
  border-style: solid;
  border-color: var(--cwf-error);
}

.cwf-file-upload-button .cwf-file-upload-button__pseudo-button {
  background-color: var(--cwf-inset);
  box-shadow: 0 var(--cwf-shadow-width) 0 var(--cwf-button-secondary-shadow);
  margin: 0 var(--cwf-space-2) calc(var(--cwf-input-border-width) + 1px) 0;
}

.cwf-file-upload-button:hover {
  border-style: dashed;
  border-color: #757575;
}

.cwf-file-upload-button:hover .cwf-file-upload-button__pseudo-button {
  background-color: var(--cwf-border-muted);
}

.cwf-file-upload-button:hover .cwf-file-upload-button__status {
  background-color: var(--cwf-link);
}

.cwf-file-upload-button:active,
.cwf-file-upload-button:focus {
  border: 2px solid var(--cwf-focus-text);
  outline: var(--cwf-focus-width) solid var(--cwf-focus);
  outline-offset: 0;
  background-color: var(--cwf-inset);
  box-shadow: inset 0 0 0 var(--cwf-input-border-width);
}

.cwf-file-upload-button:active .cwf-file-upload-button__pseudo-button,
.cwf-file-upload-button:focus .cwf-file-upload-button__pseudo-button {
  background-color: var(--cwf-focus);
  color: var(--cwf-focus-text);
  box-shadow: 0 var(--cwf-shadow-width) 0 var(--cwf-focus-text);
}

.cwf-file-upload-button:focus:hover .cwf-file-upload-button__pseudo-button {
  border-color: var(--cwf-focus);
  outline: 3px solid transparent;
  background-color: var(--cwf-border-muted);
  color: var(--cwf-focus-text);
  box-shadow: inset 0 0 0 1px var(--cwf-focus);
}

.cwf-file-upload-button--empty {
  border-style: dashed;
  background-color: var(--cwf-surface);
}

.cwf-file-upload-button--empty .cwf-file-upload-button__pseudo-button {
  background-color: var(--cwf-inset);
}

.cwf-file-upload-button--empty .cwf-file-upload-button__status {
  color: var(--cwf-focus-text);
  background-color: var(--cwf-tag-blue-bg);
}

.cwf-file-upload-button--empty:hover,
.cwf-file-upload-button--empty:focus,
.cwf-file-upload-button--empty:active {
  background-color: var(--cwf-inset);
}

.cwf-file-upload-button--empty:hover .cwf-file-upload-button__status,
.cwf-file-upload-button--empty:focus .cwf-file-upload-button__status,
.cwf-file-upload-button--empty:active .cwf-file-upload-button__status {
  background-color: var(--cwf-tag-blue-bg);
}

.cwf-file-upload-button--dragging {
  border-style: solid;
  border-color: var(--cwf-focus-text);
}

.cwf-file-upload-button--dragging.cwf-file-upload-button--empty {
  background-color: var(--cwf-inset);
}

.cwf-file-upload-button:disabled {
  pointer-events: none;
  opacity: 0.5;
  background-color: var(--cwf-surface);
}

.cwf-file-upload-button:disabled .cwf-file-upload-button__pseudo-button {
  background-color: var(--cwf-inset);
}

.cwf-file-upload-button:disabled .cwf-file-upload-button__status {
  background-color: var(--cwf-tag-blue-bg);
}

.cwf-file-upload--js .cwf-file-upload__remove--noscript {
  display: none;
}

.cwf-file-upload--js .cwf-file-upload__remove-btn[hidden] {
  display: none;
}

.cwf-file-upload--js .cwf-file-upload__remove-btn:not([hidden]) {
  display: inline;
}

@keyframes cwf-file-upload-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.cwf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: auto;
  min-height: 2.5rem;
  margin: 0 0 var(--cwf-space-6);
  padding: 0.5rem 1.25rem 0.4375rem;
  border: var(--cwf-input-border-width) solid transparent;
  border-radius: var(--cwf-radius);
  color: var(--cwf-button-text);
  background: var(--cwf-button);
  box-shadow: 0 var(--cwf-shadow-width) 0 var(--cwf-button-shadow);
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.1875;
  text-align: center;
  text-decoration: none !important;
  vertical-align: top;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--cwf-transition), color var(--cwf-transition), box-shadow var(--cwf-transition), top var(--cwf-transition);
}

.cwf-button:link,
.cwf-button:visited {
  color: var(--cwf-button-text);
}

.cwf-button:hover {
  background: var(--cwf-button-hover);
  color: var(--cwf-button-text);
}

.cwf-button:focus {
  border-color: var(--cwf-focus-text);
  outline: var(--cwf-focus-width) solid transparent;
  box-shadow: inset 0 0 0 1px var(--cwf-focus-text);
  background: var(--cwf-focus);
  color: var(--cwf-focus-text);
}

.cwf-button:focus:not(:active):not(:hover) {
  border-color: var(--cwf-focus-text);
  color: var(--cwf-focus-text);
  background-color: var(--cwf-focus);
  box-shadow: 0 var(--cwf-shadow-width) 0 var(--cwf-focus-text);
}

.cwf-button:active {
  top: var(--cwf-shadow-width);
  box-shadow: none;
}

.cwf-button:disabled,
.cwf-button[aria-disabled="true"],
.cwf-button.cwf-button--disabled {
  opacity: 0.5;
  background: var(--cwf-button);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.cwf-button--secondary {
  background: var(--cwf-button-secondary);
  color: var(--cwf-button-secondary-text);
  box-shadow: 0 var(--cwf-shadow-width) 0 var(--cwf-button-secondary-shadow);
}

.cwf-button--secondary:link,
.cwf-button--secondary:visited {
  color: var(--cwf-button-secondary-text);
}

.cwf-button--secondary:hover {
  background: var(--cwf-button-secondary-hover);
  color: var(--cwf-button-secondary-text);
}

.cwf-button--secondary:focus:not(:active):not(:hover),
.cwf-button--secondary:focus {
  color: var(--cwf-focus-text);
  background: var(--cwf-focus);
}

.cwf-button--secondary:disabled,
.cwf-button--secondary[aria-disabled="true"] {
  background: var(--cwf-button-secondary);
}

/* Secondary fill matches --cwf-inset; use surface so buttons stay visible on grey panels */
.cwf-save__panel .cwf-button--secondary,
.cwf-panel--neutral .cwf-button--secondary {
  background: var(--cwf-surface);
}

.cwf-save__panel .cwf-button--secondary:hover,
.cwf-panel--neutral .cwf-button--secondary:hover {
  background: var(--cwf-button-secondary-hover);
}

.cwf-save__panel .cwf-button--secondary:disabled,
.cwf-save__panel .cwf-button--secondary[aria-disabled="true"],
.cwf-panel--neutral .cwf-button--secondary:disabled,
.cwf-panel--neutral .cwf-button--secondary[aria-disabled="true"] {
  background: var(--cwf-surface);
}

.cwf-button--warning {
  background: var(--cwf-button-warning);
  color: var(--cwf-button-text);
  box-shadow: 0 var(--cwf-shadow-width) 0 var(--cwf-button-warning-shadow);
}

.cwf-button--warning:link,
.cwf-button--warning:visited {
  color: var(--cwf-button-text);
}

.cwf-button--warning:hover {
  background: var(--cwf-button-warning-hover);
  color: var(--cwf-button-text);
}

.cwf-button--warning:disabled,
.cwf-button--warning[aria-disabled="true"] {
  background: var(--cwf-button-warning);
}

.cwf-button__start-icon {
  display: inline-block;
  margin-left: var(--cwf-space-2);
  flex-shrink: 0;
  align-self: center;
  vertical-align: middle;
  pointer-events: none;
}

.cwf-button__start-icon[hidden],
.cwf-button:not(.cwf-button--start) .cwf-button__start-icon {
  display: none;
}

.cwf-button svg,
.cwf-accordion__icon {
  flex-shrink: 0;
}

.cwf-error-summary {
  border: 5px solid var(--cwf-error);
  padding: var(--cwf-space-4);
  margin-bottom: var(--cwf-space-6);
  scroll-margin-top: var(--cwf-space-4);
}

.cwf-error-summary__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--cwf-space-3);
  color: inherit;
}

.cwf-error-summary__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cwf-error-summary__list a {
  color: var(--cwf-error);
  font-weight: 700;
}

.cwf-error-summary__list li {
  margin-bottom: var(--cwf-space-1);
}

.cwf-summary-list {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0 0 var(--cwf-space-6);
  font-size: 1.1875rem;
  line-height: 1.31579;
  color: inherit;
}

.cwf-summary-section {
  margin: var(--cwf-space-6) 0 var(--cwf-space-2);
}

.cwf-summary-section:first-of-type {
  margin-top: var(--cwf-space-4);
}

.cwf-summary-list__row {
  display: table-row;
  border-bottom: 1px solid var(--cwf-border-muted);
}

.cwf-summary-list__key,
.cwf-summary-list__value,
.cwf-summary-list__actions {
  display: table-cell;
  padding-top: var(--cwf-space-2);
  padding-right: var(--cwf-space-4);
  padding-bottom: var(--cwf-space-2);
  margin: 0;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cwf-summary-list__key {
  width: 30%;
  font-weight: 700;
}

.cwf-summary-list__value {
  width: 50%;
}

.cwf-summary-list__actions {
  width: 20%;
  padding-right: 0;
  text-align: right;
}

.cwf-summary-list__actions a {
  color: var(--cwf-link);
  font-family: inherit;
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
}

.cwf-summary-list__actions a:hover {
  color: var(--cwf-link-hover);
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-summary-repeating {
  margin: 0;
}

.cwf-summary-repeating-label {
  margin: 0 0 var(--cwf-space-3);
}

.cwf-summary-card {
  margin: 0 0 var(--cwf-space-4);
  border: 1px solid var(--cwf-border-muted);
  background: #fff;
}

.cwf-summary-card:last-child {
  margin-bottom: 0;
}

.cwf-summary-card__title-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--cwf-space-2) var(--cwf-space-4);
  padding: var(--cwf-space-3) var(--cwf-space-4);
  border-bottom: 1px solid var(--cwf-border-muted);
  background: var(--cwf-inset);
}

.cwf-summary-card__title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.31579;
}

.cwf-summary-card__actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--cwf-space-2) var(--cwf-space-4);
}

.cwf-summary-card__action {
  margin: 0;
}

.cwf-summary-card__action a {
  color: var(--cwf-link);
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
}

.cwf-summary-card__action a:hover {
  color: var(--cwf-link-hover);
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-summary-card__content {
  padding: 0 var(--cwf-space-4);
}

.cwf-summary-list--card {
  margin: 0;
}

.cwf-summary-list--card .cwf-summary-list__row {
  border-bottom-color: var(--cwf-border-muted);
}

.cwf-summary-list--card .cwf-summary-list__row:last-child {
  border-bottom: 0;
}

.cwf-summary-list__row--group .cwf-summary-card__group {
  font-weight: 700;
  color: var(--cwf-text);
}

.cwf-summary-repeating__item {
  margin: 0 0 var(--cwf-space-3);
}

.cwf-summary-repeating__item:last-child {
  margin-bottom: 0;
}

.cwf-summary-repeating__heading {
  margin: 0 0 var(--cwf-space-1);
  font-weight: 700;
  font-size: 1rem;
}

.cwf-summary-repeating__fields {
  margin: 0;
  padding: 0 0 0 var(--cwf-space-3);
  border-left: 3px solid var(--cwf-border-muted);
}

.cwf-summary-repeating__group-label {
  margin: var(--cwf-space-2) 0 var(--cwf-space-1);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--cwf-text);
}

.cwf-summary-repeating__group-label:first-child {
  margin-top: 0;
}

.cwf-summary-repeating__field {
  display: grid;
  /* Side by side when there is room; stacked in narrow cards so keys never break mid-word. */
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--cwf-space-1) var(--cwf-space-3);
  margin: 0 0 var(--cwf-space-1);
}

.cwf-summary-repeating__field:last-child {
  margin-bottom: 0;
}

.cwf-summary-repeating__key {
  margin: 0;
  font-weight: 400;
  color: var(--cwf-secondary);
  hyphens: auto;
}

.cwf-summary-repeating__value {
  margin: 0;
}

/* Accessible autocomplete (select enhance) */
.cwf-autocomplete__controls {
  position: relative;
  max-width: 100%;
}

.cwf-autocomplete__select--enhanced {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.cwf-autocomplete__enhanced {
  position: relative;
}

.cwf-autocomplete__input {
  width: 100%;
}

.cwf-autocomplete__menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 14rem;
  overflow-y: auto;
  border: 2px solid var(--cwf-border-input);
  border-top: 0;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cwf-autocomplete__option {
  margin: 0;
  padding: var(--cwf-space-2) var(--cwf-space-3);
  cursor: pointer;
  border-bottom: 1px solid var(--cwf-border-muted);
}

.cwf-autocomplete__option:last-child {
  border-bottom: 0;
}

.cwf-autocomplete__option--focused,
.cwf-autocomplete__option:hover {
  background: var(--cwf-link);
  color: #fff;
}

.cwf-autocomplete__option--empty,
.cwf-autocomplete__option--empty:hover {
  cursor: default;
  background: #fff;
  color: var(--cwf-secondary);
}

/* leave this page (safety) — sticky, discreet, top-right */
.cwf-exit-this-page {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  margin: 0 0 var(--cwf-space-2);
  padding: var(--cwf-space-2) var(--cwf-space-3) 0;
}

.cwf-exit-this-page__link {
  display: inline-block;
  padding: var(--cwf-space-1) var(--cwf-space-3);
  background: var(--cwf-text-strong);
  color: #fff !important;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none !important;
  border: 0;
  box-shadow: none;
}

.cwf-exit-this-page__link:hover,
.cwf-exit-this-page__link:active {
  background: #333;
  color: #fff !important;
}

.cwf-exit-this-page__link:focus {
  outline: 3px solid transparent;
  box-shadow: 0 0 0 3px var(--cwf-focus), 0 0 0 6px var(--cwf-text-strong);
  background: var(--cwf-text-strong);
  color: #fff !important;
}

.cwf-summary-files {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.cwf-summary-files__item {
  margin: 0;
  padding: 0;
  word-break: break-word;
}

.cwf-summary-files__item + .cwf-summary-files__item {
  margin-top: var(--cwf-space-1);
}

.cwf-inset-text {
  border-left: 10px solid var(--cwf-border-muted);
  padding: var(--cwf-space-3);
  margin: 0 0 var(--cwf-space-6);
}

.cwf-html-content {
  margin: 0 0 var(--cwf-space-6);
}

.cwf-warning-callout {
  position: relative;
  margin: 0 0 var(--cwf-space-6);
  padding: var(--cwf-space-4) var(--cwf-space-4) var(--cwf-space-4) calc(var(--cwf-space-4) + 6px);
  background-color: var(--cwf-warning-callout-bg);
  border: 1px solid var(--cwf-border-muted);
  border-left: 0;
  color: var(--cwf-text);
}

.cwf-warning-callout::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--cwf-warning-callout-border);
}

.cwf-warning-callout__heading {
  margin: 0 0 var(--cwf-space-2);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cwf-text);
}

.cwf-warning-callout__body {
  margin: 0;
  color: var(--cwf-text);
}

.cwf-warning-callout__body > :first-child {
  margin-top: 0;
}

.cwf-warning-callout__body > :last-child {
  margin-bottom: 0;
}

.cwf-warning-callout__heading + .cwf-warning-callout__body {
  margin-top: 0;
}

@media print {
  .cwf-warning-callout {
    border: 1px solid #000;
    background: transparent;
    page-break-inside: avoid;
  }

  .cwf-warning-callout::before {
    background: #000;
  }
}

.cwf-step-progress {
  margin-bottom: var(--cwf-space-2);
}

.cwf-interruption-content {
  margin-bottom: var(--cwf-space-6);
}

.cwf-task-list {
  list-style: none;
  margin: 0 0 var(--cwf-space-4);
  padding: 0;
  font-size: var(--cwf-body-size);
  line-height: var(--cwf-body-line);
}

.cwf-task-list__status-heading {
  margin-top: var(--cwf-space-4);
  margin-bottom: var(--cwf-space-2);
}

.cwf-task-list__summary {
  margin-bottom: var(--cwf-space-4);
}

.cwf-task-list__summary .cwf-body {
  margin-top: 0;
  margin-bottom: var(--cwf-space-2);
}

.cwf-task-list__summary .cwf-body:last-child {
  margin-bottom: 0;
}

.cwf-task-list__section {
  margin: 0;
  padding: 0;
  border: 0;
}

.cwf-task-list__group-heading {
  margin-top: 0;
  margin-bottom: var(--cwf-space-3);
}

/* Subsequent sections: space after the previous task list */
.cwf-task-list + .cwf-task-list__section,
.cwf-task-list__section + .cwf-task-list__section,
.cwf-task-list__section + .cwf-task-list {
  margin-top: var(--cwf-space-6);
}

.cwf-task-list__item {
  display: table;
  position: relative;
  width: 100%;
  margin-bottom: 0;
  padding-top: var(--cwf-space-2);
  padding-bottom: var(--cwf-space-2);
  border-bottom: 1px solid var(--cwf-border-muted);
}

.cwf-task-list__item:first-child {
  border-top: 1px solid var(--cwf-border-muted);
}

.cwf-task-list__item--with-link:hover {
  background-color: var(--cwf-inset);
}

.cwf-task-list__item--with-link:focus-within {
  outline: var(--cwf-focus-width) solid var(--cwf-focus);
  outline-offset: 0;
  background-color: var(--cwf-focus);
}

.cwf-task-list__item--with-link:focus-within .cwf-task-list__link {
  color: var(--cwf-focus-text);
  background: transparent;
  box-shadow: none;
  outline: none;
  text-decoration: none;
}

.cwf-task-list__item--with-link:focus-within .cwf-task-list__hint,
.cwf-task-list__item--with-link:focus-within .cwf-task-list__status {
  color: var(--cwf-focus-text);
}

.cwf-task-list__name-and-hint {
  display: table-cell;
  vertical-align: top;
  color: var(--cwf-focus-text);
}

.cwf-task-list__link {
  font-weight: 700;
  font-size: inherit;
  line-height: inherit;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
}

/* Stretch hit area to the whole row (: whole row linked) */
.cwf-task-list__link::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.cwf-task-list__name {
  display: inline-block;
  font-weight: 700;
  font-size: inherit;
  line-height: inherit;
  color: var(--cwf-focus-text);
}

/* Locked tasks: keep the name bold/primary so it still reads as a title.
   Only the status (and hint) use secondary colour — accessible pattern. */

.cwf-task-list__status-text {
  font-size: inherit;
  line-height: inherit;
  font-weight: 400;
  color: var(--cwf-focus-text);
}

.cwf-task-list__status-text--cannot-start {
  color: var(--cwf-secondary);
}

.cwf-task-list__link:hover {
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-task-list__hint {
  margin-top: var(--cwf-space-1);
  margin-bottom: 0;
  color: var(--cwf-secondary);
  font-size: inherit;
  line-height: inherit;
}

.cwf-task-list__status {
  display: table-cell;
  padding-left: var(--cwf-space-2);
  text-align: right;
  vertical-align: top;
  width: 1%;
  white-space: nowrap;
  color: var(--cwf-focus-text);
}

/* Task-list tags: darker text on lighter fill (frontend v5 / sentence case) */
.cwf-task-list__status .cwf-tag {
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
}

/* Status tags — fill-only chips (no border) */
.cwf-tag {
  display: inline-block;
  max-width: 160px;
  margin-top: -2px;
  margin-bottom: -3px;
  padding: 2px 8px 3px;
  font-size: var(--cwf-body-size);
  font-weight: 700;
  line-height: var(--cwf-body-line);
  color: var(--cwf-tag-blue-text);
  background-color: var(--cwf-tag-blue-bg);
  border: 0;
  border-radius: var(--cwf-radius);
  text-decoration: none;
  overflow-wrap: break-word;
}

.cwf-tag--blue {
  color: var(--cwf-tag-blue-text);
  background-color: var(--cwf-tag-blue-bg);
}

.cwf-tag--grey {
  color: var(--cwf-tag-grey-text);
  background-color: var(--cwf-tag-grey-bg);
}

.cwf-tag--green {
  color: var(--cwf-tag-green-text);
  background-color: var(--cwf-tag-green-bg);
}

.cwf-tag--yellow {
  color: var(--cwf-tag-yellow-text);
  background-color: var(--cwf-tag-yellow-bg);
}

.cwf-tag--red {
  color: var(--cwf-tag-red-text);
  background-color: var(--cwf-tag-red-bg);
}

.cwf-panel {
  background: var(--cwf-success);
  color: var(--cwf-success-text);
  padding: var(--cwf-space-6);
  text-align: center;
  margin-bottom: var(--cwf-space-6);
  border-radius: var(--cwf-radius);
}

.cwf-panel--neutral {
  background: var(--cwf-inset);
  color: var(--cwf-text);
  border: 1px solid var(--cwf-border-muted);
  text-align: left;
}

.cwf-panel--neutral .cwf-panel__title {
  color: var(--cwf-text);
}

.cwf-exit {
  margin-top: 0;
}

.cwf-exit-form {
  margin-top: 0;
}

.cwf-button--exit {
  margin-top: 0;
}

.cwf-exit noscript .cwf-exit-form {
  margin-top: var(--cwf-space-2);
}

.cwf-resume-entry {
  margin: 0 0 var(--cwf-space-5);
}

.cwf-resume-entry.cwf-inset-text {
  margin-bottom: var(--cwf-space-5);
}

.cwf-resume-entry .cwf-body {
  margin-bottom: var(--cwf-space-2);
}

.cwf-resume-entry .cwf-body:last-child {
  margin-bottom: 0;
}

.cwf-secondary-actions {
  margin-top: var(--cwf-space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--cwf-space-3);
}

.cwf-secondary-actions__item,
.cwf-secondary-actions .cwf-save__trigger,
.cwf-secondary-actions .cwf-exit > p {
  margin: 0;
}

.cwf-secondary-actions .cwf-save {
  margin-top: 0;
  width: 100%;
}

.cwf-secondary-actions .cwf-exit {
  width: 100%;
}

/* Exit confirm dialog */
.cwf-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--cwf-space-4);
}

.cwf-dialog[hidden] {
  display: none;
}

/*
 * Exit open controls are progressive enhancement: hide until .cwf-js is set so
 * noscript fallbacks remain the only control without JavaScript. Once JS runs
 * (early in webforms.js), controls are visible without waiting for initExitConfirm.
 */
html:not(.cwf-js) [data-cwf-exit-open] {
  display: none !important;
}

.cwf-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: var(--cwf-overlay);
}

.cwf-dialog__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  background: var(--cwf-surface);
  border: 5px solid var(--cwf-text);
  border-radius: var(--cwf-radius);
  padding: var(--cwf-space-5);
  box-shadow: 0 0 0 1px var(--cwf-surface);
}

.cwf-dialog__title {
  margin: 0 0 var(--cwf-space-3);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.cwf-dialog__body {
  margin: 0 0 var(--cwf-space-4);
  font-size: 1.1875rem;
}

.cwf-dialog .cwf-button-group {
  margin-top: 0;
}

.cwf-dialog .cwf-exit-form {
  display: inline;
}

.cwf-save {
  margin-top: var(--cwf-space-4);
}

.cwf-save__trigger {
  margin: 0;
}

.cwf-save-exit-form {
  display: inline;
  margin: 0;
}

.cwf-save__panel {
  margin-top: var(--cwf-space-3);
  padding: var(--cwf-space-5);
  border-left: 5px solid var(--cwf-border);
  background: var(--cwf-inset);
}

.cwf-save__panel--hidden {
  display: none;
}

.cwf-save .cwf-heading-m {
  margin-top: 0;
}

.cwf-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cwf-space-3);
  align-items: center;
  margin-top: var(--cwf-space-4);
}

.cwf-secondary-actions {
  margin-top: var(--cwf-space-6);
}

.cwf-secondary-actions__item {
  margin: 0;
}

.cwf-secondary-actions__item + .cwf-secondary-actions__item,
.cwf-secondary-actions form + .cwf-secondary-actions__item,
.cwf-secondary-actions .cwf-hint + .cwf-secondary-actions__item {
  margin-top: var(--cwf-space-3);
}

.cwf-secondary-actions .cwf-hint {
  margin: 0 0 var(--cwf-space-2);
}

.cwf-button-group .cwf-button,
.cwf-button-group .cwf-link-button,
.cwf-button-group .cwf-link,
.cwf-button-group a {
  margin-top: 0;
  margin-bottom: 0;
}

.cwf-button-group .cwf-exit-form {
  display: inline;
  margin: 0;
}

.cwf-panel__title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 var(--cwf-space-3);
  color: inherit;
}

.cwf-panel__body {
  margin: 0;
  font-size: 1.5rem;
}

.cwf-panel__reference {
  margin: var(--cwf-space-5) 0 0;
  font-size: 1.1875rem;
  line-height: 1.31579;
}

.cwf-panel__reference-value {
  display: block;
  margin-top: var(--cwf-space-2);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.cwf-what-happens-next {
  margin-bottom: var(--cwf-space-6);
}

.cwf-address-lookup {
  margin-bottom: var(--cwf-space-4);
}

.cwf-address-lookup[data-cwf-address-mode="search"],
.cwf-address-lookup[data-cwf-address-mode="results"] {
  padding-bottom: var(--cwf-space-4);
  border-bottom: 1px solid var(--cwf-border-muted);
  margin-bottom: var(--cwf-space-4);
}

.cwf-address-lookup[data-cwf-address-mode="confirmed"] {
  margin-bottom: var(--cwf-space-2);
  padding-bottom: 0;
  border-bottom: 0;
}

.cwf-address-lookup[data-cwf-address-mode="manual"] {
  margin-bottom: var(--cwf-space-3);
  padding-bottom: 0;
  border-bottom: 0;
}

.cwf-address-lookup__search > .cwf-form-group {
  margin-bottom: 0;
}

/*  Find address stacked under postcode (secondary when Continue is primary) */
.cwf-address-lookup__find {
  display: block;
  margin-top: var(--cwf-space-3);
}

.cwf-address-lookup__find[aria-busy="true"] {
  opacity: 0.72;
  cursor: wait;
}

.cwf-address-lookup__status:not([hidden]),
.cwf-address-lookup__error:not([hidden]) {
  display: block;
  margin-top: var(--cwf-space-2);
}

.cwf-address-lookup__results {
  margin-top: var(--cwf-space-4);
}

.cwf-address-lookup__results .cwf-select {
  width: 100%;
  max-width: 100%;
}

.cwf-select.cwf-select--error,
.cwf-address-lookup__results .cwf-select--error {
  border-color: var(--cwf-error);
}

.cwf-address-lookup__actions {
  margin: var(--cwf-space-3) 0 0;
}

.cwf-address-lookup__actions + .cwf-address-lookup__actions {
  margin-top: var(--cwf-space-2);
}

/* prefilled-value-list / check-answers style */
.cwf-address-answer {
  margin: 0;
}

.cwf-address-answer__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cwf-space-2) var(--cwf-space-4);
  padding: var(--cwf-space-3) 0;
  border-bottom: 1px solid var(--cwf-border-muted);
}

.cwf-address-answer__row:first-child {
  padding-top: 0;
}

.cwf-address-answer__key {
  flex: 0 0 8rem;
  max-width: 100%;
  font-weight: 700;
  color: var(--cwf-text);
}

.cwf-address-answer__value {
  flex: 1 1 12rem;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--cwf-space-2) var(--cwf-space-4);
}

.cwf-address-answer__change {
  flex: 0 0 auto;
  margin: 0;
}

.cwf-address-answer__actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--cwf-space-2) var(--cwf-space-4);
  flex: 0 0 auto;
}

.cwf-address-answer__actions li {
  margin: 0;
}

.cwf-address-lookup__intro {
  margin-top: 0;
}

.cwf-radios--address {
  margin-top: var(--cwf-space-2);
}

.cwf-summary-list__action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--cwf-space-2) var(--cwf-space-3);
  justify-content: flex-end;
}

.cwf-summary-list__action-list li {
  margin: 0;
}

.cwf-address-confirmed__text {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.4;
}

.cwf-address-manual {
  margin-top: var(--cwf-space-2);
}

.cwf-address-manual__legend {
  margin: 0 0 var(--cwf-space-3);
}

.cwf-address-manual[hidden] {
  display: none !important;
}

.cwf-notification {
  border: 5px solid var(--cwf-success);
  padding: var(--cwf-space-4);
  margin-bottom: var(--cwf-space-6);
}

.cwf-notification__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--cwf-space-2);
  color: inherit;
}

.cwf-form-footer {
  margin-top: var(--cwf-space-8);
  padding-top: var(--cwf-space-5);
  border-top: 1px solid var(--cwf-border-muted);
  color: var(--cwf-secondary);
  font-size: 1rem;
}

.cwf-form-footer__heading {
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--cwf-text);
  margin: 0 0 var(--cwf-space-3);
}

.cwf-form-footer__list {
  margin: 0 0 var(--cwf-space-4);
  padding: 0;
  list-style: none;
}

.cwf-form-footer__list li {
  margin-bottom: var(--cwf-space-2);
}

.cwf-form-footer__privacy {
  margin: 0;
}

.cwf-link {
  color: var(--cwf-link);
  font-family: inherit;
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
}

.cwf-link:hover {
  color: var(--cwf-link-hover);
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-link:visited {
  color: var(--cwf-link-visited);
}

.cwf-exit-content {
  margin-bottom: var(--cwf-space-5);
}

.cwf-exit-ctas {
  margin: var(--cwf-space-5) 0;
}

.cwf-exit-cta-error {
  margin-bottom: var(--cwf-space-4);
}

.cwf-exit-notice {
  margin-top: var(--cwf-space-5);
  color: var(--cwf-secondary);
}

.cwf-payment-amount {
  margin: var(--cwf-space-5) 0;
}

.cwf-payment-amount__label {
  display: block;
  margin-bottom: var(--cwf-space-1);
  color: var(--cwf-secondary);
}

.cwf-payment-amount__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.cwf-payment-paid {
  margin-bottom: var(--cwf-space-5);
}

.cwf-input--locked,
.cwf-select--locked {
  background-color: var(--cwf-inset);
  color: var(--cwf-secondary);
  cursor: not-allowed;
}

.cwf-hint--locked {
  margin-top: var(--cwf-space-2);
}

.cwf-summary-list__locked {
  color: var(--cwf-secondary);
  font-size: 0.875rem;
}

.cwf-payment-element {
  margin-top: var(--cwf-space-4);
}

.cwf-payment-element__mount {
  margin-bottom: var(--cwf-space-5);
  min-height: 2.5rem;
}

.cwf-captcha__widget {
  margin-top: var(--cwf-space-2);
  min-height: 78px;
}

.cwf-captcha .cwf-inset-text {
  margin-top: var(--cwf-space-2);
}

.cwf-feedback {
  margin-top: var(--cwf-space-7);
  padding-top: var(--cwf-space-5);
  border-top: 1px solid var(--cwf-border-muted);
}

/* Inline radios / checkboxes only from tablet up — stack on narrow viewports */
@media (min-width: 40.0625em) {
  .cwf-radios--inline,
  .cwf-checkboxes--inline {
    display: flex;
    flex-wrap: wrap;
  }

  .cwf-radios--inline .cwf-radios__item,
  .cwf-checkboxes--inline .cwf-checkboxes__item {
    margin-right: var(--cwf-space-4);
  }

  .cwf-checkboxes--inline .cwf-checkboxes__divider {
    flex: 0 0 auto;
    margin: 0 var(--cwf-space-2) var(--cwf-space-2) 0;
    align-self: center;
  }

  .cwf-checkboxes--inline .cwf-checkboxes__divider::before,
  .cwf-checkboxes--inline .cwf-checkboxes__divider::after {
    display: none;
  }
}

/* Skip link */
.cwf-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--cwf-focus);
  color: var(--cwf-focus-text);
  padding: var(--cwf-space-2) var(--cwf-space-3);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.cwf-skip-link:focus {
  left: var(--cwf-space-2);
  top: var(--cwf-space-2);
  outline: 3px solid transparent;
  box-shadow: 0 0 0 4px var(--cwf-text);
}

.cwf-main:focus {
  outline: none;
}

/* Accordion */
.cwf-accordion {
  margin: 0 0 var(--cwf-space-6);
  border-bottom: 1px solid var(--cwf-border-muted);
}

.cwf-accordion__heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--cwf-space-3);
  color: inherit;
}

.cwf-accordion__controls {
  margin-bottom: var(--cwf-space-3);
}

.cwf-accordion__show-all {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cwf-link);
  font-family: inherit;
  font-size: 1.1875rem;
  line-height: 1.31579;
  text-decoration: underline;
  text-decoration-thickness: var(--cwf-link-underline-thickness);
  text-underline-offset: var(--cwf-link-underline-offset);
  cursor: pointer;
}

.cwf-accordion__show-all:hover {
  color: var(--cwf-link-hover);
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
}

.cwf-accordion__section {
  border-top: 1px solid var(--cwf-border-muted);
}

.cwf-accordion__section-heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.cwf-accordion__section-button {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: var(--cwf-space-3) 0;
  border: 0;
  background: transparent;
  color: var(--cwf-text);
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.cwf-accordion__section-button:hover .cwf-accordion__section-title {
  text-decoration: underline;
  text-decoration-thickness: max(3px, 0.1857em, var(--cwf-link-underline-thickness));
  text-underline-offset: var(--cwf-link-underline-offset);
}

.cwf-accordion__section-title {
  flex: 1;
  padding-right: var(--cwf-space-3);
}

.cwf-accordion__icon {
  display: block;
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  align-self: flex-start;
  margin-top: 0.15rem;
}

.cwf-accordion__icon::before,
.cwf-accordion__icon::after {
  content: "";
  position: absolute;
  background: var(--cwf-text);
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  transform: translateY(-50%);
}

.cwf-accordion__icon::before {
  z-index: 1;
}

.cwf-accordion__icon::after {
  z-index: 0;
  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.15s ease;
}

.cwf-accordion__section-button[aria-expanded="true"] .cwf-accordion__icon::after {
  transform: translateY(-50%) rotate(0deg);
}

.cwf-accordion__section-content {
  padding-bottom: var(--cwf-space-4);
}

.cwf-accordion__section-body {
  margin: 0;
}

.cwf-dialog-open {
  overflow: hidden;
}

/* Warning text (destructive confirm / noscript exit) */
.cwf-warning-text {
  position: relative;
  display: block;
  padding: var(--cwf-space-2) 0 var(--cwf-space-2) 2.5rem;
  margin: 0 0 var(--cwf-space-4);
  color: var(--cwf-text);
  font-weight: 700;
}

.cwf-warning-text__icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 3px solid var(--cwf-text);
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  color: var(--cwf-text);
  background: var(--cwf-warning);
}

.cwf-warning-text__text {
  display: block;
  font-weight: 700;
}

.cwf-warning-text__content {
  display: block;
}

.cwf-warning-text__body {
  margin: var(--cwf-space-1) 0 0;
  font-weight: 400;
}

.cwf-warning-text__body > :first-child {
  margin-top: 0;
}

.cwf-warning-text__body > :last-child {
  margin-bottom: 0;
}

/* Character count */
.cwf-character-count {
  margin-top: var(--cwf-space-2);
  color: var(--cwf-secondary);
  font-size: 1.1875rem;
}

.cwf-character-count--error {
  color: var(--cwf-error);
  font-weight: 700;
}

/* Session timeout warning modal (extends .cwf-dialog) */
.cwf-dialog--session .cwf-dialog__panel {
  border-color: var(--cwf-warning);
}

.cwf-session-warning__text {
  margin: 0 0 var(--cwf-space-3);
  font-weight: 400;
}

.cwf-session-warning__remaining {
  margin: 0 0 var(--cwf-space-4);
  font-weight: 700;
  font-size: 1.1875rem;
}

/* Desktop / tablet type scale (≥ 641px) */
@media (min-width: 40.0625em) {
  .cwf-form-group {
    margin-bottom: var(--cwf-space-6);
  }

  .cwf-heading-xl {
    font-size: 3rem;
    line-height: 1.04167;
  }

  .cwf-heading-l {
    font-size: 2.25rem;
  }

  .cwf-heading-m {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .cwf-task-list {
    margin-bottom: var(--cwf-space-6);
  }

  .cwf-fieldset__legend--m {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .cwf-fieldset__legend--l {
    font-size: 2.25rem;
    line-height: 1.11111;
  }

  .cwf-fieldset__legend--xl {
    font-size: 3rem;
    line-height: 1.04167;
  }

  .cwf-error-summary__title,
  .cwf-accordion__heading,
  .cwf-notification__title,
  .cwf-prose h2 {
    font-size: 1.5rem;
  }

  .cwf-panel__title,
  .cwf-panel__reference-value {
    font-size: 3rem;
    line-height: 1.04167;
  }

  .cwf-panel__body,
  .cwf-panel__body.cwf-prose,
  .cwf-payment-amount__value {
    font-size: 1.5rem;
  }
}

/* Narrow viewports (≤ 640px) */
@media (max-width: 40em) {
  .cwf-webform--preview {
    padding: var(--cwf-space-4);
  }

  .cwf-main-wrapper {
    padding-top: var(--cwf-space-3);
    padding-bottom: var(--cwf-space-5);
  }

  .cwf-label--xl {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .cwf-caption {
    font-size: 1rem;
  }

  .cwf-notification-banner__heading {
    font-size: 1.1875rem;
  }

  /* Conditional reveals — reclaim horizontal space until tablet */
  .cwf-radios__conditional,
  .cwf-checkboxes__conditional {
    margin-left: 0;
    padding-left: var(--cwf-space-3);
  }

  .cwf-summary-list__row {
    display: block;
  }

  .cwf-summary-list__key,
  .cwf-summary-list__value,
  .cwf-summary-list__actions {
    display: block;
    width: 100%;
    margin: 0 0 var(--cwf-space-1);
    text-align: left;
  }

  .cwf-summary-list__actions {
    padding-right: var(--cwf-space-4);
  }

  .cwf-summary-list__action-list {
    justify-content: flex-start;
  }

  .cwf-file-upload__summary .cwf-summary-list__actions {
    width: 100%;
    text-align: left;
    white-space: normal;
  }

  .cwf-summary-repeating__field {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cwf-summary-repeating__fields {
    padding-left: var(--cwf-space-2);
  }

  .cwf-summary-repeating__key {
    margin-bottom: 0;
  }

  .cwf-summary-repeating__value {
    margin-bottom: var(--cwf-space-1);
  }

  .cwf-summary-card__title-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .cwf-summary-card__content {
    padding-left: var(--cwf-space-3);
    padding-right: var(--cwf-space-3);
  }

  .cwf-address-answer__row {
    flex-direction: column;
    gap: var(--cwf-space-1);
  }

  .cwf-address-answer__key {
    flex: 0 0 auto;
  }

  .cwf-address-answer__value {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
  }

  .cwf-autocomplete__menu {
    position: static;
    max-height: 12rem;
  }

  /* Full-width primary actions only — keep secondary/inline buttons compact */
  .cwf-button:not(.cwf-button--secondary):not(.cwf-button--exit):not(.cwf-button--warning) {
    width: 100%;
  }

  .cwf-button-group {
    flex-direction: column;
    align-items: stretch;
  }

  .cwf-button-group .cwf-button,
  .cwf-button-group .cwf-exit-form,
  .cwf-address-lookup__find {
    width: 100%;
    flex: 0 0 auto;
  }

  .cwf-button-group .cwf-button {
    justify-content: center;
  }

  .cwf-dialog {
    padding: var(--cwf-space-3);
    align-items: flex-end;
  }

  .cwf-dialog__panel {
    max-width: none;
    padding: var(--cwf-space-4);
    /* Sit above the home indicator / thumb zone on phones */
    margin-bottom: env(safe-area-inset-bottom, 0);
  }

  .cwf-dialog__title {
    font-size: 1.1875rem;
  }

  .cwf-dialog__body {
    font-size: 1rem;
  }

  .cwf-save__panel {
    padding: var(--cwf-space-4);
  }

  .cwf-exit-this-page {
    padding-left: 0;
    padding-right: 0;
  }

  .cwf-panel {
    padding: var(--cwf-space-4);
  }

  .cwf-panel__title,
  .cwf-panel__reference-value {
    font-size: 1.5rem;
  }

  .cwf-panel__body,
  .cwf-panel__body.cwf-prose {
    font-size: 1.1875rem;
  }

  .cwf-error-summary {
    padding: var(--cwf-space-3);
  }

  .cwf-error-summary__title,
  .cwf-accordion__heading,
  .cwf-notification__title {
    font-size: 1.1875rem;
    line-height: 1.31579;
  }

  .cwf-select {
    width: 100%;
    min-width: 0;
  }

  /* Character-width inputs must not force horizontal scroll */
  .cwf-input--width-10,
  .cwf-input--width-20,
  .cwf-input--width-30 {
    max-width: 100% !important;
  }

  .cwf-date-input__item {
    margin-right: var(--cwf-space-3);
  }

  .cwf-repeating__item {
    padding-left: var(--cwf-space-2);
  }

  .cwf-repeating__item-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Keep task list name | status side-by-side; do not stack on narrow viewports. */

  .cwf-tag {
    max-width: none;
  }

  .cwf-file-upload__item-value {
    flex-wrap: wrap;
  }

  .cwf-file-upload__item-actions {
    width: 100%;
    margin-top: var(--cwf-space-2);
    text-align: left;
  }

  .cwf-file-upload__remove {
    margin-left: 0;
  }

  .cwf-warning-callout {
    padding: var(--cwf-space-3) var(--cwf-space-3) var(--cwf-space-3) calc(var(--cwf-space-3) + 6px);
  }

  .cwf-inset-text {
    padding: var(--cwf-space-2) var(--cwf-space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cwf-accordion__icon::after {
    transition: none;
  }

  .cwf-button:active {
    top: 0;
  }

  .cwf-file-upload__item[data-cwf-file-status="uploading"],
  .cwf-summary-list__row.cwf-file-upload__item[data-cwf-file-status="uploading"] {
    animation: none;
    background: rgba(255, 221, 0, 0.2);
  }

  .cwf-webform *,
  .cwf-webform *::before,
  .cwf-webform *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .cwf-input,
  .cwf-textarea,
  .cwf-select,
  .cwf-file-upload,
  .cwf-file-upload-button,
  .cwf-input__prefix,
  .cwf-input__suffix,
  .cwf-radios__label::before,
  .cwf-checkboxes__label::before,
  .cwf-button,
  .cwf-button--secondary,
  .cwf-button--warning,
  .cwf-tag,
  .cwf-file-upload__item-status,
  .cwf-file-upload-button__status {
    border-color: ButtonText;
    forced-color-adjust: none;
  }

  /* Tags lose their fill in forced colours — outline keeps them distinct */
  .cwf-tag,
  .cwf-file-upload__item-status,
  .cwf-file-upload-button__status {
    font-weight: 700;
    border: 1px solid ButtonText;
    background: transparent;
    color: ButtonText;
  }

  .cwf-input--error,
  .cwf-textarea--error,
  .cwf-select--error,
  .cwf-file-upload--error,
  .cwf-form-group--error,
  .cwf-form-group--error .cwf-input__prefix,
  .cwf-form-group--error .cwf-input__suffix,
  .cwf-form-group--error .cwf-file-upload-button,
  .cwf-repeating__item--error {
    border-color: Highlight;
  }

  .cwf-error-message,
  .cwf-error-summary {
    color: Highlight;
    border-color: Highlight;
  }

  .cwf-input:focus,
  .cwf-textarea:focus,
  .cwf-select:focus,
  .cwf-file-upload:focus,
  .cwf-file-upload-button:focus,
  .cwf-radios__input:focus + .cwf-radios__label::before,
  .cwf-checkboxes__input:focus + .cwf-checkboxes__label::before,
  .cwf-button:focus,
  .cwf-link:focus,
  .cwf-link-button:focus,
  .cwf-back-link:focus,
  .cwf-accordion__section-button:focus,
  .cwf-accordion__show-all:focus {
    outline: 3px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
  }

  .cwf-radios__input:checked + .cwf-radios__label::after,
  .cwf-checkboxes__input:checked + .cwf-checkboxes__label::after {
    border-color: ButtonText;
    color: ButtonText;
    opacity: 1;
  }

  .cwf-accordion__icon,
  .cwf-accordion__icon::after {
    border-color: ButtonText;
    background: ButtonText;
  }

  .cwf-radios__conditional,
  .cwf-checkboxes__conditional {
    border-left-color: ButtonText;
  }
}

/* Print — keep answers readable; hide chrome / actions */
@media print {
  .cwf-skip-link,
  .cwf-back-link,
  .cwf-button,
  .cwf-button-group,
  .cwf-secondary-actions,
  .cwf-exit,
  .cwf-exit-this-page,
  .cwf-save,
  .cwf-dialog,
  .cwf-summary-list__actions,
  .cwf-summary-card__actions,
  .cwf-file-upload__item-actions,
  .cwf-repeating__actions,
  .cwf-accordion__controls,
  .cwf-print-link,
  .cwf-session-warning {
    display: none !important;
  }

  .cwf-webform,
  .cwf-webform--preview {
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: #000;
  }

  .cwf-panel {
    background: transparent !important;
    color: #000 !important;
    border: 2px solid #000;
    text-align: left;
    padding: var(--cwf-space-4);
  }

  .cwf-panel--neutral {
    border: 1px solid #000;
  }

  .cwf-error-summary,
  .cwf-warning-callout,
  .cwf-notification {
    border-color: #000;
  }

  .cwf-link,
  .cwf-prose a,
  .cwf-task-list__link {
    color: #000 !important;
    text-decoration: underline;
  }

  .cwf-accordion__section-content {
    display: block !important;
  }

  .cwf-tag,
  .cwf-file-upload__item-status {
    border: 1px solid #000;
    background: transparent !important;
    color: #000 !important;
  }
}
