/* Clear section boundaries without changing calculations or visibility. */
main > .workspace-section { margin-top:32px; }
main > #resultados { padding-top:12px; }
#multiResultsSection.panel { padding:0; border:0; background:transparent; box-shadow:none; }
#multiResultsSection > .bioaox-section-card { position:relative; margin:0 0 42px; padding:clamp(22px,3vw,38px); border:1px solid #bed5d6; border-top:5px solid #0c7480; border-radius:20px; background:#fff; box-shadow:0 8px 24px rgba(7,59,87,.06); }
#multiResultsSection > .response-overview { border-top-color:#527289; }
#multiResultsSection > #matrixCorrelation { border-top-color:#087e80; background:#f6fbfa; }
#multiResultsSection > #treatmentDecision { border-top-color:#9a7946; background:#fffdf8; }
.section-number { display:block; margin:0 0 12px; font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#315359; }
#multiResultsSection > .bioaox-section-card > h3 { margin:0 0 16px; padding-bottom:16px; border-bottom:1px solid #d6e3e3; font-size:clamp(21px,2.2vw,28px); line-height:1.25; }
#multiResultsSection > .bioaox-section-card > p { margin:0 0 18px; max-width:88ch; line-height:1.6; }
.section-lead { font-size:16px; }
.section-help { margin:18px 0 26px; padding:14px 18px; border-radius:10px; background:#eaf3f1; }
.section-help summary { cursor:pointer; font-weight:700; }
.section-help p { margin-top:12px; line-height:1.6; }
#matrixCorrelation .matrix-stage { padding:24px; margin-top:24px; border:1px solid #d5e3df; border-radius:14px; background:white; }
#matrixCorrelation .matrix-stage > h4,.matrix-results-zone > h4 { margin:0 0 20px; font-size:18px; font-weight:800; color:#073b57; }
.matrix-stage > p,.matrix-stage > label { line-height:1.6; }
#matrixCorrelation .matrix-controls { margin-top:0; }
#matrixCorrelation .matrix-variable-fieldset { margin-top:22px; }
#matrixCorrelation .matrix-results-zone { margin-top:28px; padding:26px 24px; background:#e9f3f1; border:1px solid #bad4cf; border-radius:14px; }
#matrixCorrelation .figure-actions,#treatmentDecision .figure-actions { gap:14px; margin:22px 0 6px; align-items:center; }
#matrixStatus,#decisionStatus { padding:14px 16px; margin:18px 0; border:1px solid #ccdcda; border-radius:10px; background:#fff; line-height:1.55; }
#matrixProjectInfo:empty,#matrixLoaded:empty { display:none; }
#treatmentDecision .table-wrap { margin:26px 0; }
#decisionOutput { margin-top:26px; padding-top:22px; border-top:2px solid #e3d7c4; }
#decisionOutput:empty { display:none; }
.matrix-legacy { margin:0 0 36px; padding:22px 26px; border:1px solid #cad9dd; border-radius:16px; background:#f0f4f6; }
.matrix-legacy > summary { line-height:1.5; }
.multi-results-grid { gap:22px; margin-top:24px; }
.results-view-menu { margin-bottom:28px; }
@media(max-width:600px) {
 main > .workspace-section { margin-top:24px; }
 #multiResultsSection > .bioaox-section-card { padding:22px 16px; margin-bottom:32px; border-radius:16px; }
 #matrixCorrelation .matrix-stage { padding:20px 14px; margin-top:20px; }
 #matrixCorrelation .matrix-results-zone { padding:22px 12px; }
 #matrixCorrelation .figure-actions button,#treatmentDecision .figure-actions button { width:100%; justify-content:center; text-align:center; }
 .section-number { font-size:11px; }
 .matrix-legacy { padding:20px 16px; }
}
@media print {
 #multiResultsSection > .bioaox-section-card { box-shadow:none; border:1px solid #bbb; background:white!important; }
 .section-help { background:white; }
}

.matrix-output-notes{margin-top:18px;padding:16px;background:white;border:1px solid #cdded9;border-radius:10px;}
.matrix-output-notes>summary{cursor:pointer;font-weight:700;line-height:1.5;}
.matrix-output-notes>p{margin-top:14px;line-height:1.65;}

#treatmentDecision .decision-scope { padding:16px 20px; border:1px solid #e2c996; border-left:4px solid #a77a2d; border-radius:12px; background:#fff4dc; max-width:none; }
.decision-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; list-style:none; counter-reset:decision-step; margin:26px 0!important; padding:0; }
.decision-steps li { position:relative; counter-increment:decision-step; padding:22px 20px 20px 54px; border:1px solid #e1d9c9; border-radius:14px; background:white; }
.decision-steps li::before { content:counter(decision-step); position:absolute; left:16px; top:20px; width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:#edf4f2; color:#07565b; font-weight:800; }
.decision-steps strong { display:block; margin-bottom:10px; color:#073b57; line-height:1.4; }
.decision-steps span { display:block; font-size:14px; line-height:1.6; color:#486268; }
#treatmentDecision .decision-pairing { max-width:none; padding:16px 20px; border:1px solid #d6e4e0; border-radius:10px; background:#eff6f3; }
.decision-explanation { padding:16px 20px; margin:14px 0; border:1px solid #ddd9cc; border-radius:10px; background:white; }
.decision-explanation summary { cursor:pointer; font-weight:700; color:#315359; line-height:1.5; }
.decision-explanation p { margin:16px 0 0; max-width:95ch; line-height:1.65; }
@media(min-width:601px) {
 .decision-criteria-table th:nth-child(1) { width:28%;text-align:left; }
 .decision-criteria-table th:nth-child(2) { width:38%;text-align:left; }
 .decision-criteria-table th:nth-child(3),.decision-criteria-table th:nth-child(4) { width:17%;text-align:center; }
 #decisionCriteria td:nth-child(3),#decisionCriteria td:nth-child(4) { text-align:center; }
}
@media(max-width:700px) { .decision-steps { grid-template-columns:1fr; gap:12px; }.decision-steps li { padding-top:18px;padding-bottom:18px; }.decision-steps li::before { top:17px; } }

/* Let expanded explanations use the width of their container. */
#treatmentDecision .decision-explanation p { max-width:none; width:auto; }

#decisionCriteria .importance-share { display:block; margin-top:10px; color:#07565b; font-weight:700; line-height:1.4; }
#decisionCriteria [data-weight] { width:100%; min-width:0; }
@media(min-width:601px){.decision-criteria-table th:nth-child(1){width:25%;}.decision-criteria-table th:nth-child(2){width:28%;}.decision-criteria-table th:nth-child(3){width:30%;}.decision-criteria-table th:nth-child(4){width:17%;}}
@media(max-width:600px){#decisionCriteria td:nth-child(2),#decisionCriteria td:nth-child(3){grid-column:1/-1;}#decisionCriteria td:nth-child(3)::before{content:'Importancia de la respuesta';}}

/* Equal top alignment for the controls and their supporting text. */
@media(min-width:601px){
 #decisionCriteria td { vertical-align:top; padding:18px 14px; }
 #decisionCriteria td:first-child label { min-height:42px; margin:0; }
 #decisionCriteria td:first-child br { display:none; }
 #decisionCriteria td:first-child small { display:block; margin-top:10px; line-height:1.4; }
 #decisionCriteria td:nth-child(2) select,#decisionCriteria td:nth-child(3) select { height:42px; min-height:42px; margin:0; box-sizing:border-box; }
 #decisionCriteria td:nth-child(4) { padding-top:31px; }
 .decision-criteria-table th:nth-child(3),#decisionCriteria td:nth-child(3) { text-align:left; }
 .decision-criteria-table th { padding-left:14px; padding-right:14px; }
 #decisionCriteria .importance-share { text-align:left; }
}

.matrix-cell-p,.matrix-cell-decision { display:block; margin-top:7px; font-size:11px; line-height:1.4; font-weight:400; }
.matrix-cell { font-weight:700; min-width:100px; }
.matrix-meaning-guide { margin:24px 0; padding:22px; background:white; border:1px solid #bdd6d0; border-radius:12px; }
.matrix-meaning-guide ul { padding-left:20px; }
.matrix-meaning-guide li { margin:12px 0; line-height:1.6; }
.matrix-meaning-guide p,.matrix-pair-meaning { line-height:1.65; margin-top:14px; }
#matrixOutput table.matrix-interpretation-table { min-width:1050px; table-layout:auto; }
.matrix-interpretation-table th:last-child,.matrix-interpretation-table td:last-child { min-width:280px; max-width:420px; text-align:left; white-space:normal; line-height:1.6; }

.decision-purpose{margin:24px 0;padding:24px;background:#fff;border:1px solid #ded5c1;border-radius:14px;}
.decision-purpose h4{margin:0 0 16px;font-size:18px;color:#073b57;}
.decision-purpose h4:not(:first-child){margin-top:26px;}
.decision-purpose ol{margin:0;padding-left:24px;}
.decision-purpose li{margin:0 0 18px;line-height:1.7;}
.decision-purpose p{margin:14px 0 0;line-height:1.7;max-width:none;}
@media(max-width:600px){.decision-purpose{padding:20px 16px;}}
