/* Vista What-if, sistema visual v3: papel, tinta y un acento cobre; filetes en vez de cajas.
   Los valores salen de los tokens --ds-* del sistema de diseño (tokens.css en base.html). Mientras ese
   archivo no esté cargado, cada token tiene aquí su valor de respaldo, solo dentro de .wi-shell. */
body.wi-on #sensitivityModalBackdrop,
body.wi-on .wi-legacy,
body.wi-on .sens-view-tabs .sens-reset { display: none !important; }
/* La barra lateral queda a la vista al desplazar la página (body no debe ser contenedor de scroll). */
body.wi-on.sensitivity-page { overflow: visible; }
body.wi-on, body.wi-on main { background: var(--ds-bg-app, #ffffff); }

.wi-shell {
    --wi-ink: var(--ds-text, #1d1a15);
    --wi-body: var(--ds-text-body, #3d372e);
    --wi-mut: var(--ds-text-muted, #7a7166);
    --wi-dim: var(--ds-text-dim, #a69d90);
    --wi-ln: var(--ds-border, #e5e7eb);
    --wi-ln2: var(--ds-border-strong, #d1d5db);
    --wi-cu: var(--ds-accent, #b4532a);
    --wi-cu-strong: var(--ds-accent-strong, #8f3f1d);
    --wi-cu-soft: var(--ds-accent-soft, rgba(180, 83, 42, .08));
    --wi-cu-border: var(--ds-accent-border, rgba(180, 83, 42, .45));
    --wi-surface: var(--ds-surface, #ffffff);
    --wi-subtle: var(--ds-surface-subtle, #f4f4f5);
    --wi-paper: var(--ds-bg-app, #ffffff);
    --wi-on-ink: var(--ds-text-on-ink, #ffffff);
    --wi-grid: var(--ds-grid, #eef0f2);
    --wi-ok: var(--ds-success, #2f7d5b);
    --wi-ok-bg: var(--ds-success-bg, rgba(47, 125, 91, .09));
    --wi-warn: var(--ds-warning, #b7791f);
    --wi-warn-bg: var(--ds-warning-bg, rgba(183, 121, 31, .10));
    --wi-bad: var(--ds-danger, #b4382f);
    --wi-bad-bg: var(--ds-danger-bg, rgba(180, 56, 47, .09));
    --wi-alt: var(--ds-series-alt, #2b8a87);
    --wi-serif: var(--ds-font-display, 'Inter', system-ui, sans-serif);
    --wi-focus: var(--ds-focus-ring, 0 0 0 3px rgba(180, 83, 42, .22));
    display: grid; grid-template-columns: 360px minmax(0, 1fr); align-items: start; min-height: calc(100vh - 120px);
    font-family: var(--ds-font, var(--font-main, inherit)); font-size: 14px; color: var(--wi-ink); background: var(--wi-paper);
    font-variant-numeric: tabular-nums;
}
.wi-shell :focus-visible { outline: none; box-shadow: var(--wi-focus); border-radius: 6px; }

/* ---------- Barra lateral (riel) ---------- */
.wi-levers { position: sticky; top: 0; display: flex; flex-direction: column; max-height: 100vh; overflow: auto; padding: 22px 20px 0; background: var(--wi-surface); border-right: 1px solid var(--wi-ln); }
.wi-levers-head h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.wi-levers-head p { margin: 2px 0 0; font-size: 12px; color: var(--wi-mut); }
.wi-group { position: relative; margin-top: 20px; }
.wi-group > h3 { margin: 0 0 2px; font-size: 12px; font-weight: 400; color: var(--wi-mut); }
.wi-levers-foot { position: sticky; bottom: 0; z-index: 3; margin-top: auto; padding: 12px 0 16px; background: var(--wi-surface); }
.wi-reset { padding-left: 0; }

/* Variables del árbol: nombre y valor en cobre arriba, riel fino abajo, sin caja. */
.wi-levers .cp-sim-controls-multi { display: block; width: auto; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.wi-levers .cp-sim-multi-header { display: none; }
.wi-levers .cp-sim-controls-multi > .sens-panel-heading { position: absolute; top: -2px; right: 0; margin: 0; }
.wi-levers .cp-sim-controls-multi > .sens-panel-heading > span:first-child { display: none; }
.wi-levers .cp-sim-interventions-list { display: block; max-height: none; overflow: visible; padding: 0; }
.wi-levers .cp-sim-empty-state { padding: 10px 0; font-size: 13px; color: var(--wi-mut); background: none; border: 0; }
.wi-levers .sim-intervention-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 6px; margin: 0; padding: 11px 0 0; border: 0; border-bottom: 1px solid var(--wi-ln); border-radius: 0; background: none; box-shadow: none; }
.wi-levers .sim-intervention-card:last-child { border-bottom: 0; }
.wi-levers .sim-card-header, .wi-levers .sim-card-control-row { display: contents; }
.wi-levers .sim-card-title-group { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; }
.wi-levers .sim-card-name { display: block; max-width: 100%; font-size: 13px; font-weight: 400; line-height: 1.3; color: var(--wi-ink); white-space: normal; overflow-wrap: anywhere; }
.wi-levers .sim-card-cat-badge { order: 2; align-self: flex-start; margin: 0; padding: 0; border: 0; background: none; font-size: 11px; font-weight: 400; color: var(--wi-mut); text-transform: none; letter-spacing: 0; }
.wi-levers .sim-number-input-wrap { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; gap: 3px; width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.wi-levers .sim-number-input-wrap:focus-within { border: 0; box-shadow: none; background: none; }
.wi-levers .sim-number-input { width: 62px; height: 24px; padding: 0 2px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--wi-cu); font: inherit; font-size: 13px; font-weight: 400; text-align: right; -moz-appearance: textfield; }
.wi-levers .sim-number-input::-webkit-inner-spin-button, .wi-levers .sim-number-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.wi-levers .sim-number-input:hover { border-color: var(--wi-ln); }
.wi-levers .sim-number-input:focus { border-color: var(--wi-cu-border); background: var(--wi-surface); outline: none; }
.wi-levers .sim-unit-suffix { font-size: 12px; color: var(--wi-cu); }
.wi-levers .sens-variable-actions { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 0; }
.wi-levers .sens-variable-reset { display: none; }
.wi-levers .sim-card-btn-remove, .wi-levers .sim-variable-help-trigger { width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--wi-mut); font-size: 12px; opacity: 0; cursor: pointer; transition: opacity .12s; }
.wi-levers .sim-intervention-card:hover .sim-card-btn-remove, .wi-levers .sim-intervention-card:focus-within .sim-card-btn-remove,
.wi-levers .sim-intervention-card:hover .sim-variable-help-trigger, .wi-levers .sim-intervention-card:focus-within .sim-variable-help-trigger { opacity: 1; }
.wi-levers .sim-variable-help-trigger svg { width: 14px; height: 14px; }
.wi-levers .sim-slider-wrap { grid-column: 1 / -1; grid-row: 2; min-height: 0; margin: 10px 0 22px; }
.wi-levers .sim-range-input, .wi-levers .sim-range-input:hover {
    height: 3px; border-radius: 2px;
    background: linear-gradient(to right, var(--wi-ln2) 0, var(--wi-ln2) var(--available-position, 100%), var(--wi-bad-bg) var(--available-position, 100%), var(--wi-bad-bg) 100%);
}
.wi-levers .sim-range-input::-webkit-slider-thumb { width: 14px; height: 14px; border: 2px solid var(--wi-surface); border-radius: 50%; background: var(--wi-cu); box-shadow: 0 0 0 1px var(--wi-cu); transform: none; }
.wi-levers .sim-range-input::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--wi-surface); border-radius: 50%; background: var(--wi-cu); box-shadow: 0 0 0 1px var(--wi-cu); }
.wi-levers .sim-range-input:focus-visible { outline: none; box-shadow: var(--wi-focus); }
.wi-levers .sim-current-marker, .wi-levers .sim-plan-marker { height: 14px; }
.wi-levers .sim-current-marker::after { background: var(--wi-ink); }
.wi-levers .sim-plan-marker::after { background: var(--wi-ok); }
/* Ayuda de las marcas: solo existe al pasar o enfocar, para que no ensanche la barra (scroll lateral). */
.wi-levers .sim-current-marker::before, .wi-levers .sim-plan-marker::before { display: none; max-width: 220px; background: var(--wi-surface); color: var(--wi-ink); border-color: var(--wi-ln); font-weight: 400; }
.wi-levers .sim-current-marker:is(:hover, :focus-visible)::before, .wi-levers .sim-plan-marker:is(:hover, :focus-visible)::before { display: block; }
.wi-levers .sim-marker-label { font-size: 10.5px; color: var(--wi-mut); }
.wi-levers .sim-plan-marker .sim-marker-label { color: var(--wi-ok); }
.wi-levers .sim-excess-label { color: var(--wi-bad); font-weight: 500; }

/* Camiones por pala y destino */
.wi-trucks { margin: 0; padding: 0; list-style: none; }
.wi-truck { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--wi-ln); font-size: 13px; }
.wi-truck > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.wi-truck b { font-weight: 400; }
.wi-truck small { overflow: hidden; color: var(--wi-mut); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.wi-truck .sens-haulage-stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--wi-ln); border-radius: 999px; overflow: hidden; background: var(--wi-surface); }
.wi-truck .sens-haulage-stepper button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--wi-body); font: inherit; font-size: 15px; cursor: pointer; }
.wi-truck .sens-haulage-stepper button:hover:not(:disabled) { background: var(--wi-subtle); }
.wi-truck .sens-haulage-stepper button:disabled { color: var(--wi-ln2); cursor: default; }
.wi-truck .sens-haulage-stepper output { min-width: 40px; font-weight: 600; text-align: center; }
.wi-truck .sens-haulage-delta { font-size: 11px; font-weight: 400; color: var(--wi-cu); }
.wi-truck > .wi-chip { grid-column: 1 / -1; justify-self: start; margin-top: 4px; height: auto; padding: 0; background: none !important; font-size: 11.5px; font-weight: 400; color: var(--wi-mut) !important; }
.wi-truck > .wi-chip.is-blue { color: var(--wi-cu) !important; }
.wi-truck > .wi-chip.is-red { color: var(--wi-bad) !important; }
.wi-side-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--wi-mut); }
.wi-side-row { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 10px 0 0; font-size: 13px; }
.wi-side-row b { font-weight: 600; }

/* ---------- Tablero ---------- */
.wi-main { min-width: 0; padding: 24px 28px 48px; }
.wi-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.wi-head h1 { margin: 0; font-family: var(--wi-serif); font-size: 28px; font-weight: var(--ds-fw-display, 600); line-height: 1.05; letter-spacing: -.02em; }
.wi-head p { margin: 6px 0 0; font-size: 13px; color: var(--wi-mut); }
.wi-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Período: sin caja, solo el riel de días reales y simulados. */
.wi-main .sens-range { margin: 18px 0 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--wi-ink); }
.wi-main .sens-range-controls { margin: 0 0 10px; gap: 12px; }
.wi-main .sens-range-controls label { flex: 0 1 auto; min-width: 0; flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 400; color: var(--wi-mut); }
.wi-main .sens-range-controls button { height: 30px; padding: 0 12px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font-size: 13px; cursor: pointer; }
.wi-main .sens-range-controls button:hover { background: var(--wi-subtle); }

/* Botones: principal en tinta, secundario con filete, discreto sin borde; acciones de fila en cobre. */
.wi-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.wi-btn:hover { border-color: var(--wi-ln2); background: var(--wi-subtle); }
.wi-btn.is-ink { border-color: var(--wi-ink); background: var(--wi-ink); color: var(--wi-on-ink); }
.wi-btn.is-ink:hover { background: #000; }
.wi-btn.is-quiet { border-color: transparent; background: transparent; color: var(--wi-body); }
.wi-btn.is-quiet:hover { background: var(--wi-subtle); }
.wi-link-btn { padding: 0 0 0 12px; border: 0; background: none; color: var(--wi-cu); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.wi-link-btn:hover { color: var(--wi-cu-strong); text-decoration: underline; }
.wi-link-btn.is-danger { color: var(--wi-mut); }
.wi-link-btn.is-danger:hover { color: var(--wi-bad); }

/* Control segmentado (pala) */
.wi-seg { display: inline-flex; padding: 2px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); }
.wi-seg button { height: 26px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--wi-body); font: inherit; font-size: 12.5px; cursor: pointer; }
.wi-seg button.is-on { background: var(--wi-ink); color: var(--wi-on-ink); }
.wi-select select { height: 30px; padding: 0 10px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font: inherit; font-size: 13px; }

/* ---------- Franja de KPI: celdas separadas por filetes verticales ---------- */
.wi-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--wi-ln); border-bottom: 1px solid var(--wi-ln); }
.wi-kpi { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px 14px; border-left: 1px solid var(--wi-ln); }
.wi-kpi:first-child { padding-left: 0; border-left: 0; }
.wi-kpi h3 { margin: 0; font-size: 12.5px; font-weight: 400; color: var(--wi-mut); }
.wi-kpi-big { margin: 4px 0 0; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; }
.wi-kpi-big small { margin-left: 3px; font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--wi-mut); }
.wi-kpi-big.is-text { padding: 3px 0 2px; font-size: 19px; white-space: normal; }
.wi-kpi-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--wi-mut); }
.wi-kpi-foot, .wi-kpi-next { margin: 6px 0 0; font-size: 12px; color: var(--wi-mut); }
.wi-kpi-next { color: var(--wi-cu); }
.wi-meter { display: block; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--wi-subtle); overflow: hidden; }
.wi-meter > span { display: block; height: 100%; background: var(--wi-ink); }
.wi-crusher-mini { margin-top: 10px; }

/* Chips como deltas apagados */
.wi-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; white-space: nowrap; background: var(--wi-subtle); color: var(--wi-body); }
.wi-chip.is-green { background: var(--wi-ok-bg); color: var(--wi-ok); }
.wi-chip.is-blue { background: var(--wi-cu-soft); color: var(--wi-cu); }
.wi-chip.is-yellow { background: var(--wi-warn-bg); color: var(--wi-warn); }
.wi-chip.is-red { background: var(--wi-bad-bg); color: var(--wi-bad); }
.wi-chip.is-gray { background: var(--wi-subtle); color: var(--wi-mut); }

/* ---------- Pares de paneles separados por filetes, y paneles a todo el ancho ---------- */
.wi-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
.wi-pair + .wi-pair, .wi-charts > .wi-pair { margin-top: 18px; border-top: 1px solid var(--wi-ln); }
.wi-pane { min-width: 0; padding: 22px 24px 8px 0; }
.wi-pane + .wi-pane { padding-left: 24px; padding-right: 0; border-left: 1px solid var(--wi-ln); }
.wi-wide { margin-top: 20px; padding: 24px 0 6px; border-top: 1px solid var(--wi-ln); }
.wi-pane h2, .wi-wide h2, .wi-sub-chart h2 { margin: 0; font-family: var(--wi-serif); font-size: 16px; font-weight: var(--ds-fw-display, 600); line-height: 1.3; letter-spacing: -.01em; }
.wi-sub-chart h2 { font-size: 15px; }
.wi-card-sub { margin: 3px 0 14px; font-size: 12.5px; line-height: 1.5; color: var(--wi-mut); }
.wi-card-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.wi-card-head + .wi-card-sub { margin-top: 3px; }
.wi-empty { margin: 0; font-size: 13px; color: var(--wi-mut); }
.wi-charts:empty, .wi-scenarios:empty { display: none; }

/* Puente */
.wi-bridge { display: flex; flex-direction: column; gap: 0; margin: 0 0 12px; padding: 0; list-style: none; }
.wi-bridge li { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--wi-body); }
.wi-bridge li strong { font-weight: 500; color: var(--wi-ink); text-align: right; }
.wi-bridge .sens-bridge-bar { display: block; height: 4px; border-radius: 2px; background: var(--wi-cu); }
.wi-bridge .sens-bridge-bar.is-negative { background: var(--wi-dim); }
.wi-bridge li.is-limit { color: var(--wi-warn); }
.wi-bridge li.is-limit .sens-bridge-bar { background: var(--wi-warn); }
.wi-bridge li.is-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--wi-ink); color: var(--wi-ink); font-weight: 600; }
.wi-bridge li.is-total .sens-bridge-bar { background: var(--wi-ink); }

/* Resumen: puntos de un color, filetes entre líneas */
.wi-brief { margin: 0; padding: 0; list-style: none; }
.wi-brief li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--wi-ln); font-size: 13.5px; line-height: 1.5; color: var(--wi-body); }
.wi-brief li:last-child { border-bottom: 0; }
.wi-brief b { font-weight: 600; color: var(--wi-ink); }
.wi-dot { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--wi-dim); }
.wi-dot.is-green { background: var(--wi-ink); }
.wi-dot.is-blue { background: var(--wi-cu); }
.wi-dot.is-yellow { background: var(--wi-warn); }
.wi-dot.is-red { background: var(--wi-bad); }

/* ---------- Tornado: una barra por palanca ---------- */
.wi-tornado { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.wi-tornado li { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 5px 0; }
.wi-tor-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.wi-tor-label b { overflow: hidden; font-size: 13px; font-weight: 400; color: var(--wi-body); text-overflow: ellipsis; white-space: nowrap; }
.wi-tor-label small { font-size: 11.5px; color: var(--wi-mut); }
.wi-tor-track { position: relative; height: 22px; }
.wi-tor-track i { position: absolute; top: 5px; bottom: 5px; border-radius: 2px; }
.wi-tor-track i.is-gain { background: var(--wi-cu); }
.wi-tor-track i.is-loss { background: var(--wi-dim); }
.wi-tor-track em { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11.5px; font-style: normal; white-space: nowrap; color: var(--wi-body); }
.wi-tor-track em.is-gain { font-weight: 600; color: var(--wi-ink); }
.wi-tor-track em.is-loss, .wi-tor-track em.is-none { color: var(--wi-mut); }
.wi-tor-axis { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--wi-ink); }
.wi-tor-target { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--wi-ink); border: 2px solid var(--wi-paper); transform: rotate(45deg); }
.wi-tor-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--wi-mut); }

/* ---------- Gráficos SVG ---------- */
.wi-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wi-svg { display: block; width: 100%; height: auto; font-family: inherit; }
.wi-svg .wi-axis { font-size: 11px; fill: var(--wi-mut); }
.wi-svg .wi-grid-line { stroke: var(--wi-grid); stroke-width: 1; }
.wi-svg .wi-sim-zone { fill: var(--wi-cu-soft); }
.wi-svg .wi-cutoff { stroke: var(--wi-ln2); stroke-width: 1; stroke-dasharray: 2 3; }
.wi-svg .wi-bar-real { fill: var(--wi-ink); }
.wi-svg .wi-band { fill: var(--wi-cu); opacity: .14; }
.wi-svg .wi-line-scenario { stroke: var(--wi-cu); stroke-width: 2; }
.wi-svg .wi-line-base { stroke: var(--wi-mut); stroke-width: 1.5; stroke-dasharray: 4 3; }
.wi-svg .wi-line-plan { stroke: var(--wi-dim); stroke-width: 1.5; stroke-dasharray: 6 4; }
.wi-svg .wi-label-scenario { font-size: 11.5px; font-weight: 600; fill: var(--wi-cu); }
.wi-svg .wi-label-plan { font-size: 11.5px; fill: var(--wi-mut); }
.wi-svg .wi-curve { fill: none; stroke: var(--wi-cu); stroke-width: 2; }
.wi-svg .wi-point { cursor: pointer; }
.wi-svg .wi-point circle { fill: var(--wi-surface); stroke: var(--wi-cu); stroke-width: 1.5; }
.wi-svg .wi-point:hover circle, .wi-svg .wi-point:focus-visible circle { fill: var(--wi-cu-soft); stroke-width: 2.5; }
.wi-svg .wi-point:focus { outline: none; }
.wi-svg .wi-point.is-current circle { fill: var(--wi-ink); stroke: var(--wi-ink); }
.wi-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 12px; color: var(--wi-mut); }
.wi-legend i { display: inline-block; width: 14px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--wi-ink); }
.wi-legend .is-real { height: 8px; width: 8px; border-radius: 1px; background: var(--wi-ink); }
.wi-legend .is-scenario { background: var(--wi-cu); }
.wi-legend .is-band { height: 8px; background: var(--wi-cu); opacity: .2; }
.wi-legend .is-base { height: 0; border-top: 2px dashed var(--wi-mut); background: none; }
.wi-legend .is-plan { height: 0; border-top: 2px dashed var(--wi-dim); background: none; }

/* ---------- Mapa de calor: gris si se pierde, cobre si se gana ---------- */
.wi-table-scroll { overflow-x: auto; }
.wi-heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.wi-heat th { padding: 4px 6px; font-weight: 400; color: var(--wi-mut); text-align: center; white-space: nowrap; }
.wi-heat th small, .wi-heat-cell small { display: block; font-size: 11px; font-weight: 400; color: inherit; opacity: .8; }
.wi-heat tbody th { text-align: left; color: var(--wi-body); }
.wi-heat tbody th small { color: var(--wi-mut); opacity: 1; }
.wi-heat td { padding: 0; }
.wi-heat-na { text-align: center; color: var(--wi-dim); }
.wi-heat-cell { display: block; width: 100%; min-width: 68px; padding: 8px 4px; border: 0; border-radius: 6px; color: var(--wi-ink); font: inherit; line-height: 1.25; cursor: pointer; }
.wi-heat-cell b { display: block; font-size: 12.5px; font-weight: 600; }
.wi-heat-cell[data-heat-tone="up"] { background: color-mix(in srgb, var(--wi-cu) calc(6% + var(--heat) * 62%), var(--wi-surface)); }
.wi-heat-cell[data-heat-tone="down"] { background: color-mix(in srgb, var(--wi-mut) calc(6% + var(--heat) * 42%), var(--wi-surface)); }
.wi-heat-cell.is-strong { color: var(--wi-surface); }
.wi-heat-cell:hover { box-shadow: inset 0 0 0 1.5px var(--wi-cu); }
.wi-heat-cell.is-current { box-shadow: inset 0 0 0 1.5px var(--wi-ink); }
.wi-heat-cell.is-full b::after { content: ' ⚠'; }

/* ---------- Escenarios guardados ---------- */
.wi-save-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--wi-cu-border); border-radius: 10px; background: var(--wi-surface); }
.wi-save-form label { display: flex; flex: 1 1 240px; flex-direction: column; gap: 4px; font-size: 12px; color: var(--wi-mut); }
.wi-save-form input { height: 32px; padding: 0 10px; border: 1px solid var(--wi-ln2); border-radius: 8px; background: var(--wi-surface); color: var(--wi-ink); font: inherit; font-size: 13.5px; }
.wi-save-form input:focus { border-color: var(--wi-cu-border); outline: none; box-shadow: var(--wi-focus); }
.wi-notice { margin: 0 0 12px; font-size: 13px; color: var(--wi-ok); }
.wi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wi-table th, .wi-table td { padding: 12px 10px; border-bottom: 1px solid var(--wi-ln); text-align: left; vertical-align: middle; }
.wi-table thead th { padding: 8px 10px; font-size: 12px; font-weight: 400; color: var(--wi-mut); white-space: nowrap; }
.wi-table tbody th { font-weight: 400; white-space: nowrap; }
.wi-table tr.is-current th { font-weight: 600; }
.wi-table .wi-num { text-align: right; white-space: nowrap; }
.wi-levers-cell { max-width: 240px; overflow: hidden; color: var(--wi-mut); text-overflow: ellipsis; white-space: nowrap; }
.wi-row-actions { text-align: right; white-space: nowrap; }
.wi-table .wi-nowrap { white-space: nowrap; }
.wi-pos { color: var(--wi-ok); font-weight: 500; }
.wi-neg { color: var(--wi-bad); font-weight: 500; }
.wi-swatch { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: middle; background: var(--wi-series); }
.wi-legend .wi-swatch { width: 8px; height: 8px; margin-right: 6px; }
.wi-spark { display: block; width: 96px; height: 26px; }
.wi-shell .is-base { --wi-series: var(--wi-dim); }
.wi-shell .is-current { --wi-series: var(--wi-cu); }
.wi-shell .is-s0 { --wi-series: var(--wi-alt); }
.wi-shell .is-s1 { --wi-series: var(--wi-ink); }
.wi-shell .is-s2 { --wi-series: var(--wi-warn); }
.wi-shell .is-s3 { --wi-series: var(--wi-bad); }
.wi-shell .is-s4 { --wi-series: var(--wi-cu-strong); }
.wi-svg .wi-overlay { fill: none; stroke: var(--wi-series); stroke-width: 2; }
.wi-spark .wi-overlay { stroke-width: 1.5; }
.wi-svg .wi-overlay.is-base { stroke-dasharray: 4 3; stroke-width: 1.5; }
.wi-svg .wi-box line, .wi-svg .wi-box rect { stroke: var(--wi-series); stroke-width: 1.5; }
.wi-svg .wi-box rect { fill: var(--wi-surface); }
.wi-svg .wi-box .wi-box-median { stroke-width: 3; }

/* ---------- Análisis secundarios: una fila cada uno ---------- */
.wi-rows { margin-top: 24px; border-top: 1px solid var(--wi-ln); }
.wi-row { border-bottom: 1px solid var(--wi-ln); }
.wi-row > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; font-size: 13.5px; cursor: pointer; list-style: none; }
.wi-row > summary::-webkit-details-marker { display: none; }
.wi-row > summary small { font-size: 12.5px; color: var(--wi-mut); text-align: right; }
.wi-row > summary small::after { content: ' →'; }
.wi-row[open] > summary small::after { content: ' ↓'; }
.wi-row > summary:hover span { color: var(--wi-cu); }
.wi-row-body { padding: 4px 0 24px; }
.wi-row-body > div + div { margin-top: 24px; }
.wi-row-body .cp-sim-results-multi { display: block; width: auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
.wi-row-body .sens-haulage { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }

@media (max-width: 1280px) { .wi-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wi-kpi:nth-child(3) { padding-left: 0; border-left: 0; } .wi-kpi:nth-child(n+3) { border-top: 1px solid var(--wi-ln); } }
@media (max-width: 1100px) {
    .wi-pair { grid-template-columns: minmax(0, 1fr); }
    .wi-pane + .wi-pane { padding-left: 0; border-left: 0; border-top: 1px solid var(--wi-ln); }
}
@media (max-width: 900px) {
    .wi-shell { grid-template-columns: minmax(0, 1fr); }
    .wi-levers { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--wi-ln); }
    .wi-main { padding: 18px 16px; }
    .wi-bridge li { grid-template-columns: minmax(0, 1fr) auto; }
    .wi-bridge li .sens-bridge-bar { display: none; }
    .wi-tornado li { grid-template-columns: minmax(0, 120px) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .wi-levers .sim-card-btn-remove, .wi-levers .sim-variable-help-trigger { transition: none; } }

/* Ajustes finos */
.wi-truck > .wi-chip.is-gray { display: none; }
.wi-svg .wi-sim-zone { fill: var(--wi-subtle); opacity: .6; }
#wiMoreRisk .wi-svg { max-width: 760px; }
.wi-shell .sens-crusher-track { height: 4px; border: 0; border-radius: 2px; background: var(--wi-subtle); }
.wi-shell .sens-crusher-base { background: var(--wi-ink); }
.wi-shell .sens-crusher-added { background: var(--wi-cu); }
.wi-shell .sens-crusher-excess { background: var(--wi-bad); }
.wi-shell .sens-crusher-cap { top: -3px; bottom: -3px; width: 1px; background: var(--wi-ink); }
.wi-shell .sens-crusher-shown { top: -3px; bottom: -3px; border-left: 1px dashed var(--wi-mut); }
.wi-shell .sens-crusher-head { font-weight: 400; color: var(--wi-body); }
.wi-spark .wi-overlay { fill: none; stroke: var(--wi-series); vector-effect: non-scaling-stroke; }

/* ---------- Tarjetas (pedido de Carlos: cada bloque en su tarjeta, contraste con el fondo) ----------
   Cada bloque lleva .ds-panel (components.css). Estas reglas repiten sus valores con respaldo para que
   la vista se vea igual mientras components.css no esté cargado, y ajustan lo propio del What-if. */
.wi-shell { --wi-canvas: var(--ds-bg-canvas, #f5f6f8); --wi-card-radius: var(--ds-radius-lg, 14px); --wi-card-shadow: var(--ds-shadow-card, 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03)); background: var(--wi-canvas); }
body.wi-on, body.wi-on main { background: var(--ds-bg-canvas, #f5f6f8); }
.wi-main { background: var(--wi-canvas); }
.wi-main .sens-range, .wi-kpi, .wi-pane, .wi-wide, .wi-rows {
    background: var(--wi-surface); border: 1px solid var(--wi-ln); border-radius: var(--wi-card-radius); box-shadow: var(--wi-card-shadow);
}
.wi-main .sens-range { margin-top: 20px; padding: 16px 22px 14px; }
.wi-shell .wi-kpis { gap: 16px; margin-top: 20px; border: 0; }
.wi-shell .wi-kpi, .wi-shell .wi-kpi:first-child { margin: 0; padding: 18px 20px; border: 1px solid var(--wi-ln); }
.wi-kpi h3.ds-panel__sub { margin: 0; font-size: 12.5px; }
.wi-pair { gap: 20px; margin-top: 20px; }
.wi-pair + .wi-pair, .wi-charts > .wi-pair { margin-top: 20px; border-top: 0; }
.wi-pane, .wi-pane + .wi-pane { margin: 0; padding: 22px; border: 1px solid var(--wi-ln); }
.wi-wide, .wi-wide + .wi-wide { margin-top: 20px; padding: 22px; }
.wi-rows { margin-top: 20px; padding: 0 22px; overflow: visible; }
.wi-row:last-child { border-bottom: 0; }
.wi-table tbody tr:last-child th, .wi-table tbody tr:last-child td { border-bottom: 0; }
.wi-card-sub.ds-panel__sub { margin: 3px 0 16px; font-size: 12.5px; }
@media (max-width: 1280px) { .wi-shell .wi-kpi:nth-child(n+3) { border-top: 1px solid var(--wi-ln); } .wi-shell .wi-kpi:nth-child(3) { padding-left: 20px; border-left: 1px solid var(--wi-ln); } }
@media (max-width: 1100px) { .wi-pane + .wi-pane { padding-left: 22px; border: 1px solid var(--wi-ln); } }

/* ---------- Palancas sin desbordes (pedido de Carlos): nombre y valor en una línea, riel limpio,
   aporte en texto pequeño debajo. Las marcas Actual/Meta/Ocupado se explican una vez en la leyenda. ---------- */
.wi-levers .sim-card-title-group { display: contents; }
.wi-levers .sim-card-name { grid-column: 1; grid-row: 1; align-self: center; }
.wi-levers .sim-card-cat-badge { display: none; }
.wi-levers .sim-number-input-wrap { white-space: nowrap; }
.wi-levers .sim-slider-wrap { margin: 8px 0 4px; }
.wi-levers .sim-marker-label, .wi-levers .sim-excess-label { display: none; }
.wi-levers .sim-card-contribution { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin: 0 0 10px; padding: 0; border-radius: 0; background: none; color: var(--wi-mut); font-size: 11.5px; font-weight: 400; line-height: 1.3; }
.wi-levers .sim-card-contribution.is-negative { background: none; color: var(--wi-bad); }
.wi-levers .sim-intervention-card { padding-bottom: 6px; }
.wi-rail-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; font-size: 11.5px; color: var(--wi-mut); }
.wi-rail-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wi-rail-legend i { display: inline-block; width: 2px; height: 10px; border-radius: 1px; background: var(--wi-ink); }
.wi-rail-legend i.is-goal { background: var(--wi-ok); }
.wi-rail-legend i.is-busy { width: 14px; height: 4px; border-radius: 2px; background: var(--wi-bad); opacity: .35; }

/* ---------- (i) con la explicación de cada tarjeta ---------- */
.wi-info { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 6px; padding: 0; border: 1px solid var(--wi-ln); border-radius: 50%; background: var(--wi-surface); color: var(--wi-mut); font: italic 600 10.5px/1 Georgia, serif; vertical-align: 2px; cursor: help; }
.wi-info:hover, .wi-info:focus-visible { color: var(--wi-ink); border-color: var(--wi-mut); outline: none; }
.wi-info:focus-visible { box-shadow: var(--wi-focus); }
.wi-info::after { content: attr(data-tip); position: absolute; z-index: 20; top: calc(100% + 8px); left: 50%; width: max-content; max-width: 300px; padding: 8px 10px; border-radius: 8px; background: var(--wi-ink); color: var(--wi-surface); font: 400 12px/1.45 var(--ds-font-body, Inter, system-ui, sans-serif); letter-spacing: 0; text-align: left; white-space: normal; transform: translateX(-50%); box-shadow: 0 4px 14px rgba(16, 24, 40, .18); opacity: 0; pointer-events: none; transition: opacity .12s; }
.wi-info:hover::after, .wi-info:focus-visible::after { opacity: 1; }
.wi-pane h2, .wi-wide h2, .wi-sub-chart h2 { margin-bottom: 14px; }
@media (prefers-reduced-motion: reduce) { .wi-info::after { transition: none; } }

/* ---------- Tarjeta de período con el estilo del sistema: riel fino, tinta para lo real, cobre para lo simulado ---------- */
.wi-main .sens-split-labels { font-weight: 500; }
.wi-main .sens-split-labels > span:first-child { color: var(--wi-ink); }
.wi-main .sens-split-labels > span:last-child { color: var(--wi-cu); }
.wi-main #sensCutoffLabel { font-weight: 500; color: var(--wi-mut); }
.wi-main #sensSplitSlider { height: 6px; border-radius: 999px; accent-color: var(--wi-cu); background: linear-gradient(to right, var(--wi-ink) 0 var(--real-share), var(--wi-cu) var(--real-share) 100%); }
.wi-main #sensSplitSlider::-webkit-slider-thumb { width: 16px; height: 16px; border: 2px solid var(--wi-ink); border-radius: 50%; background: var(--wi-surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .15); }
.wi-main #sensSplitSlider::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--wi-ink); border-radius: 50%; background: var(--wi-surface); }
.wi-main #sensSplitSlider:focus-visible { outline: none; box-shadow: var(--wi-focus); }
.wi-main .sens-real-limit { width: 2px; background: var(--wi-ink); box-shadow: 0 0 0 1px var(--wi-surface); }
.wi-main .sens-timeline-tonnage span { color: var(--wi-mut); font-weight: 400; }
.wi-main .sens-real-tonnage strong { color: var(--wi-ink); }
.wi-main .sens-sim-tonnage strong { color: var(--wi-cu); }
.wi-main .sens-timeline-tonnage strong { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Barra sin variables: aviso corto alineado a la izquierda, sin ícono, botón del sistema ---------- */
.wi-levers .cp-sim-empty-state { display: block; padding: 6px 0 14px; text-align: left; }
.wi-levers .cp-sim-empty-state .empty-icon { display: none; }
.wi-levers .cp-sim-empty-state h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--wi-ink); }
.wi-levers .cp-sim-empty-state p { margin: 0 0 10px; font-size: 12px; line-height: 1.45; color: var(--wi-mut); }
.wi-levers .cp-sim-empty-state p strong { font-weight: 500; color: var(--wi-ink); }
.wi-levers .cp-sim-empty-state button { height: 30px; padding: 0 12px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font: inherit; font-size: 12.5px; cursor: pointer; box-shadow: none; }
.wi-levers .cp-sim-empty-state button:hover { background: var(--wi-subtle); }
.wi-levers .cp-sim-empty-state button:focus-visible { outline: none; box-shadow: var(--wi-focus); }

/* ---------- Vista por flota simple (pedido de Carlos, referencia: vista Mina) ----------
   Arriba: resultado (KPI), puente y tornado. Lo demás va en filas plegadas, sin tarjetas anidadas. */
.wi-tornado-host { display: flex; min-width: 0; }
.wi-tornado-host > .wi-pane { flex: 1; min-width: 0; }
.wi-row-body > div > .wi-pane, .wi-row-body > div > .wi-wide, .wi-row-body .wi-scenarios > .wi-wide {
    margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
}
.wi-row-body > div > .wi-pane > h2, .wi-row-body > div > .wi-wide > .wi-card-head h2,
.wi-row-body > div > .wi-wide > h2, .wi-row-body .wi-scenarios .wi-card-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wi-row-body .wi-card-head { margin-bottom: 8px; }
.wi-row-body > div > .wi-pane { max-width: 760px; }
#wiMoreTrucks > .wi-pane { max-width: none; }

/* ---------- Íconos de cada palanca: siempre visibles, mismo tamaño y área de clic. Color de texto de cuerpo
   (≥ 9:1 en todos los temas); el tono tenue quedaba en ~2,3:1. ---------- */
.wi-levers .sens-variable-actions { gap: 2px; }
.wi-levers .sens-variable-reset { display: inline-grid; }
.wi-levers .sim-card-btn-remove, .wi-levers .sim-variable-help-trigger, .wi-levers .sens-variable-reset {
    display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px;
    background: none; color: var(--ds-text-body, #374151); font: 400 13px/1 var(--ds-font-body, Inter, system-ui, sans-serif); opacity: 1; cursor: pointer; box-shadow: none;
}
.wi-levers .sim-card-btn-remove:hover, .wi-levers .sim-variable-help-trigger:hover, .wi-levers .sens-variable-reset:hover { background: var(--wi-subtle); color: var(--wi-ink); }
.wi-levers .sim-card-btn-remove:focus-visible, .wi-levers .sim-variable-help-trigger:focus-visible, .wi-levers .sens-variable-reset:focus-visible { outline: none; box-shadow: var(--wi-focus); }
.wi-levers .sim-variable-help-trigger svg { width: 15px; height: 15px; }
/* La ayuda general del panel va en la línea del título del grupo, no flotando sobre la primera palanca. */
.wi-levers #wiGroupTree { position: relative; }
.wi-levers .cp-sim-controls-multi > .sens-panel-heading { top: -26px; }

/* ---------- Pie de la barra: botones reales ---------- */
.wi-levers .wi-reset, .wi-levers-foot .wi-reset { width: 100%; height: 34px; padding: 0 14px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font-size: 13px; justify-content: center; cursor: pointer; }
.wi-levers .wi-reset:hover { background: var(--wi-subtle); }
#wiCrusher a.ds-link[href="/mina/whatif"] { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font-size: 12.5px; text-decoration: none; }
#wiCrusher a.ds-link[href="/mina/whatif"]::after { content: '→'; color: var(--wi-mut); }
#wiCrusher a.ds-link[href="/mina/whatif"]:hover { background: var(--wi-subtle); }
#wiCrusher a.ds-link[href="/mina/whatif"]:focus-visible { outline: none; box-shadow: var(--wi-focus); }
.wi-truck-why { display: block; margin-top: 1px; font-size: 11px; color: var(--wi-mut); }

/* ---------- Leyendas de los gráficos: líneas reconocibles y valores ---------- */
.wi-sub-chart .wi-legend { gap: 6px 18px; margin: 0 0 10px; }
.wi-sub-chart .wi-legend li { display: inline-flex; align-items: center; gap: 6px; }
.wi-sub-chart .wi-legend li b { font-weight: 600; color: var(--wi-ink); font-variant-numeric: tabular-nums; }
.wi-sub-chart .wi-legend i { margin-right: 0; }
.wi-legend .is-scenario { height: 3px; border-radius: 2px; }
.wi-legend .is-band { width: 14px; height: 10px; border-radius: 2px; }
.wi-legend .is-plan { width: 16px; border-top: 2px dashed var(--wi-dim, var(--wi-mut)); }
.wi-legend .is-base { width: 16px; border-top: 2px dotted var(--wi-mut); }
.wi-line-key { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--wi-series); vertical-align: middle; }
.wi-line-key.is-base { border-top: 2px dashed var(--wi-series); }
#wiMoreCumulative { margin-top: 18px; }
.wi-truck .wi-truck-why { white-space: normal; overflow: visible; text-overflow: clip; }

/* ---------- Agregar variable: botón en la barra y popup con el efecto del 1 % ---------- */
.wi-add-var { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 4px; height: 30px; padding: 0 12px; border: 1px dashed var(--wi-ln); border-radius: 999px; background: var(--wi-surface); color: var(--wi-ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.wi-add-var span { color: var(--wi-cu); font-size: 15px; line-height: 1; }
.wi-add-var:hover { border-style: solid; background: var(--wi-subtle, #f5f6f8); }
.wi-add-var:focus-visible { outline: none; box-shadow: var(--wi-focus); }
.wi-add-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(78vh, 760px); padding: 0; border: 1px solid var(--ds-border, #e5e7eb); border-radius: var(--ds-radius-lg, 14px); background: var(--ds-surface, #fff); color: var(--ds-text, #111827); box-shadow: 0 18px 48px rgba(16, 24, 40, .18); font-family: var(--ds-font-body, Inter, system-ui, sans-serif); }
.wi-add-dialog[open] { display: flex; flex-direction: column; }
.wi-add-dialog::backdrop { background: rgba(16, 24, 40, .35); }
.wi-add-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 10px; }
.wi-add-dialog h2 { margin: 0; font-size: 16px; font-weight: 600; }
.wi-add-dialog header p { margin: 3px 0 0; font-size: 12.5px; color: var(--ds-text-muted, #6b7280); }
.wi-add-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ds-text-muted, #6b7280); font-size: 20px; cursor: pointer; }
.wi-add-close:hover { background: var(--ds-bg-canvas, #f5f6f8); color: inherit; }
.wi-add-search { margin: 0 22px 8px; height: 34px; padding: 0 12px; border: 1px solid var(--ds-border, #e5e7eb); border-radius: 8px; font: inherit; font-size: 13px; }
.wi-add-search:focus { outline: none; border-color: var(--ds-accent, #b4532a); }
.wi-add-list { flex: 1; overflow: auto; margin: 0; padding: 0 22px 18px; list-style: none; }
.wi-add-list li { display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ds-border, #e5e7eb); }
.wi-add-list li:last-child { border-bottom: 0; }
.wi-add-name { display: flex; flex-direction: column; min-width: 0; }
.wi-add-name b { font-size: 13px; font-weight: 500; }
.wi-add-name small { font-size: 11.5px; color: var(--ds-text-muted, #6b7280); }
.wi-add-why { color: var(--ds-text-muted, #6b7280); font-style: italic; }
.wi-add-bar { height: 6px; border-radius: 3px; background: var(--ds-bg-canvas, #f1f2f4); overflow: hidden; }
.wi-add-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ds-accent, #b4532a); }
.wi-add-gain { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.wi-add-pick { height: 28px; padding: 0 12px; border: 1px solid var(--ds-border, #e5e7eb); border-radius: 999px; background: var(--ds-surface, #fff); color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
.wi-add-pick:hover:not(:disabled) { border-color: var(--ds-accent, #b4532a); color: var(--ds-accent, #b4532a); }
.wi-add-pick:disabled { opacity: .45; cursor: not-allowed; }
.wi-add-list li.is-off .wi-add-gain { color: var(--ds-text-muted, #6b7280); font-weight: 400; }
.wi-add-empty { display: block !important; color: var(--ds-text-muted, #6b7280); font-size: 13px; }
.wi-add-dialog[open] { position: fixed; inset: 0; margin: auto; height: fit-content; }
.wi-add-full { margin: 0 22px 10px; padding: 8px 12px; border-radius: 8px; background: var(--ds-bg-canvas, #f5f6f8); font-size: 12.5px; color: var(--ds-text, #111827); }
.wi-add-full[hidden] { display: none; }

/* ---------- Fondo gris detrás de los modals de la página (agregar variable, rango del horizonte) y
   centrados: el reseteo global deja margin 0 en <dialog>. ---------- */
.wi-add-dialog::backdrop, #sensDateRangeDialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
#sensDateRangeDialog[open] { position: fixed; inset: 0; margin: auto; height: fit-content; }

/* ---------- − y + a los lados del deslizador: fila 2 = [−][riel][+]. ---------- */
.wi-levers .sim-intervention-card { grid-template-columns: 22px minmax(0, 1fr) auto auto 22px; }
.wi-levers .sim-card-name { grid-column: 1 / 3; }
.wi-levers .sim-number-input-wrap { grid-column: 3; }
.wi-levers .sens-variable-actions { grid-column: 4 / 6; justify-self: end; }
.wi-levers .sim-slider-wrap { grid-column: 2 / 5; grid-row: 2; }
.wi-levers .sim-card-contribution { grid-column: 1 / -1; }
.wi-levers .wi-step { grid-row: 2; width: 22px; height: 22px; padding: 0; border: 1px solid var(--wi-ln); border-radius: 50%; background: var(--wi-surface); color: var(--wi-ink); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.wi-levers .wi-step.is-down { grid-column: 1; }
.wi-levers .wi-step.is-up { grid-column: 5; }
.wi-levers .wi-step:hover { border-color: var(--wi-cu-border, var(--wi-cu)); color: var(--wi-cu); }
.wi-levers .wi-step:focus-visible { outline: none; box-shadow: var(--wi-focus); }

/* ---------- Gráficos más finos (pedido de Carlos, 2026-12-04) ----------
   Riesgo del período, producción diaria y acumulada: grilla suave, barras redondeadas, caja con relleno tenue,
   etiquetas a escala real y tooltip propio (.ds-chart-tip, chart_tip.js) en lugar del <title> nativo. */
.wi-chart .wi-grid-line { stroke: var(--wi-grid); stroke-width: 1; }
.wi-chart .wi-grid-line.is-zero { stroke: var(--wi-ln2); }
.wi-chart .wi-axis { font-size: 11px; fill: var(--wi-mut); font-variant-numeric: tabular-nums; }
.wi-chart .wi-axis-strong { font-size: 12px; font-weight: 600; fill: var(--wi-ink); }
.wi-chart .wi-cutoff { stroke: var(--wi-ln2); stroke-dasharray: 3 3; }
.wi-chart .wi-cutoff-label { font-size: 10.5px; fill: var(--wi-dim); }
.wi-chart .wi-sim-zone { fill: var(--wi-subtle); opacity: .55; }
.wi-chart .wi-bar-real { fill: color-mix(in srgb, var(--wi-ink) 78%, var(--wi-surface)); }
.wi-chart .wi-band { fill: var(--wi-cu); opacity: .12; }
.wi-chart .wi-line-scenario { stroke: var(--wi-cu); stroke-width: 2.5; stroke-linecap: round; }
.wi-chart .wi-dot-scenario { fill: var(--wi-cu); stroke: var(--wi-surface); stroke-width: 2; }
.wi-chart .wi-line-base { stroke: var(--wi-mut); stroke-width: 1.5; stroke-dasharray: 2 4; stroke-linecap: round; }
.wi-chart .wi-line-plan { stroke: var(--wi-dim); stroke-width: 1.5; stroke-dasharray: 6 5; }
.wi-chart .wi-label-plan { font-size: 11px; font-weight: 500; fill: var(--wi-mut); }
.wi-chart .wi-overlay { stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.wi-chart .wi-overlay-end { fill: var(--wi-series); stroke: var(--wi-surface); stroke-width: 2; }
.wi-chart .wi-overlay, .wi-chart .wi-bar-real, .wi-chart .wi-band, .wi-chart line, .wi-chart circle:not(.wi-hover-dot) { pointer-events: none; }
/* Zonas de puntero: invisibles; al pasar resaltan el día o el escenario. */
.wi-chart .wi-hit { fill: var(--wi-ink); opacity: 0; cursor: default; }
.wi-chart .wi-hit:hover, .wi-chart .wi-hit:focus-visible { opacity: .035; outline: none; }
.wi-chart .wi-hover-guide { stroke: var(--wi-ln2); stroke-width: 1; opacity: 0; }
.wi-chart .wi-hover-dot { fill: var(--wi-series); stroke: var(--wi-surface); stroke-width: 2; opacity: 0; pointer-events: none; }
.wi-chart .wi-hover-col:hover .wi-hover-guide, .wi-chart .wi-hover-col:hover .wi-hover-dot { opacity: 1; }
.wi-chart .wi-hover-col .wi-hit:hover { opacity: 0; }
/* Caja de riesgo: rango P25–P75 con relleno tenue del color de la serie, mediana marcada y su cifra al lado. */
#wiMoreRisk .wi-risk { max-width: 760px; }
.wi-risk .wi-box .wi-box-iqr { fill: color-mix(in srgb, var(--wi-series) 14%, var(--wi-surface)); stroke: var(--wi-series); stroke-width: 1.5; }
.wi-risk .wi-box .wi-box-whisker { stroke: var(--wi-series); stroke-width: 1.25; opacity: .7; }
.wi-risk .wi-box .wi-box-cap { stroke: var(--wi-series); stroke-width: 1.5; stroke-linecap: round; opacity: .7; }
.wi-risk .wi-box .wi-box-median { stroke: var(--wi-series); stroke-width: 3; stroke-linecap: round; }
.wi-risk .wi-box-value { font-size: 12px; font-weight: 600; fill: var(--wi-ink); font-variant-numeric: tabular-nums; pointer-events: none; }
.wi-risk .wi-box .wi-hit:hover ~ *, .wi-risk .wi-box:hover .wi-box-iqr { stroke-width: 2; }

/* Respuesta a camiones: mismo lenguaje que producción diaria (grilla suave, curva gruesa, banda tenue, columna al pasar). */
.wi-truck-chart .wi-curve { fill: none; stroke: var(--wi-cu); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.wi-truck-chart .wi-band { fill: var(--wi-cu); opacity: .12; }
.wi-truck-chart .wi-point { cursor: pointer; }
.wi-truck-chart .wi-point:focus { outline: none; }
.wi-truck-chart .wi-point .wi-point-dot { fill: var(--wi-surface); stroke: var(--wi-cu); stroke-width: 2; pointer-events: none; transition: r .12s; }
.wi-truck-chart .wi-point:hover .wi-point-dot, .wi-truck-chart .wi-point:focus-visible .wi-point-dot { fill: var(--wi-cu); stroke: var(--wi-surface); }
.wi-truck-chart .wi-point.is-current .wi-point-dot { fill: var(--wi-ink); stroke: var(--wi-surface); stroke-width: 2.5; }
.wi-truck-chart .wi-point:focus-visible .wi-hover-guide, .wi-truck-chart .wi-point:hover .wi-hover-guide { opacity: 1; }
.wi-truck-chart .wi-point:focus-visible .wi-hit { opacity: .035; }
