/* ==========================================================================
   Risk Assessment — Visitor Trial Theme
   Scoped entirely under body.ra-trial-theme so it can never collide with
   the shared/legacy front/taskmanager stylesheets loaded on this page, or
   with the IR/MS trial theme files loaded on their own pages.

   Values below (colors, radii, shadows, the amber/gold accent) are ported
   directly from the live/logged-in RA module's own compiled stylesheet
   (webroot/css/dist/module-risk-assessment.min.css) and its shared design
   tokens (webroot/css/dist/task-complete.min.css), so the trial view reads
   as the same product rather than a re-skin -- the same approach already
   used for the Method Statement trial theme. Layout is hand-rolled as a
   full-viewport flex "sticky footer" (like the MS trial container) rather
   than the live module's own "margin:20px card" chrome, since this page
   has no surrounding logged-in app shell to sit inside.
   ========================================================================== */

body.ra-trial-theme {
  --ra-primary: #fbbf24;
  --ra-primary-dark: #f3b619;
  --ra-primary-light: #fde68a;
  --ra-primary-txt: #000000;
  --ra-primary-rgb: 251, 191, 36;
  --ra-bg-primary: #fff5e6;

  --ra-white: #ffffff;
  --ra-gray-50: #f9fafb;
  --ra-gray-100: #f3f4f6;
  --ra-gray-200: #e5e7eb;
  --ra-gray-300: #d1d5db;
  --ra-gray-400: #9ca3af;
  --ra-gray-500: #6b7280;
  --ra-gray-600: #4b5563;
  --ra-gray-700: #374151;
  --ra-gray-800: #1f2937;

  --ra-success: #10b981;
  --ra-danger: #ef4444;
  --ra-light-blue: #f1f5f9;

  --ra-radius-sm: 6px;
  --ra-radius-md: 10px;
  --ra-radius: 12px;
  --ra-radius-lg: 16px;
  --ra-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --ra-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --ra-transition: all 0.2s ease;
}

/* ---------- Page chrome ---------- */
body {
  background: var(--ra-gray-100);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

body::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

body::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

body::-webkit-scrollbar-thumb:hover {
    background-color: #cbd5e1;
}

::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #cbd5e1;
}

:not(.btn-check)+.btn:active{
  color: #000 !important;
}

/* Intro / marketing splash */
body.ra-trial-theme .ra-intro-screen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
  max-width: calc(100vw - 40px);
  margin: 20px auto;
  padding: 16px;
  background: var(--ra-white);
  border-radius: var(--ra-radius-lg);
  box-shadow: var(--ra-shadow-lg);
}
body.ra-trial-theme .ra-intro-media {
  /* flex: 1 1 800px;
  min-width: 260px; */
  flex: 20;
}
body.ra-trial-theme .ra-intro-media-frame {
  background: var(--ra-gray-50);
  border: 1px solid var(--ra-gray-200);
  border-radius: var(--ra-radius);
  padding: 16px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  box-shadow: var(--ra-shadow);
}
body.ra-trial-theme .ra-intro-media img {
  width: 100%;
  display: block;
  border-radius: var(--ra-radius-sm);
}
body.ra-trial-theme .ra-intro-content {
  /* flex: 1 1 380px; */
  flex: 7;
}
body.ra-trial-theme .ra-intro-badge {
  display: inline-block;
  background: var(--ra-bg-primary);
  color: var(--ra-primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
body.ra-trial-theme .ra-intro-content h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--ra-gray-800);
  margin: 0 0 16px;
  line-height: 1.2;
}
body.ra-trial-theme .ra-intro-content p {
  color: var(--ra-gray-600);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}
body.ra-trial-theme .ra-intro-highlights {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.ra-trial-theme .ra-intro-highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ra-gray-700);
  font-size: 13px;
  font-weight: 500;
}
body.ra-trial-theme .ra-intro-highlights li i {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ra-bg-primary);
  color: var(--ra-primary-dark);
  border-radius: 50%;
  font-size: 11px;
}

/* ---------- Modern project container (flex sticky-footer) ---------- */
body.ra-trial-theme .modern-project-container {
  /* display: block; */
  /* flex-direction: column; */
  background: var(--ra-white);
  margin: 20px;
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
body.ra-trial-theme .project-header {
  background: var(--ra-primary);
  color: var(--ra-primary-txt);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: var(--ra-shadow);
  flex-shrink: 0;
}
body.ra-trial-theme .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.ra-trial-theme .project-icon {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
body.ra-trial-theme .project-icon svg {
  width: 22px;
  height: 22px;
}
body.ra-trial-theme .header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  padding-bottom: 0px !important;
  color: var(--ra-primary-txt) !important;
}

body.ra-trial-theme .project-content {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
body.ra-trial-theme .ra-pdf-screen .project-cards{
  height: calc(100vh - 120px);
}

body.ra-trial-theme .project-cards,
body.ra-trial-theme .hazard-main-panel,
body.ra-trial-theme .risk-assessment-main {
  flex: 1;
  min-width: 0;
  padding: 24px;
  background: var(--ra-gray-50);
  /* width: calc(100vw - 450px); */
  width: calc(100vw - 490px);
}
body.ra-trial-theme .project-cards,
body.ra-trial-theme .risk-assessment-main {
  overflow-y: auto;
  height: calc(100vh - 186px);
}

body.ra-trial-theme .progress-sidebar {
  width: 450px;
  flex-shrink: 0;
  background: var(--ra-gray-50);
  border-left: 1px solid var(--ra-gray-200);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  height: calc(100vh - 186px);
}
@media (max-width: 900px) {
  body.ra-trial-theme .project-content {
    flex-direction: column;
  }
  body.ra-trial-theme .progress-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--ra-gray-200);
  }
  body.ra-trial-theme .ra-intro-screen {
    margin: 20px auto;
    padding: 24px;
    gap: 24px;
  }
  body.ra-trial-theme .ra-intro-media-frame {
    max-height: 320px;
  }
  body.ra-trial-theme .ra-intro-content h2 {
    font-size: 24px;
  }
  body.ra-trial-theme .ra-intro-start {
    width: 100%;
    justify-content: center;
  }
}

body.ra-trial-theme .action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--ra-white);
  border-top: 1px solid var(--ra-gray-200);
  flex-shrink: 0;
}
body.ra-trial-theme .button-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.ra-trial-theme .btn {
  text-decoration: none;
  transition: var(--ra-transition);
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  padding: 10px 20px;
}
body.ra-trial-theme .btn-primary {
  background: var(--ra-primary) !important;
  border-color: var(--ra-primary) !important;
  color: var(--ra-primary-txt) !important;
}
body.ra-trial-theme .btn-primary:hover {
  background: var(--ra-primary-dark) !important;
  border-color: var(--ra-primary-dark) !important;
}
body.ra-trial-theme .btn-primary:disabled,
body.ra-trial-theme .btn-primary.disabled,
body.ra-trial-theme .btn-primary.disable {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
/* Repositioned after .btn/.btn-primary (same selector specificity) so these
   larger dimensions actually win by source order instead of being silently
   overridden by the generic button rules above. */
body.ra-trial-theme .ra-intro-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--ra-radius);
  box-shadow: var(--ra-shadow);
}
body.ra-trial-theme .ra-intro-start:hover {
  transform: translateY(-1px);
  box-shadow: var(--ra-shadow-lg);
}
body.ra-trial-theme .ra-intro-start i {
  transition: var(--ra-transition);
}
body.ra-trial-theme .ra-intro-start:hover i {
  transform: translateX(3px);
}
body.ra-trial-theme .btn-secondary {
  background: var(--ra-white);
  border-color: var(--ra-gray-300);
  color: var(--ra-gray-700);
}
body.ra-trial-theme .btn-cancel {
  background: var(--ra-white);
  color: var(--ra-gray-700);
  border-color: var(--ra-gray-200);
}
body.ra-trial-theme .btn-cancel:hover {
  border-color: var(--ra-gray-400);
}

/* ---------- Form fields ---------- */
body.ra-trial-theme .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
body.ra-trial-theme .form-group.full-width {
  width: 100%;
}
body.ra-trial-theme .form-label {
  font-weight: 600;
  color: var(--ra-gray-700);
  font-size: 13px;
  margin-bottom: 6px;
}
body.ra-trial-theme .form-control,
body.ra-trial-theme select.form-control,
body.ra-trial-theme textarea.form-control {
  padding: 10px 14px;
  border: 1px solid var(--ra-gray-200);
  border-radius: var(--ra-radius-sm);
  font-size: 13px;
  color: var(--ra-gray-800);
  background: var(--ra-white);
  transition: var(--ra-transition);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075) !important;
}
body.ra-trial-theme .form-control:focus {
  outline: none;
  border-color: var(--ra-primary);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15) !important;
}
body.ra-trial-theme textarea.form-control {
  min-height: 90px;
  resize: vertical;
}
body.ra-trial-theme .error-msg {
  color: var(--ra-danger);
  font-size: 12px;
  margin-top: 4px;
}
/* Set by showError()/clearError() (webroot/js/front/form-error.js) on the
   field itself, or on its .select2 rendered widget for select2 fields. */
body.ra-trial-theme .form-control.input-error,
body.ra-trial-theme input.input-error,
body.ra-trial-theme textarea.input-error,
body.ra-trial-theme select.input-error {
  border-color: var(--ra-danger) !important;
}
body.ra-trial-theme .select2-selection.input-error {
  border-color: var(--ra-danger) !important;
}
body.ra-trial-theme .input-error:focus{
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
/* body.ra-trial-theme .project-info-card .card-content {
  background: var(--ra-white);
  border-radius: var(--ra-radius);
  box-shadow: var(--ra-shadow);
  border: 1px solid var(--ra-gray-200);
  padding: 28px;
  max-width: 640px;
} */
body.ra-trial-theme .ra-terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ra-gray-700);
  font-weight: normal;
  cursor: pointer;
}
body.ra-trial-theme .ra-terms-check input {
  margin-top: 3px;
}
body.ra-trial-theme .ra-terms-check.error-term,
body.ra-trial-theme .ra-terms-check .error-term {
  color: var(--ra-danger);
}

/* ---------- Hazard selection grid ---------- */
body.ra-trial-theme .hazard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--ra-white);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--ra-gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body.ra-trial-theme .selected-count {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
}
body.ra-trial-theme .hazard-search {
  flex: 1 1 260px;
  min-width: 200px;
}
body.ra-trial-theme .search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
body.ra-trial-theme .search-icon {
  position: absolute;
  left: 12px;
  color: var(--ra-gray-400);
  font-size: 13px;
  z-index: 2;
}
body.ra-trial-theme .search-input {
  display: block;
  width: 100%;
  padding: 0.55rem 2.5rem;
  font-size: 13px;
  color: var(--ra-gray-700);
  background: var(--ra-white);
  border: 1px solid var(--ra-gray-300);
  border-radius: var(--ra-radius-sm);
  transition: var(--ra-transition);
}
body.ra-trial-theme .search-input:focus {
  outline: none;
  border-color: var(--ra-primary);
  box-shadow: 0 0 0 3px rgba(var(--ra-primary-rgb), 0.15);
}
body.ra-trial-theme .clear-search {
  position: absolute;
  right: 14px;
  color: var(--ra-gray-400);
  cursor: pointer;
  font-size: 13px;
}
body.ra-trial-theme .clear-search:hover {
  color: var(--ra-gray-700);
}
body.ra-trial-theme .no-hazards-found {
  padding: 24px;
  text-align: center;
  color: var(--ra-gray-500);
  font-size: 13px;
}
body.ra-trial-theme .hazard-list-container{
  height: calc(100vh - 298px);
  overflow-y: auto;
  margin-top: 10px;
  padding: 4px 0px;
}
body.ra-trial-theme .hazard-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.ra-trial-theme .hazard-card {
  background: var(--ra-white);
  border: 2px solid var(--ra-gray-300);
  border-radius: var(--ra-radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--ra-transition);
}
body.ra-trial-theme .hazard-card:hover {
  border-color: var(--ra-primary);
  transform: translateY(-2px);
  /* box-shadow: 0 8px 20px rgba(var(--ra-primary-rgb), 0.2); */
}
body.ra-trial-theme .hazard-card.active {
  border-color: var(--ra-primary);
  background: var(--ra-bg-primary);
}
body.ra-trial-theme .hazard-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
body.ra-trial-theme .hazard-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.ra-trial-theme .hazard-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.ra-trial-theme .hazard-info {
  flex: 1;
  min-width: 0;
}
body.ra-trial-theme .hazard-info .hazard-description {
  color: var(--ra-gray-700);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

/* ---------- Hazard detail / control-measures screen ---------- */
body.ra-trial-theme .hazard-header-card {
  background: var(--ra-white);
  border-radius: var(--ra-radius-lg);
  box-shadow: var(--ra-shadow);
  border: 1px solid var(--ra-gray-200);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
body.ra-trial-theme .hazard-icon-container {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
body.ra-trial-theme .hazard-icon-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.ra-trial-theme .hazard-input-section {
  flex: 1;
  min-width: 0;
}

body.ra-trial-theme .risk-dropdowns-section {
  margin-bottom: 24px;
}
body.ra-trial-theme .risk-dropdowns-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
/* Matches the live/logged-in RA module: once a control is marked
   "Additional" the Additional Likelihood card un-hides (.disable removed --
   see raResetAdditionalLikelihood()/.status-btn-inline in
   visitor-ra-trial.js), and the grid drops from 3 cards per row to 2 so all
   four cards (Worst Case, Likelihood, Who is at Risk, Additional
   Likelihood) get equal, wider columns instead of being squeezed to fit a
   3-column row. */
body.ra-trial-theme .risk-dropdowns-grid:has(.additional-liklihood:not(.disable)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.ra-trial-theme .risk-dropdown-card {
  background: var(--ra-white);
  border-radius: var(--ra-radius);
  border: 1px solid var(--ra-gray-200);
  padding: 16px;
  box-shadow: var(--ra-shadow);
}
body.ra-trial-theme .dropdown-label {
  display: block;
  font-weight: 600;
  color: var(--ra-gray-700);
  font-size: 13px;
  margin-bottom: 8px;
}
body.ra-trial-theme .risk-dropdown-card.disable {
  display: none;
}

/* Worst Case / Likelihood / Additional Likelihood -- Bootstrap-modal picker
   trigger (replaces the old plain <select>). Ported from the live module's
   .risk-dropdown-trigger/.dropdown-arrow tokens. */
body.ra-trial-theme .risk-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
body.ra-trial-theme .risk-dropdown-trigger > span {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.ra-trial-theme .risk-dropdown-trigger:hover {
  border-color: var(--ra-primary);
}
body.ra-trial-theme .risk-dropdown-trigger .dropdown-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ra-gray-500);
}

/* "Who is at Risk" -- a checkbox multi-select modal opened from a
   .form-control-styled trigger, distinct from the single-value
   .risk-dropdown-trigger cards (Worst Case / Likelihood / Additional
   Likelihood) since it also shows a selected-count badge. */
body.ra-trial-theme .modal-list-dropdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
body.ra-trial-theme .modal-list-dropdown:hover {
  border-color: var(--ra-primary);
}
body.ra-trial-theme .modal-list-dropdown .selected-modal-list-dropdown {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.ra-trial-theme .modal-list-dropdown .modal-list-dropdown-count {
  flex: 0 0 auto;
  color: #000;
  background-color: var(--ra-primary);
}
body.ra-trial-theme .modal-list-dropdown .dropdown-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ra-gray-500);
}

body.ra-trial-theme .controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
body.ra-trial-theme .controls-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ra-gray-800);
  margin: 0;
}
body.ra-trial-theme .controls-title svg {
  width: 20px;
  height: 20px;
  color: var(--ra-primary-dark);
}
body.ra-trial-theme .control-item {
  background: var(--ra-white);
  border: 1px solid var(--ra-gray-200);
  border-radius: var(--ra-radius);
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
  transition: var(--ra-transition);
}
body.ra-trial-theme .control-item.active {
  border-color: var(--ra-primary);
}
body.ra-trial-theme .control-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
body.ra-trial-theme .control-number {
  width: 32px;
  height: 32px;
  background: var(--ra-gray-300);
  color: var(--ra-gray-600);
  border-radius: var(--ra-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
body.ra-trial-theme .control-textarea {
  flex: 1;
  min-height: 60px;
  padding: 10px 12px;
  border: 2px solid var(--ra-gray-200);
  border-radius: var(--ra-radius-sm);
  font-size: 13px;
  resize: vertical;
}
body.ra-trial-theme .control-textarea:focus {
  outline: none;
  border-color: var(--ra-primary);
}
body.ra-trial-theme .control-selection-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
body.ra-trial-theme .control-checkbox-section {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.ra-trial-theme .control-checkbox-wrapper {
  display: flex;
}
body.ra-trial-theme .control-checkbox-label {
  font-size: 13px;
  color: var(--ra-gray-600);
  font-weight: 500;
}
body.ra-trial-theme .hazard-control-checkbox {
  display: none;
}
body.ra-trial-theme .checkbox-label {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ra-gray-300);
  border-radius: 5px;
  background: var(--ra-white);
  cursor: pointer;
  position: relative;
  transition: var(--ra-transition);
}
body.ra-trial-theme .hazard-control-checkbox:checked + .checkbox-label {
  background: var(--ra-primary);
  border-color: var(--ra-primary);
}
body.ra-trial-theme .hazard-control-checkbox:checked + .checkbox-label::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--ra-primary-txt);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
body.ra-trial-theme .control-actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.ra-trial-theme .status-btn-inline {
  padding: 6px 12px;
  border: 1px solid var(--ra-gray-300);
  border-radius: var(--ra-radius-sm);
  background: var(--ra-white);
  color: var(--ra-gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--ra-transition);
  white-space: nowrap;
}
body.ra-trial-theme .status-btn-inline.active {
  background: var(--ra-primary);
  border-color: var(--ra-primary);
  color: var(--ra-primary-txt);
}
body.ra-trial-theme .control-cancel-btn {
  border-color: var(--ra-danger);
  color: var(--ra-white);
  background: var(--ra-danger);
  margin-left: auto;
}
body.ra-trial-theme .control-cancel-btn:hover {
  background: var(--ra-danger);
  color: var(--ra-white);
}

/* ---------- Progress sidebar ---------- */
body.ra-trial-theme .overall-progress {
  background: var(--ra-white);
  padding: 18px;
  border-radius: var(--ra-radius);
  border: 1px solid var(--ra-gray-200);
}
body.ra-trial-theme .overall-progress h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ra-gray-700);
}
body.ra-trial-theme .progress-bar {
  width: 100%;
  height: 8px;
  background: var(--ra-gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
body.ra-trial-theme .progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--ra-primary) 0%, #f59e0b 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 4px;
}
body.ra-trial-theme .progress-text {
  font-size: 12px;
  color: var(--ra-gray-500);
  text-align: center;
}
body.ra-trial-theme .progress-step.progress-sub-step{
  padding: 6px;
  background: white;
  border-radius: 8px;
  border: 1px solid #ccc;
}
body.ra-trial-theme .progress-step.progress-sub-step.active{
  border-left: 3px solid #f5a623;
  border-color: #f5a623;
}
body.ra-trial-theme .progress-step.progress-sub-step.completed {
  border-color: #10b981;
}
body.ra-trial-theme .progress-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.ra-trial-theme .progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  cursor: default;
}
body.ra-trial-theme .progress-step[data-jump-section] {
  cursor: pointer;
}
body.ra-trial-theme .step-indicator {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--ra-gray-200);
  color: var(--ra-gray-500);
}
body.ra-trial-theme .step-indicator.active {
  background: var(--ra-primary);
  color: var(--ra-primary-txt);
}
body.ra-trial-theme .step-indicator.completed {
  background: var(--ra-success);
  color: var(--ra-white);
}
body.ra-trial-theme .step-indicator.completed+.step-content .step-title{
  color: var(--ra-success);
}
body.ra-trial-theme .step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ra-gray-800);
}
body.ra-trial-theme .step-description {
  font-size: 13px;
  color: var(--ra-gray-500);
  /* margin-top: 2px; */
}
body.ra-trial-theme .progress-sub {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 8px;
  padding-left: 12px;
  /* border-left: 2px solid var(--ra-gray-200); */
}
body.ra-trial-theme .progress-sub-step .step-indicator {
  width: 26px;
  height: 26px;
  background: transparent;
  padding: 0;
}
body.ra-trial-theme .progress-sub-step .hazard-icon-container {
  width: 26px;
  height: 26px;
}
body.ra-trial-theme .progress-sub-step .hazard-icon-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.ra-trial-theme .progress-sub-step .step-description.truncate {
  font-size: 13px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.ra-trial-theme .progress-sub-step.completed .step-description {
  /* color: var(--ra-success); */
}

/* ---------- PDF / registration screen ---------- */
body.ra-trial-theme .ra-pdf-screen .project-content {
  flex-direction: column;
}
@media (min-width: 901px) {
  body.ra-trial-theme .ra-pdf-screen .project-content {
    flex-direction: row;
  }
}
body.ra-trial-theme .ra-pdf-preview-card {
  flex: 8;
  /* The embedded PDF (an <embed>, using the browser's own PDF viewer) has
     its own internal scrollbar for paging through the document. This card
     also had "overflow-y: auto" from the shared .project-cards rule above,
     which kicked in too since #pdfIframe/#gviewIframe had no defined
     height of their own (previously given a pixel height in JS computed
     off the *whole* #pdfScreen card, header included, which was always
     taller than this panel's own content box) -- so the PDF viewer's own
     scrollbar plus this panel's scrollbar showed at once. Laying this out
     as a column flex container lets #pdfIframe/#gviewIframe (flex:1 below)
     fill exactly the space left after .left-bottom-btns, and hiding this
     panel's own overflow leaves scrolling to the PDF viewer alone. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#pdfIframe,
#gviewIframe {
  flex: 1;
  min-height: 0;
}
#pdfIframe embed,
#gviewIframe {
  width: 100%;
  height: 100%;
  display: block;
}
body.ra-trial-theme .ra-register-card {
  flex: 3;
  background: var(--ra-white);
}
body.ra-trial-theme .ra-register-blurb {
  color: var(--ra-gray-600);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}
body.ra-trial-theme .ra-password-wrapper {
  position: relative;
}
body.ra-trial-theme .ra-password-wrapper a {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ra-gray-500);
}
body.ra-trial-theme .ra-finish-btn {
  width: 100%;
  margin-top: 8px;
}

/* ---------- Email OTP verification (registration screen) ---------- */
body.ra-trial-theme .ra-otp-section {
  padding: 16px;
  background: var(--ra-gray-50);
  border: 1px solid var(--ra-gray-200);
  border-radius: var(--ra-radius);
}
body.ra-trial-theme .ra-otp-hint {
  color: var(--ra-gray-600);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 12px;
}
body.ra-trial-theme .ra-send-otp-btn,
body.ra-trial-theme .ra-otp-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
body.ra-trial-theme .ra-otp-input-group {
  margin-top: 12px;
}
body.ra-trial-theme .ra-otp-input {
  /* letter-spacing: 1px; */
  font-weight: 400;
  /* text-align: center; */
  max-width: 200px;
}
body.ra-trial-theme .ra-otp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
body.ra-trial-theme .ra-otp-resend-btn.disabled,
body.ra-trial-theme .ra-otp-resend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
body.ra-trial-theme .ra-otp-status-msg {
  font-size: 12px;
  margin-top: 8px;
}
body.ra-trial-theme .ra-otp-status-msg.otp-status-success {
  color: var(--ra-success);
}
body.ra-trial-theme .ra-otp-status-msg.otp-status-error {
  color: var(--ra-danger);
}
body.ra-trial-theme .ra-otp-verified-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ra-success);
  font-weight: 600;
  font-size: 13px;
  margin-top: 8px;
}
body.ra-trial-theme .ra-otp-verified-msg i {
  font-size: 18px;
}

body.ra-trial-theme .left-bottom-btns {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
#pdfIframe embed {
  border-radius: var(--ra-radius);
}

body.ra-trial-theme .ra-loader {
  width: 40px;
  height: 40px;
  left: 50%;
  top: 50%;
  margin: -30px 0 0 -30px;
  position: fixed;
  z-index: 99999;
  text-align: center;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--ra-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


/* ---------- Custom hazard overlay + icon modal ---------- */
body.ra-trial-theme .ra-custom-hazard-screen .hazard-header-card,
body.ra-trial-theme .ra-custom-hazard-screen .risk-dropdown-card {
  /* max-width: 720px; */
}
body.ra-trial-theme .upload-hazard-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  cursor: pointer;
  border: 2px dashed var(--ra-gray-300);
  border-radius: var(--ra-radius-sm);
  padding: 4px;
}
/* The trial page deliberately doesn't load the live module's compiled
   bundle (module-risk-assessment.min.css / task-complete.min.css), which is
   where the live app's .modern-content background/opacity actually comes
   from. Without it the modal falls back to Bootstrap's own --bs-modal-bg
   variable, which can resolve to something washed-out/transparent-looking
   depending on the rest of the loaded stylesheet stack -- so make the
   modal panel's own solid background explicit here instead of relying on
   that variable. */
.fade {
  opacity: 1;
}

.modal-header {
  position: unset;
  background-color: transparent;
}
body.ra-trial-theme .modal-content.modern-content {
  background: var(--ra-white);
  opacity: 1;
  border: none;
  border-radius: var(--ra-radius-lg);
  box-shadow: var(--ra-shadow-lg);
}
body.ra-trial-theme .modal-backdrop {
  background-color: #000;
}
body.ra-trial-theme .modal-backdrop.show {
  opacity: 0.5;
}
body.ra-trial-theme .modern-modal .modern-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
  margin-bottom: 8px;
  border-bottom: none;
}
body.ra-trial-theme .modern-modal .modern-title {
  color: var(--ra-primary-txt);
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}
body.ra-trial-theme .modern-title>svg{
  background: #fff5e6;
  padding: 8px;
  border-radius: 10px;
}
body.ra-trial-theme .modern-modal .modern-close {
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(102, 102, 102);
  border-width: medium;
  border-style: none;
  border-color: currentcolor;
  border-image: none;
  background: rgb(245, 245, 245);
  border-radius: 10px;
  transition: 0.2s;
}
body.ra-trial-theme .modern-modal .x-icon {
  width: 20px;
  height: 20px;
  position: relative;
}
body.ra-trial-theme .modern-modal .x-icon::before,
body.ra-trial-theme .modern-modal .x-icon::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 0px;
  width: 20px;
  height: 2px;
  background-color: rgb(102, 102, 102);
}
body.ra-trial-theme .modern-modal .x-icon::before {
  transform: rotate(45deg);
}
body.ra-trial-theme .modern-modal .x-icon::after {
  transform: rotate(-45deg);
}
body.ra-trial-theme .modern-modal .modern-body {
  padding: 20px;
}
body.ra-trial-theme .modern-modal .modern-dialog {
  min-width: 480px;
  margin: 1.75rem auto;
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}
@media (max-width: 576px) {
  body.ra-trial-theme .modern-modal .modern-dialog {
    margin: 0.5rem auto;
    min-height: calc(100% - 1rem);
  }
}
body.ra-trial-theme .modal-list-container {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}
body.ra-trial-theme .modal-list-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.ra-trial-theme .modal-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ra-gray-200);
  border-radius: var(--ra-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ra-gray-700);
  font-weight: normal;
  cursor: pointer;
  transition: var(--ra-transition);
  margin-bottom: 0;
}
body.ra-trial-theme .modal-list-item:hover {
  border-color: var(--ra-primary);
  background: var(--ra-bg-primary);
}
body.ra-trial-theme .modal-list-item.active {
  border-color: var(--ra-primary);
  background: var(--ra-bg-primary);
}
body.ra-trial-theme .modal-list-item input[type="radio"],
body.ra-trial-theme .modal-list-item input[type="checkbox"] {
  display: none;
}
body.ra-trial-theme .modal-list-item .label-text {
  flex: 1;
}
body.ra-trial-theme .modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--ra-gray-200);
}
body.ra-trial-theme .modern-modal .error-msg {
  display: block;
  margin-top: 10px;
}
body.ra-trial-theme .iocn-modal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
body.ra-trial-theme .icon-box img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
body.ra-trial-theme .icon-box {
  border: 2px solid var(--ra-gray-200);
  border-radius: var(--ra-radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ra-transition);
}
body.ra-trial-theme .icon-box:hover {
  border-color: var(--ra-primary);
}

/* ---------- ModalDatePicker (Work Start/End Date, Assessment Date) ----------
   Ported from task-complete.min.css so the trial's date fields open the same
   look as the live/logged-in module, without loading that whole bundle. */
body.ra-trial-theme .datepicker-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.ra-trial-theme .datepicker-modal {
  background: var(--ra-white);
  border-radius: var(--ra-radius);
  box-shadow: var(--ra-shadow-lg);
  overflow: hidden;
  width: 90%;
  max-width: 400px;
  animation: raModalSlideIn 0.3s ease-out;
}
@keyframes raModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
body.ra-trial-theme .datepicker-modal-header {
  background-color: var(--ra-primary);
  color: var(--ra-primary-txt);
  padding: 20px;
  text-align: center;
}
body.ra-trial-theme .datepicker-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
}
body.ra-trial-theme .datepicker-modal-desc {
  font-size: 13px;
  opacity: 0.9;
  margin: 0;
}
body.ra-trial-theme .datepicker-modal-body {
  padding: 0;
}
body.ra-trial-theme .datepicker-modal-body .air-datepicker.-inline-{
  display: contents;
}
body.ra-trial-theme .air-datepicker-body--day-name {
  color: var(--ra-primary);
}

body.ra-trial-theme .datepicker-quick-actions {
  padding: 10px;
  border-top: 1px solid var(--ra-gray-200);
  border-bottom: 1px solid var(--ra-gray-200);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.ra-trial-theme .quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px;
  border-radius: var(--ra-radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--ra-gray-100);
  background: var(--ra-gray-100);
  color: var(--ra-gray-600);
  cursor: pointer;
  transition: var(--ra-transition);
  flex: 1;
  text-align: center;
  min-width: 80px;
}
body.ra-trial-theme .quick-action-btn:hover {
  background-color: var(--ra-gray-200);
  border-color: var(--ra-gray-200);
}
body.ra-trial-theme .datepicker-modal-footer {
  padding: 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
body.ra-trial-theme #step1::after{
  content: "";
  position: absolute;
  left: 14px;
  top: 34px;
  width: 2px;
  height: 20px;
  border: solid #b9b9b9;
  border-width: 0 2px 2px 0;
}
body.ra-trial-theme #step2::after{
  content: "";
  position: absolute;
  left: 14px;
  top: 34px;
  width: 2px;
  height: 20px;
  border: solid #b9b9b9;
  border-width: 0 2px 2px 0;
}

/* ==========================================================================
   Select2 skin
   --------------------------------------------------------------------------
   The trial layout (trial_ra_layout.php) loads select2.min.css/js and
   initialises every .select2 / .select2-without-search field on document
   ready, but this theme never gave it a skin - so it rendered with
   select2's own plain default look instead of matching this page's
   .form-control fields (country picker, and the Add Custom Hazard screen's
   "Worst case outcome" / "Likelihood given precautions in place"
   dropdowns). Mirrors the equivalent block in the IR trial theme
   (incident-trial-theme.css), using this file's --ra-* tokens and the same
   sizing as body.ra-trial-theme .form-control above.
   Date: 03/09/2026
   ========================================================================== */
body.ra-trial-theme .select2-container {
  z-index: 20;
  max-width: 100%;
}
body.ra-trial-theme .select2.select2-container--default,
body.ra-trial-theme .select2-without-search.select2-container--default {
  width: 100% !important;
}
body.ra-trial-theme .select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 10px 40px 10px 14px;
  background: var(--ra-white);
  border: 2px solid var(--ra-gray-200);
  border-radius: var(--ra-radius-sm);
  transition: var(--ra-transition);
}
body.ra-trial-theme .select2-container--default .select2-selection--single:hover {
  border-color: var(--ra-gray-300);
}
body.ra-trial-theme .select2-container--default.select2-container--open .select2-selection--single,
body.ra-trial-theme .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--ra-primary);
}
body.ra-trial-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  color: var(--ra-gray-800);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
body.ra-trial-theme .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--ra-gray-500);
  font-weight: 400;
}
body.ra-trial-theme .select2-container--default .select2-selection--single .select2-selection__arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: auto;
  width: auto;
}
body.ra-trial-theme .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--ra-gray-500) transparent transparent transparent;
}
body.ra-trial-theme .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--ra-gray-500) transparent;
}
body.ra-trial-theme .select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: var(--ra-gray-100);
  cursor: not-allowed;
}
body.ra-trial-theme .select2-dropdown {
  border: 2px solid var(--ra-gray-200);
  border-radius: var(--ra-radius-sm);
  box-shadow: var(--ra-shadow-lg);
  overflow: hidden;
  z-index: 1051;
}
body.ra-trial-theme .select2-container--default .select2-search--dropdown {
  padding: 8px;
  border-bottom: 1px solid var(--ra-gray-200);
}
body.ra-trial-theme .select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--ra-gray-200);
  border-radius: 6px;
  padding: 6px 10px;
}
body.ra-trial-theme .select2-container--default .select2-search--dropdown .select2-search__field:focus {
  outline: none;
  border-color: var(--ra-primary);
}
body.ra-trial-theme .select2-container--default .select2-results > .select2-results__options {
  max-height: 260px;
}
body.ra-trial-theme .select2-container--default .select2-results__option {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ra-gray-800);
  transition: var(--ra-transition);
}
body.ra-trial-theme .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--ra-bg-primary);
  color: var(--ra-primary-dark);
}
body.ra-trial-theme .select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: var(--ra-primary);
  color: var(--ra-primary-txt);
}

body.ra-trial-theme .air-datepicker-cell.-selected-,
body.ra-trial-theme .air-datepicker-cell.-selected-.-current- {
  background: var(--ra-primary) !important;
  color: var(--ra-primary-txt) !important;
  font-weight: 500;
}

body.ra-trial-theme .air-datepicker-cell.-current- {
  color: var(--ra-primary) !important;
}

body.ra-trial-theme .air-datepicker-nav{
  padding: 16px 20px;
}
body.ra-trial-theme .air-datepicker-body {
  padding: 15px;
}
body.ra-trial-theme .air-datepicker-cell {
  padding: 15px 10px;
  margin: 5px;
  line-height: 40px;
  border-radius: 6px;
  transition: all 0.2s;
}

body.ra-trial-theme .air-datepicker-nav--title,
body.ra-trial-theme .air-datepicker-nav--title i {
  color: var(--ra-gray-600);
  font-weight: 600;
}