/*
  CMEL dedicated V4 questionnaire stylesheet.
  Created by safe split from app/static/css/questionnaire.css.
  Do not delete the original questionnaire.css until old/V3 pages are separately verified.
*/

/*
  Restored original questionnaire styling.
  Source: app/_backups/archived_unused_css_20260709_224325/legacy.css
  Reason: generic questionnaire.css broke the previously optimised mobile questionnaire.
  Colours remapped to current CMEL preview/report palette.
*/

:root {
  --bg: #f7fbfc;
  --page: #f7fbfc;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --text: #101d35;
  --muted: #526174;
  --muted-2: #69758a;
  --green: #078f85;
  --green-2: #0bae9f;
  --mint: #effbf8;
  --mint-2: #e2f7ef;
  --blue: #0b63ce;
  --blue-soft: #eef6ff;
  --purple: #8c66dd;
  --purple-soft: #f0e9ff;
  --orange: #e46510;
  --orange-soft: #fff0e3;
  --amber: #ffdfa0;
  --amber-soft: #fff8ea;
  --coral: #8c2f1a;
  --danger: #8c2f1a;
  --danger-soft: #fff3ed;
  --card: #ffffff;
  --line: #dfe9ee;
  --line-soft: #e8eff1;
  --shadow: 0 18px 45px rgba(14, 31, 53, 0.06);
  --shadow-soft: 0 14px 34px rgba(14, 31, 53, 0.045);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}


/* Shared scan foundation used by V4 markup */
/* Fast Scan Flow V3 */
.scan-page {
  min-height: 100vh;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 80% 15%, rgba(255, 223, 160, 0.30), transparent 24%),
    radial-gradient(circle at 12% 88%, rgba(11, 174, 159, 0.15), transparent 30%),
    linear-gradient(135deg, #fff9ed 0%, #f7fbfc 46%, #eaf5ef 100%);
  color: var(--text);
  overflow: hidden;
}

.scan-nav {
  width: min(1120px, 100%);
  height: 70px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(14, 31, 53, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 54px rgba(14, 31, 53, 0.08);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scan-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scan-brand span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  font-weight: 950;
}

.scan-brand strong {
  font-size: 19px;
  letter-spacing: -0.03em;
}

.scan-exit {
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-weight: 850;
}

.scan-shell {
  width: min(920px, 100%);
  height: calc(100vh - 118px);
  min-height: 620px;
  margin: 26px auto 0;
  border: 1px solid rgba(14, 31, 53, 0.10);
  border-radius: 38px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 223, 160, 0.15), transparent 28%),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 90px rgba(14, 31, 53, 0.10);
  backdrop-filter: blur(18px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.scan-top {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(14, 31, 53, 0.07);
}

.scan-route {
  margin: 0 0 14px;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.scan-progress {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
}

.scan-progress span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.scan-progress div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f5;
}

.scan-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--amber));
  transition: width 220ms ease;
}

.scan-stage {
  position: relative;
  display: grid;
  align-items: center;
  padding: 28px;
  overflow: hidden;
}

.scan-question {
  width: 100%;
  animation: scanIn 220ms ease both;
}

@keyframes scanIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.scan-kicker {
  margin: 0 0 16px;
  display: inline-flex;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.scan-question h1 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.scan-help {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.scan-options {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scan-option {
  cursor: pointer;
}

.scan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scan-option span {
  min-height: 84px;
  padding: 18px 20px;
  border: 1px solid rgba(14, 31, 53, 0.10);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  box-shadow: 0 14px 36px rgba(14, 31, 53, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.scan-option b {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.scan-option em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
}

.scan-option:hover span {
  transform: translateY(-2px);
  border-color: rgba(11, 174, 159, 0.30);
  box-shadow: 0 18px 46px rgba(14, 31, 53, 0.08);
}

.scan-option input:checked + span,
.scan-option.just-picked span {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(11, 174, 159, 0.50);
  background:
    radial-gradient(circle at 95% 8%, rgba(255, 223, 160, 0.18), transparent 30%),
    var(--mint);
  box-shadow: 0 22px 54px rgba(7, 143, 133, 0.12);
}

.scan-option-muted span {
  opacity: 0.82;
}

.scan-textarea {
  width: 100%;
  min-height: 140px;
  margin-top: 30px;
  resize: none;
  border: 1px solid rgba(14, 31, 53, 0.10);
  border-radius: 26px;
  padding: 22px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 20px;
  outline: none;
  box-shadow: 0 14px 36px rgba(14, 31, 53, 0.05);
}

.scan-textarea:focus {
  border-color: rgba(11, 174, 159, 0.42);
  box-shadow: 0 0 0 5px rgba(11, 174, 159, 0.08);
}

.scan-count {
  display: block;
  margin-top: 10px;
  text-align: right;
  color: var(--muted);
}

.scan-bottom {
  min-height: 88px;
  padding: 18px 28px;
  border-top: 1px solid rgba(14, 31, 53, 0.07);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.scan-back,
.scan-next {
  border: 0;
  border-radius: 999px;
  padding: 16px 22px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.scan-back {
  background: #edf2f5;
  color: var(--text);
}

.scan-back:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scan-next {
  color: white;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  box-shadow: 0 14px 34px rgba(7, 143, 133, 0.18);
}

.scan-build {
  justify-self: center;
  text-align: center;
}

.scan-build span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scan-build strong {
  display: block;
  margin-top: 3px;
  color: var(--green);
  font-size: 14px;
}

.scan-safety {
  margin: 0;
  padding: 0 28px 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.scan-flash .scan-shell {
  box-shadow: 0 30px 90px rgba(14, 31, 53, 0.10), 0 0 0 1px rgba(255, 223, 160, 0.08);
}

@media (max-width: 720px) {
  .scan-page {
    padding: 12px;
    overflow: auto;
  }

  .scan-nav {
    height: 62px;
    border-radius: 24px;
  }

  .scan-brand strong {
    font-size: 15px;
  }

  .scan-brand span {
    width: 38px;
    height: 38px;
  }

  .scan-shell {
    height: auto;
    min-height: calc(100vh - 94px);
    margin-top: 12px;
    border-radius: 30px;
  }

  .scan-stage {
    padding: 22px;
  }

  .scan-question h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .scan-help {
    font-size: 16px;
  }

  .scan-options {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .scan-option span {
    min-height: 70px;
  }

  .scan-bottom {
    grid-template-columns: 1fr;
  }

  .scan-build {
    order: -1;
  }

  .scan-back,
  .scan-next {
    width: 100%;
  }

  .scan-safety {
    padding-bottom: 18px;
  }
}

/* Fast Scan Fit V4: no-scroll compact scan */
html:has(.scan-page),
body:has(.scan-page) {
  height: 100%;
  overflow: hidden;
}

body:has(.scan-page) {
  margin: 0;
}

.scan-page {
  height: 100dvh;
  min-height: 0;
  padding: clamp(10px, 2vh, 18px);
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
}

.scan-nav {
  height: clamp(56px, 8vh, 68px);
  width: min(1040px, 100%);
}

.scan-shell {
  width: min(840px, 100%);
  height: calc(100dvh - clamp(86px, 13vh, 110px));
  min-height: 0;
  margin-top: clamp(10px, 2vh, 18px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: clamp(26px, 4vw, 36px);
}

.scan-top {
  padding: clamp(14px, 2.2vh, 20px) clamp(18px, 3vw, 26px) clamp(10px, 1.6vh, 14px);
}

.scan-route {
  margin-bottom: 8px;
}

.scan-progress {
  grid-template-columns: 58px 1fr;
}

.scan-stage {
  min-height: 0;
  align-items: center;
  padding: clamp(16px, 3vh, 26px) clamp(18px, 3vw, 26px);
  overflow: hidden;
}

.scan-question {
  max-height: 100%;
}

.scan-kicker {
  margin-bottom: clamp(8px, 1.4vh, 12px);
  padding: 7px 11px;
  font-size: 11px;
}

.scan-question h1 {
  max-width: 760px;
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 0.94;
}

.scan-help {
  margin-top: clamp(8px, 1.5vh, 12px);
  font-size: clamp(14px, 1.65vw, 16px);
  line-height: 1.35;
}

.scan-options {
  margin-top: clamp(14px, 2.2vh, 22px);
  gap: clamp(8px, 1.4vh, 12px);
}

.scan-option span {
  min-height: clamp(54px, 9vh, 68px);
  padding: clamp(12px, 1.9vh, 16px) clamp(14px, 2vw, 18px);
  border-radius: 20px;
  gap: 0;
}

.scan-option b {
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.15;
}

.scan-option em {
  display: none;
}

.scan-bottom {
  min-height: 0;
  padding: clamp(12px, 2vh, 16px) clamp(18px, 3vw, 26px);
  grid-template-columns: auto 1fr auto;
}

.scan-back,
.scan-next {
  padding: clamp(12px, 1.8vh, 15px) clamp(16px, 2.4vw, 20px);
}

.scan-build span {
  font-size: 10px;
}

.scan-build strong {
  font-size: 12px;
}

.scan-safety {
  display: none;
}

.scan-textarea {
  min-height: clamp(110px, 22vh, 160px);
  margin-top: clamp(14px, 2.2vh, 22px);
  font-size: 18px;
}

@media (max-width: 720px) {
  .scan-page {
    padding: 8px;
    overflow: hidden;
  }

  .scan-nav {
    height: 56px;
    border-radius: 22px;
    padding: 9px 12px;
  }

  .scan-brand strong {
    font-size: 14px;
  }

  .scan-brand span {
    width: 36px;
    height: 36px;
  }

  .scan-exit {
    padding: 10px 13px;
  }

  .scan-shell {
    height: calc(100dvh - 74px);
    margin-top: 8px;
    border-radius: 24px;
  }

  .scan-top {
    padding: 12px 16px 9px;
  }

  .scan-route {
    margin-bottom: 7px;
    font-size: 11px;
  }

  .scan-progress {
    grid-template-columns: 46px 1fr;
    gap: 10px;
  }

  .scan-progress span {
    font-size: 12px;
  }

  .scan-progress div {
    height: 8px;
  }

  .scan-stage {
    padding: 14px 16px;
    align-items: center;
  }

  .scan-kicker {
    margin-bottom: 8px;
    padding: 6px 9px;
    font-size: 10px;
  }

  .scan-question h1 {
    font-size: clamp(30px, 10vw, 42px);
    line-height: 0.94;
  }

  .scan-help {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.28;
  }

  .scan-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 13px;
    gap: 8px;
  }

  .scan-option span {
    min-height: 54px;
    padding: 11px 12px;
    border-radius: 16px;
  }

  .scan-option b {
    font-size: 14px;
    line-height: 1.12;
  }

  .scan-bottom {
    padding: 10px 16px 12px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .scan-back,
  .scan-next {
    width: auto;
    padding: 11px 14px;
    font-size: 13px;
  }

  .scan-build {
    min-width: 0;
  }

  .scan-build span {
    display: none;
  }

  .scan-build strong {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .scan-textarea {
    min-height: 120px;
    font-size: 16px;
    border-radius: 18px;
    padding: 16px;
  }
}

@media (max-width: 390px) {
  .scan-options {
    gap: 7px;
  }

  .scan-option span {
    min-height: 50px;
    padding: 10px;
  }

  .scan-option b {
    font-size: 13px;
  }

  .scan-question h1 {
    font-size: clamp(28px, 9.4vw, 38px);
  }
}

/* V5: lock page, scroll only the question area */
html:has(.scan-page),
body:has(.scan-page) {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.scan-page {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

.scan-shell {
  min-height: 0 !important;
  overflow: hidden !important;
}

.scan-top {
  flex: 0 0 auto;
}

.scan-stage {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-items: start !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-bottom: 22px;
}

.scan-stage::-webkit-scrollbar {
  width: 8px;
}

.scan-stage::-webkit-scrollbar-track {
  background: transparent;
}

.scan-stage::-webkit-scrollbar-thumb {
  background: rgba(7, 143, 133, 0.15);
  border-radius: 999px;
}

.scan-question {
  max-height: none !important;
  padding-bottom: 8px;
}

.scan-bottom {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

@media (max-width: 720px) {
  .scan-page {
    overflow: hidden !important;
  }

  .scan-shell {
    height: calc(100dvh - 74px) !important;
    max-height: calc(100dvh - 74px) !important;
  }

  .scan-stage {
    overflow-y: auto !important;
    padding-bottom: 18px;
  }

  .scan-bottom {
    position: relative;
    z-index: 10;
  }
}

@media (max-height: 560px) {
  .scan-nav {
    height: 54px !important;
  }

  .scan-shell {
    height: calc(100dvh - 68px) !important;
    margin-top: 8px !important;
  }

  .scan-top {
    padding-top: 10px !important;
    padding-bottom: 8px !important;
  }

  .scan-route {
    margin-bottom: 5px !important;
  }

  .scan-stage {
    padding-top: 12px !important;
    padding-bottom: 18px !important;
  }

  .scan-bottom {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }
}


/* Dedicated V4 questionnaire presentation */
/* Former app/static/css/questionnaire_v4.css */
/* CMEL_V4_LEGACY_SCAN_BRIDGE_START
   V4 uses the established questionnaire.css + questionnaire_v3.css design.
   This file contains only V4 field compatibility rules.
*/

html:has(.v4-scan-page),
body:has(.v4-scan-page) {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.v4-scan-page {
  width: 100%;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

.v4-form.scan-shell {
  min-height: 0 !important;
  overflow: hidden !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.v4-personal-label {
  display: block;
  margin: -5px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.v4-stage.scan-stage {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-items: start !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.v4-stage.scan-stage::-webkit-scrollbar {
  width: 8px;
}

.v4-stage.scan-stage::-webkit-scrollbar-track {
  background: transparent;
}

.v4-stage.scan-stage::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(7, 143, 133, 0.16);
}

.v4-screen {
  width: 100%;
  max-height: none !important;
  padding-bottom: 10px;
}

.v4-screen.is-hidden,
.scan-next.is-hidden {
  display: none !important;
}

.v4-field-list {
  display: grid;
  gap: 24px;
  margin-top: clamp(16px, 2.3vh, 24px);
}

.v4-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.v4-field[hidden] {
  display: none !important;
}

.v4-field legend {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.015em;
}

.v4-screen[data-field-count="1"] .v4-field > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.v4-help {
  margin: -3px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.v4-options.scan-options {
  grid-template-columns: 1fr !important;
  margin-top: 0;
}

.scan-option.v4-option span {
  width: 100%;
}

.v4-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 7px;
}

.v4-scale-option {
  position: relative;
  cursor: pointer;
}

.v4-scale-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.v4-scale-option span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(14, 31, 53, 0.12);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-weight: 850;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.v4-scale-option:hover span {
  transform: translateY(-1px);
  border-color: rgba(11, 174, 159, 0.34);
}

.v4-scale-option input:checked + span {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.v4-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.v4-time-wrap {
  display: grid;
  gap: 10px;
}

.v4-time-input-wrap {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid rgba(14, 31, 53, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(14, 31, 53, 0.04);
}

.v4-time-input-wrap > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.v4-time-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 850;
}

.v4-time-alternatives {
  display: grid;
  gap: 8px;
}

.v4-time-option {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid rgba(14, 31, 53, 0.12);
  border-radius: 17px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 800;
}

.v4-time-option.is-selected {
  border-color: rgba(11, 174, 159, 0.48);
  background: var(--mint);
  color: var(--green);
}

.v4-textarea.scan-textarea {
  min-height: 128px;
}

.v4-character-count {
  display: block;
}

.v4-answer-error {
  margin: 10px 0 0;
  color: #8c2f1a;
  font-size: 13px;
  font-weight: 900;
}

.v4-warning {
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid #efd8a4;
  border-radius: 16px;
  background: #fff8ea;
  color: #694303;
  font-size: 13px;
  line-height: 1.42;
  font-weight: 750;
}

.v4-warning strong {
  font-weight: 950;
}

.v4-actions.scan-bottom {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.v4-consent {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 29, 53, 0.46);
  backdrop-filter: blur(12px);
}

.v4-consent[hidden] {
  display: none !important;
}

.v4-consent-card {
  width: min(600px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(11, 174, 159, 0.12),
      transparent 32%
    ),
    #ffffff;
  box-shadow: 0 28px 90px rgba(14, 31, 53, 0.18);
}

.v4-consent-kicker {
  width: fit-content;
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid #cfe9e7;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.v4-consent-card h2 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.v4-consent-card > button {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  box-shadow: 0 16px 36px rgba(7, 143, 133, 0.24);
}

.v4-consent-card > button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

body.v4-consent-open {
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .v4-field-list {
    gap: 20px;
  }

  .v4-scale {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .v4-actions.scan-bottom {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }

  .v4-actions .scan-back,
  .v4-actions .scan-next {
    width: auto !important;
  }
}

@media (max-width: 390px) {
  .v4-scale {
    gap: 5px;
  }

  .v4-scale-option span {
    min-height: 39px;
    border-radius: 10px;
    font-size: 13px;
  }
}

/* CMEL_V4_LEGACY_SCAN_BRIDGE_END */

/* CMEL_QUESTIONNAIRE_STABLE_SCAN_LAYOUT_START
   One authoritative layout for V4 running inside the established scan shell.
   The nav and action bar remain fixed; only the question stage scrolls.
*/

.v4-form.scan-shell {
  min-height: 0 !important;
  overflow: hidden !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.v4-form .scan-top {
  display: grid !important;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
}

.v4-form .scan-route {
  grid-column: 1;
  grid-row: 1;
  margin: 0 !important;
  align-self: end;
}

.v4-form .v4-personal-label {
  grid-column: 1;
  grid-row: 2;
  margin: 0 !important;
  align-self: start;
  white-space: nowrap;
}

.v4-form .scan-progress {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 0;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center;
}

.v4-form .scan-progress > span {
  white-space: nowrap;
}

.v4-form .scan-progress > div {
  min-width: 0;
}

.v4-stage.scan-stage {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-items: start !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.v4-actions.scan-bottom {
  position: relative;
  z-index: 20;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
}

.v4-actions .scan-back {
  grid-column: 1;
  order: 0 !important;
  justify-self: start;
  white-space: nowrap;
}

.v4-actions .scan-build {
  grid-column: 2;
  order: 0 !important;
  min-width: 0;
  justify-self: center !important;
  text-align: center;
}

.v4-actions .scan-build span {
  display: block !important;
}

.v4-actions .scan-build strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v4-actions .scan-next {
  grid-column: 3;
  order: 0 !important;
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .v4-form .scan-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 0 !important;
    row-gap: 2px !important;
    padding: 11px 15px 10px !important;
  }

  .v4-form .scan-route {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    font-size: 10px !important;
    letter-spacing: 0.11em !important;
  }

  .v4-form .v4-personal-label {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .v4-form .scan-progress {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 6px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 6px !important;
    align-items: stretch !important;
  }

  .v4-form .scan-progress > span {
    display: block !important;
    width: 100% !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .v4-form .scan-progress > div {
    width: 100% !important;
    min-width: 0 !important;
    height: 8px !important;
  }

  .v4-form .scan-progress > div > i {
    max-width: 100% !important;
  }


  .v4-actions.scan-bottom {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 10px 13px 11px !important;
  }

  .v4-actions .scan-back,
  .v4-actions .scan-next {
    width: auto !important;
    min-height: 42px;
    padding: 10px 13px !important;
    font-size: 13px !important;
  }

  .v4-actions .scan-build {
    order: 0 !important;
  }

  .v4-actions .scan-build span {
    display: block !important;
    font-size: 8px !important;
    letter-spacing: 0.05em !important;
  }

  .v4-actions .scan-build strong {
    font-size: 10px !important;
  }
}

@media (max-width: 360px) {
  .v4-actions.scan-bottom {
    gap: 6px !important;
    padding-inline: 10px !important;
  }

  .v4-actions .scan-back,
  .v4-actions .scan-next {
    padding-inline: 11px !important;
    font-size: 12px !important;
  }

  .v4-actions .scan-build span {
    font-size: 7px !important;
  }

  .v4-actions .scan-build strong {
    font-size: 9px !important;
  }
}

/* CMEL_QUESTIONNAIRE_STABLE_SCAN_LAYOUT_END */

/* CMEL_QUESTIONNAIRE_SINGLE_SOURCE_END */

/* CMEL_V4_ONE_QUESTION_UI_V5_START */

/*
  Authoritative V4 questionnaire presentation.
  The data model, question bank, answer values, branching and scoring
  remain unchanged. Each rendered V4 screen contains one field only.
*/

html:has(.v4-scan-page),
body:has(.v4-scan-page) {
  width: 100% !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: auto !important;
}

body.v4-consent-open {
  overflow: hidden !important;
}

.v4-scan-page {
  width: 100% !important;
  min-height: 100vh !important;
  height: auto !important;
  max-height: none !important;
  padding: 18px 18px 44px !important;
  display: block !important;
  overflow: visible !important;
  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(11, 174, 159, 0.10),
      transparent 28rem
    ),
    radial-gradient(
      circle at 92% 16%,
      rgba(255, 223, 160, 0.24),
      transparent 24rem
    ),
    linear-gradient(
      180deg,
      #f8fbfc 0%,
      #f4faf9 100%
    ) !important;
}

.v4-scan-page .scan-nav {
  position: sticky !important;
  top: 10px !important;
  z-index: 80 !important;
  width: min(860px, 100%) !important;
  height: 62px !important;
  margin: 0 auto !important;
  padding: 10px 14px !important;
  border: 1px solid rgba(18, 35, 60, 0.09) !important;
  border-radius: 999px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 16px 45px rgba(18, 35, 60, 0.08) !important;
  backdrop-filter: blur(18px) !important;
}

.v4-scan-page .scan-brand {
  min-width: 0;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.v4-scan-page .scan-brand > span {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  color: #ffffff !important;
  background: #079c91 !important;
  font-size: 20px !important;
  font-weight: 950 !important;
}

.v4-scan-page .scan-brand strong {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #12233c !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  letter-spacing: -0.025em !important;
}

.v4-scan-page .scan-exit {
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #067a72 !important;
  background: #eaf8f5 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.v4-form.scan-shell {
  width: min(760px, 100%) !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  margin: 18px auto 0 !important;
  padding: 0 0 16px !important;
  border: 1px solid rgba(18, 35, 60, 0.10) !important;
  border-radius: 28px !important;
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  overflow: visible !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 28px 75px rgba(18, 35, 60, 0.11) !important;
}

.v4-form .scan-top {
  padding: 18px 22px !important;
  border-bottom: 1px solid #e5ecef !important;
  display: grid !important;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 18px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border-radius: 28px 28px 0 0 !important;
}

.v4-form .scan-route {
  margin: 0 !important;
  color: #078f85 !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.v4-form .v4-personal-label {
  display: block !important;
  margin-top: 3px !important;
  color: #5d6b7f !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

.v4-form .scan-progress {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: auto minmax(100px, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
}

.v4-form .scan-progress > span {
  color: #455369 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.v4-form .scan-progress > div {
  height: 8px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #e8eff2 !important;
}

.v4-form .scan-progress i {
  display: block !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(
    90deg,
    #0aae9f,
    #64c7b7,
    #f3d37b
  ) !important;
  transition: width 220ms ease !important;
}

.v4-stage.scan-stage {
  min-height: 430px !important;
  height: auto !important;
  max-height: none !important;
  padding: 30px 30px 24px !important;
  display: block !important;
  align-items: initial !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

.v4-screen {
  width: 100% !important;
  max-height: none !important;
  scroll-margin-top: 94px !important;
}

.v4-screen.is-hidden,
.v4-field[hidden] {
  display: none !important;
}

.v4-screen .scan-kicker {
  margin: 0 0 7px !important;
  color: #078f85 !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.13em !important;
  text-transform: uppercase !important;
}

.v4-group-label {
  margin: 0 0 8px !important;
  color: #708095 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 800 !important;
}

.v4-screen h1 {
  max-width: 690px !important;
  margin: 0 !important;
  color: #12233c !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: clamp(27px, 4vw, 38px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.045em !important;
}

.v4-screen .scan-help {
  max-width: 660px !important;
  margin: 11px 0 0 !important;
  color: #607086 !important;
  font-size: 14px !important;
  line-height: 1.48 !important;
  font-weight: 620 !important;
}

.v4-field-list {
  margin-top: 22px !important;
  display: block !important;
}

.v4-field {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.v4-sr-only {
  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;
}

.v4-help {
  margin: 0 0 12px !important;
  color: #607086 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-weight: 650 !important;
}

.v4-selection-meta {
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  border: 1px solid #d7e8e5 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  background: #eff9f7 !important;
}

.v4-selection-meta span {
  color: #49625f !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.v4-selection-meta strong {
  color: #067a72 !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

.v4-options.scan-options {
  margin-top: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.v4-option.scan-option {
  position: relative !important;
  display: block !important;
  cursor: pointer !important;
}

.v4-option > input {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: auto !important;
  transform: translateY(-50%) !important;
}

.v4-option > span {
  min-height: 58px !important;
  padding: 14px 56px 14px 17px !important;
  border: 1.5px solid #dbe5e9 !important;
  border-radius: 15px !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background: #ffffff !important;
  box-shadow: 0 8px 22px rgba(18, 35, 60, 0.035) !important;
  color: #172840 !important;
  transform: none !important;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease !important;
}

.v4-option b {
  max-width: 100% !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  letter-spacing: -0.015em !important;
  font-weight: 800 !important;
}

.v4-choice-mark {
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  width: 27px !important;
  height: 27px !important;
  border: 2px solid #b9c8cf !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  color: transparent !important;
  background: #ffffff !important;
  font-size: 14px !important;
  font-style: normal !important;
  font-weight: 950 !important;
  transform: translateY(-50%) !important;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease !important;
}

.v4-option > input:checked + span,
.v4-option.is-selected > span {
  border-color: #0aa89b !important;
  background:
    radial-gradient(
      circle at 95% 0%,
      rgba(246, 211, 123, 0.22),
      transparent 32%
    ),
    #ebf9f6 !important;
  box-shadow:
    0 12px 28px rgba(7, 143, 133, 0.10),
    0 0 0 1px rgba(10, 168, 155, 0.12) !important;
  color: #102e2b !important;
  transform: translateY(-1px) !important;
}

.v4-option > input:checked + span .v4-choice-mark,
.v4-option.is-selected .v4-choice-mark {
  border-color: #078f85 !important;
  color: #ffffff !important;
  background: #078f85 !important;
}

.v4-option > input:focus-visible + span {
  outline: 3px solid rgba(11, 99, 206, 0.25) !important;
  outline-offset: 2px !important;
}

.v4-selection-limit {
  margin: 10px 0 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #efc3b7 !important;
  border-radius: 11px !important;
  color: #7c2d20 !important;
  background: #fff3ee !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  font-weight: 800 !important;
}

.v4-scale {
  margin-top: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.v4-scale-option {
  position: relative !important;
  cursor: pointer !important;
}

.v4-scale-option input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.v4-scale-option span {
  min-height: 45px !important;
  border: 1px solid #dbe5e9 !important;
  border-radius: 11px !important;
  display: grid !important;
  place-items: center !important;
  color: #344359 !important;
  background: #ffffff !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.v4-scale-option input:checked + span,
.v4-scale-option.is-selected span {
  border-color: #078f85 !important;
  color: #ffffff !important;
  background: #078f85 !important;
  box-shadow: 0 8px 18px rgba(7, 143, 133, 0.20) !important;
}

.v4-scale-option input:focus-visible + span {
  outline: 3px solid rgba(11, 99, 206, 0.25) !important;
  outline-offset: 2px !important;
}

.v4-scale-labels {
  margin-top: 8px !important;
  display: flex !important;
  justify-content: space-between !important;
  color: #718095 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}

.v4-time-wrap {
  display: grid !important;
  gap: 11px !important;
}

.v4-time-input-wrap {
  min-height: 86px !important;
  padding: 13px 52px 13px 15px !important;
  border: 1.5px solid #dbe5e9 !important;
  border-radius: 15px !important;
  position: relative !important;
  display: grid !important;
  gap: 7px !important;
  background: #ffffff !important;
}

.v4-time-input-wrap > span {
  color: #5d6b7f !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.v4-time-input-wrap input {
  width: 100% !important;
  min-height: 38px !important;
  border: 0 !important;
  outline: 0 !important;
  color: #12233c !important;
  background: transparent !important;
  font-size: 18px !important;
  font-weight: 900 !important;
}

.v4-time-check {
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  width: 27px !important;
  height: 27px !important;
  border: 2px solid #b9c8cf !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  color: transparent !important;
  background: #ffffff !important;
  font-size: 14px !important;
  font-style: normal !important;
  transform: translateY(-50%) !important;
}

.v4-time-input-wrap.is-selected {
  border-color: #078f85 !important;
  background: #ebf9f6 !important;
}

.v4-time-input-wrap.is-selected .v4-time-check {
  border-color: #078f85 !important;
  color: #ffffff !important;
  background: #078f85 !important;
}

.v4-time-alternatives {
  display: grid !important;
  gap: 10px !important;
}

.v4-time-option {
  width: 100% !important;
  min-height: 56px !important;
  padding: 13px 55px 13px 16px !important;
  border: 1.5px solid #dbe5e9 !important;
  border-radius: 15px !important;
  position: relative !important;
  color: #172840 !important;
  background: #ffffff !important;
  text-align: left !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

.v4-time-option i {
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  width: 27px !important;
  height: 27px !important;
  border: 2px solid #b9c8cf !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  color: transparent !important;
  background: #ffffff !important;
  font-size: 14px !important;
  font-style: normal !important;
  transform: translateY(-50%) !important;
}

.v4-time-option.is-selected {
  border-color: #078f85 !important;
  color: #102e2b !important;
  background: #ebf9f6 !important;
}

.v4-time-option.is-selected i {
  border-color: #078f85 !important;
  color: #ffffff !important;
  background: #078f85 !important;
}

.v4-time-option:focus-visible,
.v4-time-input-wrap:focus-within {
  outline: 3px solid rgba(11, 99, 206, 0.25) !important;
  outline-offset: 2px !important;
}

.v4-textarea {
  width: 100% !important;
  min-height: 135px !important;
  margin: 0 !important;
  padding: 15px !important;
  border: 1.5px solid #dbe5e9 !important;
  border-radius: 15px !important;
  color: #172840 !important;
  background: #ffffff !important;
  font: inherit !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  resize: vertical !important;
}

.v4-textarea:focus {
  border-color: #078f85 !important;
  outline: 3px solid rgba(7, 143, 133, 0.12) !important;
}

.v4-character-count {
  display: block !important;
  margin-top: 7px !important;
  color: #718095 !important;
  text-align: right !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}

.v4-answer-error {
  margin: 11px 0 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #efc3b7 !important;
  border-radius: 11px !important;
  color: #7c2d20 !important;
  background: #fff3ee !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  font-weight: 850 !important;
}

.v4-field.has-error .v4-options,
.v4-field.has-error .v4-time-wrap,
.v4-field.has-error .v4-scale,
.v4-field.has-error .v4-textarea {
  animation: v4FieldNudge 220ms ease both !important;
}

@keyframes v4FieldNudge {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }
}

.v4-warning {
  margin-top: 12px !important;
  padding: 12px 13px !important;
  border: 1px solid #ecd8a4 !important;
  border-radius: 12px !important;
  color: #664516 !important;
  background: #fff8e8 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.v4-warning strong {
  color: #8b5912 !important;
}

.v4-actions.scan-bottom {
  position: sticky !important;
  bottom: 10px !important;
  z-index: 70 !important;
  margin: 0 12px !important;
  padding: 11px !important;
  border: 1px solid rgba(196, 218, 216, 0.96) !important;
  border-radius: 18px !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 18px 48px rgba(18, 35, 60, 0.16) !important;
  backdrop-filter: blur(16px) !important;
}

.v4-actions .scan-back,
.v4-actions .scan-next {
  min-height: 48px !important;
  padding: 0 17px !important;
  border-radius: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 950 !important;
  cursor: pointer !important;
}

.v4-actions .scan-back {
  border: 1px solid #dbe5e9 !important;
  color: #23344c !important;
  background: #f3f7f9 !important;
}

.v4-actions .scan-back:disabled {
  opacity: 0.45 !important;
  cursor: default !important;
}

.v4-actions .scan-next {
  min-width: 132px !important;
  border: 0 !important;
  color: #ffffff !important;
  background: linear-gradient(
    135deg,
    #0baa9d,
    #067a72
  ) !important;
  box-shadow: 0 12px 24px rgba(7, 143, 133, 0.20) !important;
}

.v4-actions .scan-next.is-hidden {
  display: none !important;
}

.v4-action-status {
  min-width: 0 !important;
  display: grid !important;
  gap: 2px !important;
  text-align: center !important;
}

.v4-action-status span {
  color: #8290a1 !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
}

.v4-action-status strong {
  overflow: hidden !important;
  color: #466058 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  font-weight: 850 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.v4-consent[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .v4-scan-page {
    padding: 8px 8px 24px !important;
  }

  .v4-scan-page .scan-nav {
    top: 6px !important;
    height: 54px !important;
    padding: 8px 10px !important;
    border-radius: 18px !important;
  }

  .v4-scan-page .scan-brand > span {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
    font-size: 17px !important;
  }

  .v4-scan-page .scan-brand strong {
    max-width: 205px !important;
    font-size: 15px !important;
  }

  .v4-scan-page .scan-exit {
    min-height: 36px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
  }

  .v4-form.scan-shell {
    margin-top: 10px !important;
    border-radius: 20px !important;
  }

  .v4-form .scan-top {
    padding: 14px !important;
    border-radius: 20px 20px 0 0 !important;
    grid-template-columns: 112px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .v4-form .scan-route {
    font-size: 9px !important;
  }

  .v4-form .v4-personal-label {
    font-size: 10px !important;
  }

  .v4-form .scan-progress {
    grid-template-columns: auto minmax(56px, 1fr) !important;
    gap: 7px !important;
  }

  .v4-form .scan-progress > span {
    font-size: 10px !important;
  }

  .v4-stage.scan-stage {
    min-height: 0 !important;
    padding: 22px 15px 18px !important;
  }

  .v4-screen {
    scroll-margin-top: 72px !important;
  }

  .v4-screen h1 {
    font-size: clamp(25px, 7.5vw, 32px) !important;
    line-height: 1.1 !important;
  }

  .v4-screen .scan-help {
    font-size: 13px !important;
  }

  .v4-field-list {
    margin-top: 18px !important;
  }

  .v4-selection-meta {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 3px !important;
  }

  .v4-option > span {
    min-height: 56px !important;
    padding: 13px 51px 13px 14px !important;
    border-radius: 13px !important;
  }

  .v4-option b {
    font-size: 14px !important;
  }

  .v4-choice-mark,
  .v4-time-option i,
  .v4-time-check {
    right: 13px !important;
    width: 25px !important;
    height: 25px !important;
  }

  .v4-scale {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  .v4-scale-option span {
    min-height: 42px !important;
  }

  .v4-actions.scan-bottom {
    bottom: 6px !important;
    margin: 0 7px !important;
    padding: 8px !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas:
      "status status"
      "back next" !important;
    gap: 7px !important;
  }

  .v4-actions .scan-back {
    grid-area: back !important;
  }

  .v4-actions .scan-next {
    grid-area: next !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .v4-action-status {
    grid-area: status !important;
    min-height: 31px !important;
    padding: 2px 6px !important;
  }

  .v4-action-status span {
    display: none !important;
  }

  .v4-action-status strong {
    font-size: 11px !important;
    white-space: normal !important;
  }
}

@media (max-width: 380px) {
  .v4-scan-page .scan-brand strong {
    max-width: 165px !important;
    font-size: 14px !important;
  }

  .v4-form .scan-top {
    grid-template-columns: 96px minmax(0, 1fr) !important;
  }

  .v4-actions .scan-back,
  .v4-actions .scan-next {
    min-height: 46px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v4-option > span,
  .v4-form .scan-progress i {
    transition: none !important;
  }

  .v4-field.has-error .v4-options,
  .v4-field.has-error .v4-time-wrap,
  .v4-field.has-error .v4-scale,
  .v4-field.has-error .v4-textarea {
    animation: none !important;
  }
}

/* CMEL_V4_ONE_QUESTION_UI_V5_END */
/* CMEL_V4_MOBILE_PROGRESS_WIDTH_V8_START */

/*
  Mobile only: place the progress row beneath the route label so
  the bar receives the full card width instead of shrinking beside it.
  Desktop layout and page-scrolling behaviour remain unchanged.
*/
@media (max-width: 720px) {
  .v4-form .scan-top {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 11px !important;
  }

  .v4-form .scan-progress {
    min-width: 0 !important;
    grid-template-columns:
      max-content minmax(110px, 1fr) !important;
    gap: 10px !important;
  }

  .v4-form .scan-progress > div {
    min-width: 110px !important;
  }
}

@media (max-width: 380px) {
  .v4-form .scan-top {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .v4-form .scan-progress {
    grid-template-columns:
      max-content minmax(96px, 1fr) !important;
  }

  .v4-form .scan-progress > div {
    min-width: 96px !important;
  }
}

/* CMEL_V4_MOBILE_PROGRESS_WIDTH_V8_END */
/* CMEL_V4_MOBILE_FLOW_V9_START */
.v4-mobile-time-picker {
  display: none !important;
}

@media (max-width: 720px) {
  .v4-time-input-wrap {
    display: none !important;
  }

  .v4-mobile-time-picker {
    min-height: 78px !important;
    padding: 12px 50px 12px 14px !important;
    border: 1.5px solid #dbe5e9 !important;
    border-radius: 14px !important;
    position: relative !important;
    display: grid !important;
    gap: 6px !important;
    background: #ffffff !important;
  }

  .v4-mobile-time-picker > span {
    color: #5d6b7f !important;
    font-size: 12px !important;
    font-weight: 800 !important;
  }

  .v4-mobile-time-picker select {
    width: 100% !important;
    min-height: 38px !important;
    padding: 0 28px 0 0 !important;
    border: 0 !important;
    outline: 0 !important;
    color: #12233c !important;
    background: transparent !important;
    font: inherit !important;
    font-size: 17px !important;
    font-weight: 900 !important;
  }

  .v4-mobile-time-picker.is-selected {
    border-color: #078f85 !important;
    background: #ebf9f6 !important;
  }

  .v4-mobile-time-picker.is-selected .v4-time-check {
    border-color: #078f85 !important;
    color: #ffffff !important;
    background: #078f85 !important;
  }

  .v4-stage.scan-stage {
    padding-bottom:
      calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .v4-actions.scan-bottom {
    bottom: max(7px, env(safe-area-inset-bottom)) !important;
    z-index: 300 !important;
    isolation: isolate !important;
  }

  .v4-scan-page {
    padding-bottom:
      calc(28px + env(safe-area-inset-bottom)) !important;
  }

  body:has(.v4-scan-page) .cmel-site-footer {
    display: none !important;
  }
}
/* CMEL_V4_MOBILE_FLOW_V9_END */

/* CMEL_POWER_V7_CHOICE_MARK_START */

/* Only show the tick after the answer is selected. */
.v4-option .v4-choice-mark {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0.75) !important;
}

.v4-option input:checked + span .v4-choice-mark {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
}

/* CMEL_POWER_V7_CHOICE_MARK_END */

/* CMEL_V4_PRO_MOBILE_V10_START */

/*
  Final authoritative mobile presentation.

  Mobile behaves like a compact full-screen application:
  - the header and controls remain visible;
  - only the question area scrolls when necessary;
  - answer options remain large enough to tap;
  - Continue has a genuine disabled state;
  - selection ticks are geometrically centred.
*/

/* Repair the choice mark centring at every viewport size. */
.v4-option .v4-choice-mark {
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0 !important;
  line-height: 1 !important;
  transform: translateY(-50%) scale(0.78) !important;
  transform-origin: center !important;
}

.v4-option .v4-choice-mark::after {
  content: "" !important;
  width: 6px !important;
  height: 10px !important;
  margin-top: -2px !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  display: block !important;
  transform: rotate(45deg) !important;
}

.v4-option input:checked + span .v4-choice-mark,
.v4-option.is-selected .v4-choice-mark {
  transform: translateY(-50%) scale(1) !important;
}

/* Continue must visibly look unavailable until the screen is answered. */
.v4-actions .scan-next:disabled,
.v4-actions .scan-next[aria-disabled="true"],
.v4-actions .scan-next.is-disabled {
  border: 1px solid #d8e1e5 !important;
  color: #87939e !important;
  background: #edf2f4 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.v4-actions .scan-next:not(:disabled):not([aria-disabled="true"]) {
  border-color: transparent !important;
  color: #ffffff !important;
  background:
    linear-gradient(
      135deg,
      #0baa9d,
      #067a72
    ) !important;
  box-shadow:
    0 10px 22px rgba(7, 143, 133, 0.22) !important;
}

@media (max-width: 720px) {
  html:has(.v4-scan-page),
  body:has(.v4-scan-page) {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body:has(.v4-scan-page) {
    margin: 0 !important;
    background: #f4f8f8 !important;
  }

  /*
    Mobile does not need the additional outer navigation because the
    questionnaire card already identifies the route and progress.
  */
  .v4-scan-page > .scan-nav {
    display: none !important;
  }

  .v4-scan-page {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
    background:
      radial-gradient(
        circle at 100% 0%,
        rgba(11, 174, 159, 0.08),
        transparent 18rem
      ),
      linear-gradient(
        180deg,
        #f8fbfb 0%,
        #f1f7f6 100%
      ) !important;
  }

  .v4-form.scan-shell {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  /* Compact route and progress header. */
  .v4-form .scan-top {
    min-height: 62px !important;
    padding:
      calc(8px + env(safe-area-inset-top))
      14px
      9px !important;
    border-bottom: 1px solid #e4ecee !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    gap: 2px !important;
    background: rgba(255, 255, 255, 0.98) !important;
  }

  .v4-form .scan-route {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    color: #078f85 !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    font-weight: 950 !important;
    letter-spacing: 0.11em !important;
  }

  .v4-form .v4-personal-label {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin: 1px 0 0 !important;
    color: #5f6f80 !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    font-weight: 750 !important;
  }

  .v4-form .scan-progress {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 5px 0 0 !important;
    display: grid !important;
    grid-template-columns:
      max-content minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 8px !important;
    align-items: center !important;
  }

  .v4-form .scan-progress > span {
    width: auto !important;
    color: #4c5b6e !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
  }

  .v4-form .scan-progress > div {
    width: 100% !important;
    min-width: 0 !important;
    height: 6px !important;
    border-radius: 999px !important;
  }

  /* Only this centre section scrolls when a long question requires it. */
  .v4-stage.scan-stage {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 13px 13px 9px !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-padding-bottom: 10px !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .v4-stage.scan-stage::-webkit-scrollbar {
    width: 4px !important;
  }

  .v4-stage.scan-stage::-webkit-scrollbar-thumb {
    border-radius: 999px !important;
    background: rgba(7, 143, 133, 0.18) !important;
  }

  .v4-screen {
    width: 100% !important;
    padding: 0 0 4px !important;
    scroll-margin-top: 0 !important;
  }

  .v4-screen .scan-kicker {
    margin: 0 0 5px !important;
    padding: 5px 9px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .v4-group-label {
    margin: 0 0 5px !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  .v4-screen h1 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(22px, 7.2vw, 28px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.038em !important;
  }

  .v4-screen .scan-help {
    margin: 6px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.32 !important;
  }

  .v4-field-list {
    margin-top: 12px !important;
    gap: 8px !important;
  }

  .v4-help {
    margin: 0 0 7px !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
  }

  .v4-selection-meta {
    margin: 0 0 7px !important;
    padding: 7px 9px !important;
    border-radius: 10px !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .v4-selection-meta span,
  .v4-selection-meta strong {
    font-size: 10px !important;
  }

  .v4-options.scan-options {
    margin: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  .v4-option > span {
    min-height: 46px !important;
    padding: 9px 45px 9px 13px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(18, 35, 60, 0.025) !important;
  }

  .v4-option b {
    font-size: 13px !important;
    line-height: 1.22 !important;
    letter-spacing: -0.01em !important;
  }

  .v4-choice-mark {
    right: 11px !important;
    top: 50% !important;
    width: 24px !important;
    height: 24px !important;
  }

  .v4-scale {
    gap: 5px !important;
  }

  .v4-scale-option span {
    min-height: 39px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
  }

  .v4-scale-labels {
    margin-top: 5px !important;
    font-size: 9px !important;
  }

  .v4-time-option,
  .v4-mobile-time-picker {
    min-height: 48px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }

  .v4-textarea.scan-textarea {
    min-height: 94px !important;
    margin-top: 8px !important;
    padding: 13px !important;
    border-radius: 13px !important;
    font-size: 15px !important;
  }

  /*
    The control bar is a permanent bottom grid row. It no longer needs
    a fake status row or 112px of reserved empty question padding.
  */
  .v4-actions.scan-bottom {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding:
      7px
      10px
      calc(7px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid #dde7e9 !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-columns:
      minmax(0, 0.82fr)
      minmax(0, 1.18fr) !important;
    grid-template-areas: "back next" !important;
    gap: 8px !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.985) !important;
    box-shadow: 0 -8px 24px rgba(18, 35, 60, 0.06) !important;
    backdrop-filter: blur(18px) !important;
  }

  .v4-action-status,
  .v4-actions .scan-build {
    display: none !important;
  }

  .v4-actions .scan-back,
  .v4-actions .scan-next {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
  }

  .v4-actions .scan-back {
    grid-area: back !important;
    border: 1px solid #dde5e8 !important;
    color: #5f6e7d !important;
    background: #f3f6f7 !important;
  }

  .v4-actions .scan-next {
    grid-area: next !important;
  }

  body:has(.v4-scan-page) .cmel-site-footer {
    display: none !important;
  }
}

/* Additional compression for small or short phones. */
@media (max-width: 380px), (max-height: 650px) and (max-width: 720px) {
  .v4-form .scan-top {
    min-height: 56px !important;
    padding:
      calc(6px + env(safe-area-inset-top))
      12px
      7px !important;
  }

  .v4-stage.scan-stage {
    padding: 10px 11px 6px !important;
  }

  .v4-screen .scan-kicker {
    margin-bottom: 4px !important;
  }

  .v4-screen h1 {
    font-size: clamp(21px, 6.8vw, 25px) !important;
    line-height: 1.06 !important;
  }

  .v4-screen .scan-help {
    margin-top: 4px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .v4-field-list {
    margin-top: 9px !important;
  }

  .v4-options.scan-options {
    gap: 6px !important;
  }

  .v4-option > span {
    min-height: 42px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }

  .v4-actions.scan-bottom {
    min-height: 54px !important;
    padding-top: 6px !important;
    padding-bottom:
      calc(6px + env(safe-area-inset-bottom)) !important;
  }

  .v4-actions .scan-back,
  .v4-actions .scan-next {
    min-height: 42px !important;
  }
}

/* CMEL_V4_PRO_MOBILE_V10_END */
