.mfo-workflow-shell .mfo-analysis-selection {
  align-items: flex-start;
  gap: 24px;
}

.mfo-analysis-scenario-controls {
  flex: 1 1 0;
  min-width: 0;
}

.mfo-final-choice-panel {
  width: 100%;
  flex: 0 0 440px;
  max-width: 440px;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 16px;
  border: 1px solid #dbe8d8;
  background: #f4f8f2;
}

.mfo-workflow-shell .mfo-final-choice-editor {
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
}

.mfo-final-choice-guidance .widget-html-content p {
  margin: 8px 0 0;
  max-width: 600px;
  color: #3c4a3c;
  font-size: 1rem;
  line-height: 1.4;
}

.mfo-final-choice-editor .widget-html-content {
  min-width: 0;
}

.mfo-final-choice-editor .widget-html-content h3 {
  margin: 0;
}

.mfo-final-choice-note {
  margin: 0;
  color: #3c4a3c;
  font-size: 0.9rem;
  line-height: 1.4;
}

.mfo-final-pick-warning {
  margin: 12px 0 0 0;
  padding: 10px 14px;
  border-left: 4px solid var(--mfo-warning-edge);
  background: var(--mfo-warning-bg);
  color: var(--mfo-text-dark);
  font-size: 0.95rem;
  line-height: 1.4;
}

.mfo-final-choice-panel .mfo-final-pick-warning {
  margin: 0;
}

.mfo-workflow-shell .mfo-final-choice-panel .final-choice-button {
  flex: 0 1 auto;
  align-self: flex-end;
  min-width: 0 !important;
  max-width: 100%;
  height: auto;
  white-space: normal;
}

@media (max-width: 1100px) {
  .mfo-workflow-shell .mfo-analysis-selection {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .mfo-analysis-scenario-controls,
  .mfo-final-choice-panel {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .mfo-workflow-shell .mfo-final-choice-panel .final-choice-button {
    align-self: flex-start;
  }
}

.mfo-final-pick-locked-status {
  margin: 12px 0 0 0;
  padding: 10px 14px;
  border-left: 4px solid var(--mfo-success-edge);
  background: var(--mfo-success-bg);
  color: var(--mfo-text-dark);
  font-size: 0.95rem;
  line-height: 1.4;
}

.mfo-workflow-shell .mfo-rating-summary {
  gap: 16px;
  margin: 6px 0;
  padding: 16px clamp(12px, 2vw, 24px);
}

.mfo-rating-summary .widget-html-content h2,
.mfo-rating-summary .widget-html-content p {
  margin: 0;
}

.mfo-rating-chosen-plan {
  font-size: 0.95rem;
  color: var(--mfo-text-soft);
}

.mfo-rating-chosen-plan strong {
  display: inline;
  margin-left: 6px;
  color: #214e2c;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

.mfo-rating-scale-endpoints {
  color: var(--mfo-text-soft);
  font-size: 0.85rem;
  margin: 0;
}

.mfo-workflow-shell .mfo-rating-guidance {
  gap: 4px;
  margin-bottom: 8px;
}

.mfo-rating-submit-row {
  margin-top: 12px;
}

.mfo-rating-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--mfo-text-soft);
}

.mfo-rating-steps li[aria-current="step"] {
  color: var(--mfo-text-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--mfo-success-edge);
}

.mfo-rating-navigation {
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.mfo-workflow-shell .mfo-rating-navigation .widget-button {
  width: auto;
  /* Override the shell's max-content minimum so long labels can wrap. */
  min-width: 0 !important;
  max-width: 100%;
  height: auto;
  min-height: 44px;
  padding: 10px 16px;
  white-space: normal;
}

.mfo-rating-comment-title {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
}

.mfo-rating-rule {
  color: var(--mfo-text-soft);
  font-size: 0.85rem;
  margin: 0;
}

.mfo-rating-rule-active {
  color: var(--mfo-danger-edge);
  font-weight: 600;
}

.mfo-rating-rule-slot {
  display: grid;
}

.mfo-rating-rule-slot > p {
  grid-area: 1 / 1;
}

.mfo-rating-rule-size {
  visibility: hidden;
}

.mfo-workflow-shell .mfo-rating-choices {
  margin-bottom: 16px;
  gap: 12px;
}

.mfo-rating-numbers.widget-radio {
  height: auto;
  margin: 0;
  flex-direction: column;
  align-items: stretch;
}

.mfo-rating-numbers > .widget-label {
  width: auto;
  height: auto;
  margin: 0 0 8px;
  text-align: left;
  white-space: normal;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
}

.mfo-rating-numbers .widget-radio-box {
  display: flex;
  flex-flow: row nowrap;
  gap: 6px;
  margin: 0 !important;
  padding: 0;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mfo-rating-numbers .widget-radio-box label {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin: 0;
  padding: 0;
  border: 2px solid #b9cbb2;
  border-radius: 6px;
  background: var(--mfo-panel-bg);
  color: var(--mfo-text-dark);
  font-weight: 600;
  cursor: pointer;
}

.mfo-rating-numbers .widget-radio-box label:hover {
  background: #eaf0e6;
}

.mfo-rating-numbers .widget-radio-box label:has(input:checked) {
  border-color: var(--mfo-success-edge);
  background: #e3efde;
  color: #2d5427;
  box-shadow: inset 0 0 0 1px var(--mfo-success-edge);
}

/* Keep the native radios focusable while making the whole number clickable. */
.mfo-rating-numbers input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mfo-rating-shared-comment {
  margin-top: 8px;
}

.mfo-workflow-shell .mfo-rating-shared-comment textarea {
  box-sizing: border-box;
  field-sizing: content;
  width: 100%;
  height: auto;
  min-height: 80px;
  max-height: none;
  overflow-y: auto;
  resize: none;
}

.mfo-workflow-shell .mfo-rating-fields {
  /* Each column must fit all eleven 44px numbers and their ten 6px gaps.
     Below that combined width the comment automatically moves underneath. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 544px), 1fr));
  align-items: start;
  gap: 18px;
}

.mfo-rating-status-error {
  margin: 12px 0 0 0;
  padding: 10px 14px;
  border-left: 4px solid var(--mfo-danger-edge);
  background: var(--mfo-danger-bg);
  color: var(--mfo-text-dark);
}

.mfo-rating-thank-you {
  padding: 32px 28px;
  border: 1px solid var(--mfo-success-edge);
  border-radius: 12px;
  background: var(--mfo-success-bg);
  text-align: center;
  color: var(--mfo-text-dark);
}

.mfo-rating-thank-you h3 {
  margin: 0 0 12px 0;
  color: var(--mfo-text-dark);
}

.mfo-rating-thank-you p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.mfo-confirm-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.mfo-confirm-popup-card {
  background: var(--mfo-panel-bg);
  border: 1px solid var(--mfo-panel-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  padding: 22px 26px;
  max-width: 480px;
  width: min(90vw, 480px);
  gap: 12px;
}

.mfo-confirm-popup-card h3 {
  margin-top: 0;
}

.mfo-confirm-popup-card .mfo-final-choice-confirm-plan {
  display: block;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #dbe8d8;
  border-radius: 6px;
  background: #f4f8f2;
}

.mfo-confirm-popup-card .mfo-final-choice-confirm-caption {
  display: block;
  color: var(--mfo-text-soft);
  font-size: 1rem;
}

.mfo-confirm-popup-card .mfo-final-choice-confirm-name {
  display: block;
  margin-top: 4px;
  color: var(--mfo-text-dark);
  font-size: 1.125rem;
  font-weight: 700 !important;
}

.mfo-confirm-popup-card .mfo-final-choice-confirm-warning {
  display: block;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 500;
}

.confirm-buttons {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
