.med-shell{--med-blue:#0752b8;--med-ink:#173754;--med-teal:#008d96;color:var(--med-ink)}
.med-shell input[type=checkbox]{width:16px;height:16px;min-width:16px;flex:0 0 16px;padding:0}
.med-hero{display:flex;align-items:center;gap:23px;background:linear-gradient(110deg,#123d68,#0759a7);color:white;padding:26px 30px;border-radius:16px;margin-bottom:18px;box-shadow:0 8px 25px #14385813}
.med-hero-icon{width:92px;height:92px;flex-shrink:0;background:white;border-radius:20px;padding:10px;box-shadow:0 8px 14px #05223b22}.med-hero-icon svg{width:100%;height:100%}
.med-hero h2{font-size:34px;letter-spacing:3px;color:white;margin:0 0 5px}.med-hero p{color:#e2f1ff;font-size:14px;margin:0;line-height:1.55}.med-user{margin-left:auto;font-size:12px;text-align:right;max-width:180px;line-height:1.6;color:#e2f1ff}
.med-steps{display:flex;flex-wrap:wrap;gap:12px;margin:0 0 20px}.med-step{flex:1;min-width:180px;background:#fff;border:1px solid #d9e7f1;border-radius:12px;padding:13px;display:flex;gap:11px;align-items:center}.med-step b{display:grid;place-items:center;width:30px;height:30px;background:#eaf3ff;border-radius:50%;color:#0752b8;flex-shrink:0}.med-step span{font-size:12px;line-height:1.45}.med-step strong{display:block;font-size:13px}
.med-settings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.med-settings .wide{grid-column:span 2}.med-settings label{display:block;font-weight:600;font-size:12px;margin-bottom:6px}.med-settings input,.med-settings select{width:100%;min-width:0}.med-tabs{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:18px 0 12px}.med-tab{background:white;color:#315471;border:1px solid #cbdcea;border-radius:24px;padding:10px 17px;font-weight:600;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.med-tab.active{background:#0752b8;color:white;border-color:#0752b8}.med-shell .card{margin-bottom:15px;min-width:0}.med-lot{border:1px solid #d7e4ef;border-radius:14px;overflow:hidden;background:white;margin:14px 0}.med-lot-head{display:flex;align-items:center;gap:14px;padding:14px 18px;background:#f0f6fc}.med-lot-head label{font-size:12px;font-weight:700}.med-lot-head input{max-width:260px}.med-lot-head button{margin-left:auto}.med-lot-body{padding:18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:20px}.med-drop{position:relative;display:grid;place-items:center;text-align:center;min-height:102px;border:2px dashed #9ebdda;border-radius:12px;background:#f7fbff;padding:15px;color:#315471;cursor:pointer}.med-drop input{max-width:100%;font-size:12px;margin-top:9px}.med-files{display:grid;gap:8px;margin-top:10px}.med-file{display:flex;gap:8px;align-items:center;border:1px solid #dce7ee;border-radius:8px;padding:8px 10px;font-size:12px;min-width:0}.med-file>span{flex:1;min-width:0;overflow-wrap:break-word}.med-file button{font-size:11px;padding:7px;flex-shrink:0}.med-values{width:100%;min-height:160px;font-family:Consolas,monospace;font-size:13px;resize:vertical}.med-confirm{display:flex;align-items:flex-start;gap:8px;font-size:12px;line-height:1.55;margin-top:10px}.med-confirm input{margin-top:4px;flex-shrink:0}.med-confirm.warn{color:var(--status-yellow-ink)}.med-help{font-size:12px;color:#637b91;line-height:1.6;margin:8px 0}.med-count{font-size:12px;color:#0752b8;font-weight:700;margin:7px 0}.med-rule-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:12px}.med-rule-list label{display:flex;gap:8px;font-size:12px;padding:8px;background:#f6f9fc;border-radius:8px;line-height:1.5}.med-rule-list input{margin-top:3px}.med-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:16px 0}.med-state{padding:12px 15px;border:1px solid #cee1f3;background:#edf5ff;color:#174574;border-radius:10px;font-size:13px;line-height:1.5}.med-state.error{background:#fff0f1;border-color:#f0c3ca;color:#a6273e}.med-state.success{background:#eaf7f1;border-color:#b8dfce;color:#166741}.med-working{display:inline-block;width:13px;height:13px;border:2px solid #93b5d8;border-top-color:#0752b8;border-radius:50%;animation:med-spin 1s linear infinite;vertical-align:middle;margin-right:7px}@keyframes med-spin{to{transform:rotate(360deg)}}
.med-result{background:white;border:1px solid #d5e3ef;border-radius:16px;margin-top:22px;overflow:hidden}.med-result-title{display:flex;align-items:center;gap:14px;justify-content:space-between;background:#eaf3fc;padding:20px 24px}.med-result-title h3{font-size:22px;color:#123b61;margin:0}.med-result-title span{font-size:12px;color:#58748d}.med-result-body{padding:22px}.med-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}.med-metric{border:1px solid #dce8f0;border-radius:10px;padding:12px;background:#fbfdff}.med-metric strong{display:block;font-size:23px;color:#0752b8;margin-top:5px;overflow-wrap:break-word}.med-metric span{font-size:11px;color:#61778b}.med-result h4{color:#173b5e;font-size:16px;margin:23px 0 12px}.med-result p{font-size:13px;line-height:1.6}.med-result .table-wrap{margin:13px 0}.med-result table th{background:#143d65}.med-result table td{vertical-align:top}.med-badge{display:inline-block;padding:5px 9px;border-radius:6px;font-size:12px;line-height:1.5;font-weight:600}.med-badge.good{background:#e5f4ec;color:#126c43}.med-badge.bad{background:#feedef;color:#a6273e}.med-badge.neutral{background:#edf1f5;color:#526779}.med-insight{border-left:3px solid #0b8196;padding:11px 15px;background:#f1f9fc;border-radius:0 8px 8px 0;margin:10px 0;font-size:13px;line-height:1.65}.med-warning{border-left-color:var(--status-yellow);background:var(--status-yellow-soft)}.med-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin:15px 0}.med-chart{padding:12px;background:white;border:1px solid #dae5ee;border-radius:12px;min-width:0;overflow:hidden}.med-chart h5{white-space:pre-line;line-height:1.5;font-size:13px;color:#173b5e;margin:0 0 8px;overflow-wrap:break-word}.med-chart svg{display:block;width:100%;height:auto}.med-chart.full{grid-column:1 / -1}.med-result summary{cursor:pointer;font-size:14px;font-weight:600;color:#19456d;padding:12px 0}.med-sharebar{height:24px;background:#e0ecf5;border-radius:8px;display:flex;overflow:hidden;margin:12px 0}.med-sharebar span{background:#0752b8;display:block}.med-sharebar span+span{background:#06a6aa}.med-footer{font-size:12px;color:#657d92;line-height:1.6;padding:12px 0}.med-footer a{overflow-wrap:break-word}
.med-dialog{position:fixed;inset:0;background:#071c34a6;z-index:10000;display:flex;align-items:center;justify-content:center;padding:16px}.med-dialog[hidden]{display:none!important}.med-dialog-card{background:white;width:min(1250px,100%);max-height:94dvh;display:flex;flex-direction:column;border-radius:16px;overflow:hidden;box-shadow:0 25px 75px #061c4544}.med-dialog-head{display:flex;gap:18px;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid #d9e6ef}.med-dialog-head h3{font-size:18px;color:#163c61;margin:0;overflow-wrap:break-word}.med-dialog-content{overflow:auto;min-height:0;padding:18px 22px;display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.2fr);gap:20px}.med-preview{position:sticky;top:0;align-self:start;min-width:0}.med-preview img,.med-preview iframe{width:100%;max-height:58dvh;object-fit:contain;background:#e9eef2;border:1px solid #d5e2eb;border-radius:7px}.med-preview iframe{height:58dvh}.med-candidates{max-height:52dvh;overflow:auto;border:1px solid #d6e5ef;border-radius:8px;margin-top:10px}.med-candidates table{width:100%;border-collapse:collapse;font-size:12px}.med-candidates th{background:#143d65;color:white;padding:9px;position:sticky;top:0;z-index:1}.med-candidates td{padding:7px;border-bottom:1px solid #e2eaf1}.med-candidates td small{display:block;color:#607589;max-width:260px;overflow-wrap:break-word}.med-candidates input[type=text]{width:95px;padding:6px;background:var(--status-yellow-soft);border:1px solid var(--status-yellow-edge);border-radius:4px}.med-candidates tr.used{background:#eaf4ee;color:#758e83}.med-candidates tr.censored{background:#fbeeee}.med-dialog-bottom{padding:15px 22px;border-top:1px solid #d9e6ef;display:flex;align-items:center;gap:12px;justify-content:space-between;flex-wrap:wrap}.med-extracted{white-space:pre-wrap;overflow-wrap:break-word;font:12px/1.55 Consolas,monospace;background:#f2f6f9;padding:12px;max-height:200px;overflow:auto}
@media(max-width:1150px){.med-charts{grid-template-columns:1fr}.med-lot-body{grid-template-columns:1fr}.med-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:680px){.med-hero{padding:18px;gap:14px;flex-wrap:wrap}.med-hero-icon{width:68px;height:68px;border-radius:15px}.med-hero h2{font-size:29px}.med-hero p{font-size:12px}.med-user{max-width:none;margin-left:0;flex-basis:100%;text-align:left}.med-steps{gap:7px}.med-step{min-width:150px;padding:10px}.med-settings{grid-template-columns:repeat(2,minmax(0,1fr))}.med-settings .wide{grid-column:1 / -1}.med-lot-head{flex-wrap:wrap;padding:12px}.med-lot-body{padding:12px}.med-rule-list{grid-template-columns:1fr}.med-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.med-result-body{padding:13px}.med-result-title{padding:16px;flex-wrap:wrap}.med-dialog{padding:5px}.med-dialog-card{max-height:97dvh}.med-dialog-content{grid-template-columns:1fr;padding:12px}.med-preview{position:static}.med-preview iframe,.med-preview img{max-height:260px;height:260px}.med-candidates{max-height:390px}.med-dialog-bottom{padding:12px}.med-hero .med-hero-copy{min-width:0;flex:1}.med-chart{padding:5px}.med-chart h5{padding:8px}.med-state{font-size:12px}}
@media(prefers-reduced-motion:reduce){.med-working{animation:none}}

.med-timer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;margin:15px 0;background:#eef5fa;border:1px solid #cee0ee;border-radius:12px}.med-timer p{font-size:12px;margin:5px 0}.med-timer small{font-size:11px;color:#60778b}.med-timer>b{font-variant-numeric:tabular-nums;font-size:24px;color:#174c79;white-space:nowrap}@media(max-width:680px){.med-timer{flex-wrap:wrap}.med-timer>b{font-size:21px}}
.med-chart-groups{display:grid;gap:20px;min-width:0}.med-chart-analysis{min-width:0;padding-top:5px}.med-chart-analysis+.med-chart-analysis{border-top:1px solid #dce7ef;padding-top:18px}.med-result .med-chart-analysis>h4{font-size:15px;line-height:1.5;margin:0 0 12px;padding-left:10px;border-left:3px solid #008d96;overflow-wrap:break-word}.med-chart-scope{min-width:0}.med-chart-scope+.med-chart-scope{margin-top:18px}.med-result .med-chart-scope-title{font-size:12px;font-weight:700;line-height:1.5;color:#315471;background:#f0f6fc;border:1px solid #dce7ef;border-radius:7px;padding:8px 11px;margin:0;overflow-wrap:break-word}.med-chart-scope>.med-charts{margin:10px 0 0}@media(max-width:680px){.med-chart-groups{gap:16px}.med-result .med-chart-analysis>h4{font-size:14px}.med-result .med-chart-scope-title{padding:7px 9px}}
.med-badge.warning{background:var(--status-yellow-soft);color:var(--status-yellow-ink)}.med-conclusions,.med-interpretations{min-width:0}.med-result .med-conclusions>h4{margin-top:0}.med-conclusion-list{display:grid;gap:12px}.med-conclusion-card{min-width:0;border:1px solid #d7e5ee;border-radius:12px;padding:16px;background:#fff}.med-conclusion-card.total{background:#f2f8fc;border-color:#bfd7e8}.med-conclusion-card>header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.med-conclusion-card h5{font-size:14px;line-height:1.5;color:#173b5e;margin:0;overflow-wrap:break-word}.med-conclusion-card dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.med-conclusion-card dl>div{min-width:0}.med-conclusion-card dt{font-size:11px;line-height:1.5;color:#637b91}.med-conclusion-card dd{font-size:18px;font-weight:700;color:#173b5e;margin:3px 0 0;overflow-wrap:break-word}.med-result .med-conclusion-card>p{margin:12px 0 0;padding-top:12px;border-top:1px solid #e1eaf1;font-size:13px;overflow-wrap:break-word}.med-reading-lots{display:grid;gap:8px}.med-reading-lot{border:1px solid #dce7ef;border-radius:10px;padding:0 12px;min-width:0}.med-result .med-reading-lot>summary{font-size:13px;overflow-wrap:break-word}.med-readings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-bottom:12px}.med-reading{min-width:0;border:1px solid #dce7ef;border-left:3px solid #8ca3b4;border-radius:7px;padding:12px;background:#fbfdff}.med-reading.good{border-left-color:#167749}.med-reading.warning{border-left-color:var(--status-yellow)}.med-reading.bad{border-left-color:#c53348}.med-reading h6{font-size:12px;line-height:1.5;color:#315471;margin:0 0 7px;overflow-wrap:break-word}.med-result .med-reading p{font-size:12px;line-height:1.6;margin:9px 0 0;overflow-wrap:break-word}.med-comparison-reading{margin-top:15px}.med-comparison-reading>h5{font-size:13px;color:#173b5e;margin:0 0 10px}.med-next-steps{margin-top:8px}.med-result .med-next-steps p{font-size:12px;margin:8px 0}.med-graph-results,.med-technical-results{margin-top:18px;border-top:1px solid #dce7ef;padding-top:6px}.med-tukey-table tbody tr.good{background:#f0faf4}.med-tukey-table tbody tr.warning{background:#fff9eb}.med-tukey-table tbody tr.bad{background:#fff4f5}.med-tukey-table td small{display:block;min-width:170px;max-width:340px;margin-top:6px;font-size:11px;line-height:1.5;overflow-wrap:break-word}@media(max-width:680px){.med-conclusion-card{padding:12px}.med-conclusion-card dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.med-conclusion-card dd{font-size:17px}.med-readings{grid-template-columns:1fr}.med-reading-lot{padding:0 9px}.med-reading{padding:10px}}

.med-summary-statuses{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px}.med-summary-status{display:flex;flex-direction:column;align-items:flex-start;gap:6px;border:1px solid #dce7ef;border-left:3px solid #8ca3b4;border-radius:7px;padding:10px;min-width:0}.med-summary-status>span{font-size:11px;font-weight:700}.med-summary-status.bad{border-left-color:#c53348}.med-summary-status.good{border-left-color:#167749}.med-summary-status.warning{border-left-color:var(--status-yellow)}.med-summary-status .med-badge{white-space:normal;overflow-wrap:break-word}@media(max-width:680px){.med-summary-statuses{grid-template-columns:1fr}}

/* MED 2.7: recorrido por pasos, revisión amplia y tablero compacto por lote. */
.med-shell [hidden]{display:none!important}.med-shell :is(button,input,select,textarea):focus-visible{outline:3px solid #5aafe9;outline-offset:3px}.med-shell{min-width:0}.med-workflow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;scroll-margin-top:22px}.med-workflow>button{display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:14px 15px;border:1px solid #cbddec;border-radius:12px;background:#fff;color:#3b5670;text-align:left;font-size:14px;font-weight:650;cursor:pointer;min-height:64px;min-width:0}.med-workflow>button>b{display:grid;place-items:center;flex:0 0 30px;height:30px;background:#edf4fb;border-radius:50%;color:#0752b8;font-size:14px}.med-workflow>button.active{border-color:#0752b8;background:#eef6ff;color:#074884;box-shadow:inset 0 -3px #0752b8}.med-workflow>button.active>b{background:#0752b8;color:white}.med-phase-hint{font-size:14px;line-height:1.6;color:#4b6379;margin:12px 2px 20px}.med-shell .med-settings{gap:18px}.med-shell .med-settings label{font-size:14px}.med-shell .med-settings .entry{min-height:45px;font-size:15px}.med-shell h3{line-height:1.4}.med-shell .med-help{font-size:13px}.med-confirm-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:17px 0}.med-shell .med-confirm{padding:13px 15px;border:1px solid #c7dced;border-radius:10px;background:#f5f9fd;font-size:14px;gap:11px;color:#244c70}.med-shell .med-confirm:has(input:checked){background:#eaf6ef;border-color:#81bc9a;color:#17653e}.med-confirm small{display:block;margin-top:3px;font-size:12px;color:#5d7488}.med-shell .med-confirm input[type=checkbox]{width:19px;height:19px;min-width:19px;flex-basis:19px;accent-color:#167749}.med-work-actions{position:sticky;bottom:12px;z-index:25;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:13px 16px;margin:20px 0;border:1px solid #cbdfed;border-radius:14px;background:#fffffff5;box-shadow:0 7px 25px #183b641c}.med-work-actions .btn{min-height:42px;font-size:13px}.med-work-actions #medClear{margin-left:auto}.med-work-actions #medNext:disabled{display:none}.med-review-progress{font-size:14px;font-weight:650;background:#edf6fd;border-left:4px solid #2699cf;padding:12px 16px;border-radius:7px;color:#224e72}.med-lot-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.med-lot-navigation .med-tabs{margin:12px 0}.med-tab-count{display:inline-flex;justify-content:center;align-items:center;min-width:25px;padding:2px 6px;margin-left:9px;background:#ecf4fc;color:#245378;border-radius:15px;font-size:11px}.med-tab.active .med-tab-count{background:#ffffff2e;color:white}.med-shell .med-lot-head label{font-size:14px}.med-lot-head .entry{font-size:16px;min-height:43px}.med-shell .med-lot-body{grid-template-columns:minmax(240px,.8fr) minmax(350px,1.3fr);gap:22px}.med-source-panel,.med-data-panel{min-width:0}.med-source-panel>h3,.med-data-panel>h3{margin:0 0 9px;font-size:17px}.med-source-panel>input[type=file]{max-width:100%;font-size:14px;padding:10px 0}.med-source-panel .vp-file-drop{min-height:135px}.med-shell .med-file{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;padding:13px;background:#f9fcff;border-radius:11px;align-items:start}.med-file.error{background:#fff3f3;border-color:#eac4c4}.med-file .med-file-icon{display:grid;place-items:center;width:40px;height:46px;min-width:40px;border-radius:8px;background:#e4f1fd;font-size:11px;color:#0752b8;font-weight:800;overflow:hidden}.med-file>div{min-width:0}.med-file b{display:block;overflow-wrap:break-word;font-size:14px;line-height:1.4}.med-file small{display:block;margin-top:5px;line-height:1.5;color:#657c8f;font-size:12px}.med-file .med-file-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}.med-file .med-file-actions button{font-size:13px;min-height:37px;padding:8px 11px}.med-manual{margin-top:18px;border-top:1px solid #dbe7ef;padding-top:8px}.med-manual>summary{font-size:14px;font-weight:650;color:#225880;cursor:pointer;padding:10px 0}.med-manual>label{display:block;font-size:13px;color:#3a5a77;margin:9px 0}.med-shell .med-values{font-size:17px;line-height:1.65;min-height:220px;max-height:460px;padding:12px}.med-manual>.btn{margin-top:9px}.med-data-summary{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 12px;font-size:13px;line-height:1.5;color:#587087}.med-data-summary strong{font-size:14px;color:#0752b8}.med-loaded-table{overflow:auto;max-height:min(560px,65dvh);border:1px solid #d1e1ed;border-radius:10px;scrollbar-gutter:stable}.med-loaded-table table{width:100%;min-width:510px;border-collapse:collapse;text-align:left;font-size:14px}.med-loaded-table th{position:sticky;top:0;z-index:1;background:#153e64;color:white;font-size:12px;padding:12px 11px;text-align:left}.med-loaded-table td{border-bottom:1px solid #e1eaf2;padding:10px 11px;vertical-align:middle;overflow-wrap:break-word;max-width:210px}.med-loaded-table tbody tr:nth-child(even){background:#f6faff}.med-loaded-table tbody tr.flagged{background:var(--status-yellow-soft)}.med-loaded-table tbody tr.excluded{background:#f1f3f5;color:#71808c}.med-loaded-table tr.excluded .med-value-number{text-decoration:line-through}.med-loaded-table .med-value-number{font-size:18px;font-variant-numeric:tabular-nums;font-weight:700;color:#143d65;white-space:nowrap}.med-loaded-table tr.excluded .med-value-number{color:#71808c}.med-loaded-table small{display:block;font-size:11px;color:#6a7e8f;margin-top:3px}.med-loaded-table .btn{font-size:12px;white-space:nowrap;min-height:35px}.med-pagination{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px;color:#5b7185;line-height:1.5;margin-top:12px}.med-pagination .btn{min-height:36px;font-size:12px}.med-empty{min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#f7fbff;border:1px dashed #b6cede;border-radius:12px;padding:22px;color:#4a6e8d}.med-empty strong{font-size:16px}.med-empty p{max-width:320px;line-height:1.7;font-size:14px}.med-data-panel>input{width:100%;font-size:14px}.med-decision-scroll{overflow:auto;min-height:0;flex:1}.med-decision-scroll table{width:100%;min-width:970px;border-collapse:collapse;text-align:left;font-size:14px}.med-decision-scroll th{position:sticky;top:0;z-index:1;background:#153e64;color:white;padding:13px 14px;font-size:12px}.med-decision-scroll td{padding:13px 14px;border-bottom:1px solid #dce7ef;vertical-align:top;line-height:1.6;max-width:270px;overflow-wrap:break-word}.med-decision-scroll tr:nth-child(even){background:#f7faff}.med-decision-scroll small{display:block;color:#677f94;font-size:12px;line-height:1.55;margin-top:7px;overflow-wrap:break-word}.med-decision-scroll .entry{width:100%;min-width:125px;font-size:15px;min-height:43px}.med-decision-scroll input[data-med-decision-reason]{min-width:200px}.med-decision-scroll select{min-width:175px}.med-decision-card>.med-state{margin:10px 18px;padding:8px 13px}.med-decision-card>.med-state:empty{display:none}.med-dialog-card{width:min(1460px,100%)}.med-shell .med-dialog-content{grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr)}.med-shell .med-candidates{max-height:62dvh}.med-shell .med-candidates table{font-size:14px}.med-shell .med-candidates td{padding:10px}.med-shell .med-candidates input[type=text]{font-size:17px;min-height:39px;width:110px}.med-shell .med-candidates input[type=checkbox]{width:19px;height:19px;min-width:19px}.med-shell .med-candidates td small{font-size:12px;line-height:1.5}.med-shell .med-preview iframe,.med-shell .med-preview img{max-height:64dvh}.med-shell .med-preview iframe{height:64dvh}.med-dialog-head>.btn{flex-shrink:0}.med-chart-expanded{padding:20px;overflow:auto;min-height:0}.med-chart-expanded svg{display:block;width:100%;min-width:650px;height:auto}.med-result-product{font-weight:700;color:#245173;margin:0 0 5px!important;overflow-wrap:break-word}.med-result-title>div{min-width:0}.med-result-title h3{overflow-wrap:break-word}.med-results-lots{margin-top:0}.med-executive{padding:18px 20px;border:1px solid #d2e3ef;border-left:5px solid #769cb5;border-radius:11px;background:#f5faff}.med-executive>div{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.med-executive h4{margin:0;font-size:17px;overflow-wrap:break-word}.med-executive>p{margin:11px 0 0;font-size:14px;line-height:1.65;overflow-wrap:break-word}.med-executive.good{border-left-color:#167749;background:#f0faf4}.med-executive.bad{border-left-color:#c53348;background:#fff5f5}.med-executive.warning{border-left-color:var(--status-yellow);background:var(--status-yellow-soft)}.med-key-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:17px 0}.med-key-metrics>div{padding:13px;border:1px solid #d9e6ee;background:#fbfdff;border-radius:10px;min-width:0}.med-key-metrics span{display:block;font-size:11px;color:#658096;line-height:1.4}.med-key-metrics strong{display:block;font-size:22px;color:#154d7a;margin-top:6px;font-variant-numeric:tabular-nums;overflow-wrap:break-word}.med-status-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:9px;margin:14px 0 20px}.med-status-strip>div{display:flex;flex-direction:column;align-items:flex-start;gap:8px;border:1px solid #dae5ee;border-top:3px solid #809aad;border-radius:8px;padding:11px;font-size:12px;min-width:0}.med-status-strip>div.good{border-top-color:#167749}.med-status-strip>div.bad{border-top-color:#c53348}.med-status-strip>div.warning{border-top-color:var(--status-yellow)}.med-status-strip .med-badge{font-size:11px;overflow-wrap:break-word;line-height:1.5}.med-sixpack{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.med-sixpack>.med-chart{margin:0;padding:13px;min-width:0}.med-sixpack figcaption{display:flex;align-items:flex-start;justify-content:space-between;gap:9px;min-height:50px}.med-sixpack h5{font-size:13px;line-height:1.5}.med-sixpack figcaption>.btn{font-size:11px;min-height:32px;flex-shrink:0;padding:7px 9px}.med-technical-results .table-wrap{max-height:430px;overflow:auto}.med-technical-results td{font-size:13px}.med-results-lots button{font-size:13px}
@media(max-width:1200px){.med-shell .med-lot-body{grid-template-columns:1fr}.med-file{max-width:none}.med-files{grid-template-columns:repeat(2,minmax(0,1fr))}.med-shell .med-settings{grid-template-columns:repeat(2,minmax(0,1fr))}.med-key-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.med-sixpack{grid-template-columns:1fr}.med-loaded-table{max-height:540px}.med-workflow>button{padding:12px 10px;font-size:13px;gap:8px}}
@media(max-width:760px){.med-workflow{grid-template-columns:repeat(2,minmax(0,1fr))}.med-workflow>button{min-height:58px}.med-confirm-grid{grid-template-columns:1fr}.med-files{grid-template-columns:1fr}.med-shell .med-dialog-content{grid-template-columns:1fr;padding:12px}.med-shell .med-candidates{max-height:52dvh}.med-shell .med-preview iframe,.med-shell .med-preview img{max-height:280px;height:280px}.med-work-actions{bottom:5px;gap:8px;padding:10px}.med-work-actions .btn{flex:1 1 150px}.med-work-actions #medClear{margin-left:0;flex-grow:0}.med-dialog-head{align-items:flex-start;padding:14px;gap:10px}.med-dialog-head .med-help{font-size:12px}.med-dialog-head h3{font-size:16px}.med-status-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.med-executive{padding:14px}.med-sixpack>.med-chart{padding:8px}.med-key-metrics strong{font-size:19px}.med-key-metrics>div{padding:10px}.med-shell .med-settings .entry{font-size:14px}.med-chart-expanded{padding:10px}}
@media(max-width:450px){.med-shell .med-settings{grid-template-columns:1fr}.med-settings .wide{grid-column:auto}.med-key-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.med-workflow>button{font-size:12px;gap:7px}.med-workflow>button>b{flex-basis:26px;height:26px}.med-lot-head input{max-width:none;width:100%}.med-lot-head button{margin-left:0}.med-dialog-head{flex-wrap:wrap}.med-dialog-head>.btn{margin-left:auto}.med-dialog-bottom{gap:12px}.med-dialog-bottom>.btn{width:100%}.med-review-progress{font-size:13px}.med-status-strip{grid-template-columns:1fr}}
/* Keep the editable measurements readable under the global input theme. */
#section-med .med-values{min-height:220px;max-height:460px;font-size:17px;line-height:1.65;padding:12px}

/* Lectura por atributo: la propuesta siempre se revisa contra el original. */
.med-candidates tr.med-metadata{background:#f1f3f5}.med-candidates tr.med-suggested{background:#edf8f1}.med-candidate-role{display:inline-block;font-size:12px;font-weight:700;color:#244c70;margin-bottom:4px}.med-candidates tr.med-metadata .med-candidate-role{color:#606c78}.med-candidates tr.med-suggested .med-candidate-role{color:#17653e}.med-table-preview{border:1px solid #d5e2eb;border-radius:8px;padding:13px;background:#f8fbfe}.med-table-preview h4{margin:0 0 8px;color:#163c61}.med-table-preview .med-extracted{white-space:pre;max-height:55dvh;overflow:auto;font-size:13px}.med-dialog #medColumn{max-width:100%;min-width:220px;flex:1 1 260px}.med-dialog #medReviewHelp{padding:12px;border-left:4px solid #2699cf;background:#edf6fd;color:#244c70;line-height:1.6}.med-dialog .med-actions{gap:8px}.med-dialog .med-actions label{font-weight:650;color:#244c70}
/* Evaluación humana: separada visualmente de las señales automáticas. */
.med-disposition{margin:18px 0;padding:20px;border:1px solid #c6d9e5;border-left:5px solid var(--status-yellow);border-radius:16px;background:var(--status-yellow-soft);}
.med-disposition.good{border-left-color:#147a53;background:#eff9f3;}
.med-disposition.bad{border-left-color:#b82335;background:#fff5f5;}
.med-disposition header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;}
.med-disposition h4{margin:0 0 8px;color:#14345b;}
.med-disposition p{margin:8px 0;line-height:1.5;overflow-wrap:break-word;}
.med-disposition-tag{background:#fff;border:1px solid #c6d9e5;padding:7px 12px;border-radius:20px;white-space:nowrap;font-weight:700;}
.med-disposition details{margin-top:14px;}
.med-disposition summary,.med-theory>summary{padding:12px 0;font-weight:700;cursor:pointer;color:#154b79;}
.med-disposition-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:10px;}
.med-disposition-fields label{display:flex;flex-direction:column;gap:8px;font-weight:600;min-width:0;}
.med-disposition-fields select,.med-disposition-fields textarea{box-sizing:border-box;width:100%;font:inherit;line-height:1.4;padding:12px;border:1px solid #b8cbd9;border-radius:9px;background:#fff;color:#193650;}
.med-disposition-fields textarea{resize:vertical;}
.med-disposition-reason{grid-column:1/-1;}
.med-disposition-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px;}
.med-disposition-actions .primary{background:#1264a0;color:white;min-height:44px;padding:12px 20px;border-radius:10px;box-shadow:0 4px 10px #12436520;}
.med-disposition-actions button:active{transform:translateY(1px);}
.med-theory{margin-top:18px;padding:0 16px 12px;border:1px solid #cfdeea;border-radius:14px;background:#f6faff;}
.med-theory-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:10px;}
.med-theory article{background:#fff;border:1px solid #dce6ed;border-radius:12px;padding:16px;line-height:1.55;}
.med-theory h5{font-size:15px;color:#14345b;margin:6px 0 10px;}
.med-theory a{font-size:13px;color:#145a96;text-decoration:underline;}
@media(max-width:720px){.med-disposition-fields,.med-theory-grid{grid-template-columns:1fr;}.med-disposition header{flex-direction:column;}.med-disposition{padding:15px;}.med-disposition-actions button{width:100%;}}

/* Stable workflow anchors for every navigation step. */
#section-med>.med-workflow{position:sticky;top:8px;z-index:30;padding:10px;background:#f3f7fd;border:1px solid #c7d8ee;border-radius:14px;margin:0 0 18px;box-shadow:0 3px 12px #17467715;grid-column:1/-1}
#medProductCard,#medAttributeSettings,#medLots,#medResults{scroll-margin-top:100px}
#section-med{overflow-anchor:none}
@media(max-width:600px){#section-med>.med-workflow{gap:4px;padding:6px;top:4px}#section-med .med-workflow>button{padding:9px 4px;font-size:12px}#medProductCard,#medAttributeSettings,#medLots,#medResults{scroll-margin-top:112px}}

.med-point-tooltip{position:fixed;z-index:100000;max-width:min(440px,calc(100vw - 20px));max-height:65vh;overflow:auto;white-space:pre-line;background:#123b61;color:#fff;padding:13px 16px;border:1px solid #89c8f2;border-radius:12px;box-shadow:0 8px 28px #102d4938;font:13px/1.5 Arial,sans-serif;pointer-events:none}.med-point-tooltip[hidden]{display:none}.med-data-point{cursor:help}.med-data-point:focus-visible{outline:none;stroke:#0752b8;stroke-width:1.5}

.med-distribution{margin:18px 0;padding:18px 20px;border:1px solid #a4c9e4;border-left:5px solid #008d96;border-radius:12px;background:#f1f8fc;color:#173754}.med-distribution header{display:flex;flex-wrap:wrap;gap:10px 24px;justify-content:space-between}.med-distribution header span{font-weight:700}.med-distribution header strong{color:#0752b8}.med-distribution summary{cursor:pointer;font-weight:700;padding:9px 0}.med-distribution table{font-size:12px}

/* identidad de lote legible y acciones de la carga siempre visibles. */
#section-med .med-lot-head{display:block;padding:14px 18px}
#section-med .med-lot-identity{display:flex;flex-direction:column;align-items:stretch;gap:6px;width:min(100%,560px);min-width:0;min-height:0;height:auto;padding:0;margin:0}
#section-med .med-lot-identity>label{display:block;white-space:normal;margin:0;font-size:14px}
#section-med .med-lot-identity>.entry{display:block;box-sizing:border-box;width:100%;max-width:none;min-width:0;min-height:46px;height:46px;flex:none;font-size:16px;padding:10px 13px}
#section-med .med-lot-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
#section-med .med-lot-actions .btn{min-height:42px;white-space:normal}
#section-med .med-export-panel{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:16px 0;padding:18px 20px;background:#eaf4ff;border:2px solid #0752b8;border-radius:12px;color:#173f65}
#section-med .med-export-panel h4{font-size:18px;margin:0 0 6px;color:#123e68}
#section-med .med-export-panel p{font-size:14px;line-height:1.5;margin:0;color:#244d72}
#section-med .med-export-panel .btn{min-height:50px;min-width:230px;font-size:16px;white-space:normal}
@media(max-width:520px){#section-med .med-lot-actions,#section-med .med-lot-actions>.btn,#section-med .med-export-panel .btn{width:100%}#section-med .med-export-panel{padding:14px}#section-med .med-export-panel .btn{min-width:0}}

/* Local OCR coordinates remain aligned with the original image. */
.med-vision-photo{position:relative;width:100%;background:white}
.med-preview .med-vision-photo img{display:block;width:100%;height:auto;max-height:none;border:0;border-radius:0}
.med-vision-photo svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.med-vision-photo rect{pointer-events:all;cursor:pointer;fill:#165f9b0c;stroke:#165f9b;stroke-width:2;vector-effect:non-scaling-stroke}
.med-vision-photo rect.selected{fill:#16824730;stroke:#168247}
.med-vision-photo rect.uncertain{fill:#c57b1329;stroke:#9b5e08;stroke-dasharray:4 2}
.med-vision-photo rect:focus{stroke:#073d85;stroke-width:4;outline:none}
.med-vision-filter{display:flex;align-items:center;gap:8px;margin:10px 0;color:#24445e;font-size:13px}
.med-vision-filter input{width:18px;height:18px;accent-color:#137449}
#medCandidates tr[hidden]{display:none!important}
#medCandidates table{table-layout:fixed}
#medCandidates th:nth-child(1){width:8%}#medCandidates th:nth-child(2){width:24%}#medCandidates th:nth-child(3){width:22%}#medCandidates th:nth-child(4){width:46%}
#medCandidates td small{max-width:100%;white-space:normal;overflow-wrap:break-word}
#medCandidates input[type=text]{width:100%;min-width:0;box-sizing:border-box}

#medCandidates table{width:100%;min-width:0!important}
#medCandidates th,#medCandidates td{min-width:0;white-space:normal;overflow-wrap:break-word}

/* MED revisión conjunta de todas las hojas, sin selector obligatorio. */
.med-file-coverage{border:1px solid #bad3e8;background:#f0f7ff;color:#173a57;border-radius:12px;padding:12px;margin:12px 0}
.med-coverage-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px;margin-top:8px;max-height:200px;overflow:auto}
.med-coverage-grid>div{background:white;border:1px solid #d2e1ef;border-radius:8px;padding:9px;min-width:0}
.med-coverage-grid b,.med-coverage-grid span,.med-coverage-grid small{display:block;overflow-wrap:break-word}
.med-coverage-grid small{color:#445d70;margin-top:3px}
#medAdvancedSelection{margin:12px 0;padding:10px;border:1px solid #c9d9e7;border-radius:9px;color:#173a57;background:white}
#medAdvancedSelection summary{cursor:pointer;font-weight:700}
#medColumn{min-width:180px;max-width:100%;flex:1}
#medReviewClose{margin-left:auto;font-size:24px;line-height:1;min-width:40px}
body:has(#medReviewDialog:not([hidden])) #vpHelpLauncher{visibility:hidden!important;pointer-events:none!important}

/* 1.0 · Gráfico de probabilidad normal: al pasar el mouse dice NORMAL (verde) o NO NORMAL (rojo) con su p. */
.med-chart,.mt-chart,#medChartContent{position:relative}
.vp-normal-badge{position:absolute;z-index:3;left:50%;top:46px;transform:translate(-50%,-4px);display:grid;justify-items:center;gap:2px;min-width:210px;padding:10px 18px;border-radius:14px;border:2px solid #fff;box-shadow:0 10px 26px rgba(10,30,50,.28);font:700 13px/1.25 Arial,Helvetica,sans-serif;color:#fff;text-align:center;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility 0s linear .15s}
.vp-normal-badge b{font-size:22px;letter-spacing:.06em}
.vp-normal-badge small{font-weight:400;font-size:11.5px;opacity:.95}
.vp-normal-badge[data-normal=si]{background:#1f8a4c}
.vp-normal-badge[data-normal=no]{background:#c0392b}
:is(.med-chart,.mt-chart,#medChartContent):is(:hover,:focus-within)>.vp-normal-badge{opacity:1;visibility:visible;transform:translate(-50%,0);transition:opacity .15s ease,transform .15s ease}
@media (hover:none){:is(.med-chart,.mt-chart):active>.vp-normal-badge{opacity:1;visibility:visible}}

/* 1.0 · Revisión general de valores inusuales y aviso de posibles errores de carga */
.med-general-review{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px;margin:0 0 12px;padding:14px 16px;border:2px solid #9fd3b4;border-radius:14px;background:#f2faf5}
.med-general-review p{flex:1 1 100%;margin:0;font:700 14px/1.4 Arial,Helvetica,sans-serif;color:#145a34}
.med-general-review .field{flex:1 1 320px;display:grid;gap:4px;margin:0}
.med-general-review .field span{font:700 12.5px Arial,Helvetica,sans-serif;color:#33485c}
.med-general-review #medGeneralKeep{min-height:46px;padding:10px 22px;font-size:15px}
.med-suspects{margin:0 0 12px;padding:14px 16px;border:2px solid #e48a96;border-left-width:8px;border-radius:14px;background:#fdf1f2}
.med-suspects h4{margin:0 0 4px;font:700 15px Arial,Helvetica,sans-serif;color:#85172b}
.med-suspects p{margin:0 0 8px;font:13px/1.45 Arial,Helvetica,sans-serif;color:#5b2430}
.med-suspects ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.med-suspects li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 14px;padding:8px 10px;border:1px solid #efc0c7;border-radius:10px;background:#fff}
.med-suspects li.decided{border-color:#bcd3c6;background:#f7fbf8}
.med-suspects li span:first-child{display:grid;gap:2px;font:13px/1.35 Arial,Helvetica,sans-serif;color:#33485c}
.med-suspects li small{color:#85172b}
.med-suspect-actions{display:flex;gap:8px}
.med-decision-detail{margin:0 0 8px;border:1px solid #d6e1ea;border-radius:12px;background:#fff}
.med-decision-detail>summary{padding:10px 14px;cursor:pointer;font:700 13.5px Arial,Helvetica,sans-serif;color:#173754}
.med-decision-detail[open]>summary{border-bottom:1px solid #d6e1ea}
