/* V348 interactive concept animations — plain CSS, light/dark aware. */

.mc-anim {
  --a-accent: var(--global-theme-color, #2a7ae2);
  --a-region: rgba(42, 122, 226, 0.16);
  --a-line: rgba(0, 0, 0, 0.45);
  --a-border: rgba(0, 0, 0, 0.14);
  --a-surface: rgba(0, 0, 0, 0.02);
  --a-opt: #e8730c;
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--a-border);
  border-radius: 10px;
  background: var(--a-surface);
}

@media (prefers-color-scheme: dark) {
  .mc-anim {
    --a-region: rgba(99, 160, 255, 0.22);
    --a-line: rgba(255, 255, 255, 0.5);
    --a-border: rgba(255, 255, 255, 0.16);
    --a-surface: rgba(255, 255, 255, 0.03);
    --a-opt: #ffa94d;
  }
}

.mc-anim-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* plot elements */
.mc-anim .mc-axis path,
.mc-anim .mc-axis line {
  stroke: var(--a-line);
  opacity: 0.5;
}
.mc-anim .mc-axis text {
  fill: currentColor;
  font-size: 11px;
}
.mc-anim .mc-axis-label {
  fill: currentColor;
  font-size: 12px;
  opacity: 0.8;
}
.mc-anim .mc-region {
  fill: var(--a-region);
  stroke: var(--a-accent);
  stroke-width: 1;
}
.mc-anim .mc-constraint {
  stroke: var(--a-line);
  stroke-width: 1.25;
  stroke-dasharray: 4 3;
  opacity: 0.7;
}
.mc-anim .mc-objective {
  stroke: var(--a-opt);
  stroke-width: 2.5;
}
.mc-anim .mc-vertex {
  fill: var(--a-accent);
}
.mc-anim .mc-optimum {
  fill: none;
  stroke: var(--a-opt);
  stroke-width: 3;
}

/* lp-integer: whole-number plans inside the feasible region */
.mc-anim .mc-lattice {
  fill: var(--a-accent);
  opacity: 0.55;
}
.mc-anim .mc-optimum.mc-infeasible {
  stroke: #c62828;
  stroke-dasharray: 3 2;
}

/* controls */
.mc-anim-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 0.6rem;
}
.mc-anim-slider {
  flex: 1 1 auto;
  accent-color: var(--a-opt);
}
.mc-anim-readout {
  margin-top: 0.5rem;
  font-size: 0.92rem;
}
.mc-opt-tag {
  color: var(--a-opt);
  font-weight: 600;
}
.mc-anim-error {
  color: #c62828;
  font-style: italic;
}

/* decision-tree widget */
.mc-anim .mc-tree-edge {
  fill: none;
  stroke: var(--a-line);
  stroke-width: 1.5;
  opacity: 0.65;
}
.mc-anim .mc-tree-edge.mc-chosen {
  stroke: var(--a-opt);
  stroke-width: 3;
  opacity: 1;
}
.mc-anim .mc-tree-edge.mc-pruned {
  opacity: 0.2;
  stroke-dasharray: 3 3;
}
.mc-anim .mc-tree-blabel {
  fill: currentColor;
  font-size: 11px;
  opacity: 0.85;
}
.mc-anim .mc-node-decision {
  fill: var(--a-surface);
  stroke: var(--a-accent);
  stroke-width: 2;
}
.mc-anim .mc-node-chance {
  fill: var(--a-surface);
  stroke: var(--a-line);
  stroke-width: 2;
}
.mc-anim .mc-node-leaf {
  fill: var(--a-accent);
}
.mc-anim .mc-tree-payoff {
  fill: currentColor;
  font-size: 12px;
  font-weight: 600;
}
.mc-anim .mc-tree-value {
  fill: var(--a-opt);
  font-size: 12px;
  font-weight: 700;
}

/* monte-carlo widget */
.mc-anim .mc-mc-bar {
  fill: var(--a-accent);
  opacity: 0.85;
}
.mc-anim .mc-mc-true {
  stroke: var(--a-opt);
  stroke-width: 2.5;
}
.mc-anim .mc-mc-meanline {
  fill: none;
  stroke: var(--a-accent);
  stroke-width: 2;
}

/* lp walk-corners marker + coefficient slider label */
.mc-anim .mc-walker {
  fill: var(--a-opt);
  stroke: #fff;
  stroke-width: 1.5;
}
.mc-anim-clabel {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* lp-feasibility draggable dot */
.mc-anim .mc-drag-dot {
  cursor: grab;
  stroke: #fff;
  stroke-width: 2;
}
.mc-anim .mc-drag-dot.mc-ok {
  fill: var(--a-accent);
}
.mc-anim .mc-drag-dot.mc-bad {
  fill: #c62828;
}
.mc-anim .mc-cons-list {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}
.mc-anim .mc-vio {
  color: #c62828;
}
.mc-anim .mc-sat {
  color: #2e7d32;
}

/* decision-criteria payoff table */
.mc-crit-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
.mc-crit-table th,
.mc-crit-table td {
  border: 1px solid var(--a-border);
  padding: 0.35rem 0.55rem;
  text-align: center;
}
.mc-crit-table td.mc-crit-row {
  background: color-mix(in srgb, var(--a-accent) 14%, transparent);
}
.mc-crit-table td.mc-crit-cell {
  outline: 2px solid var(--a-opt);
  font-weight: 700;
}
.mc-crit-table td.mc-crit-cell-regret {
  outline: 2px dashed var(--a-line);
}

/* random-mapping strip */
.mc-anim .mc-rm-label {
  fill: currentColor;
  font-size: 11px;
}
.mc-anim .mc-rm-marker {
  stroke: var(--a-opt);
  stroke-width: 3;
}

/* forecast widget */
.mc-anim .mc-fc-actual {
  fill: none;
  stroke: var(--a-accent);
  stroke-width: 2;
}
.mc-anim .mc-fc-point {
  fill: var(--a-accent);
}
.mc-anim .mc-fc-forecast {
  fill: none;
  stroke: var(--a-opt);
  stroke-width: 2.5;
  stroke-dasharray: 5 3;
}
.mc-anim .mc-fc-next {
  fill: var(--a-opt);
  stroke: #fff;
  stroke-width: 1.5;
}

/* break-even widget */
.mc-anim .mc-be-cost {
  stroke: var(--a-opt);
  stroke-width: 2.5;
}
.mc-anim .mc-be-rev {
  stroke: var(--a-accent);
  stroke-width: 2.5;
}
.mc-anim .mc-be-fixed {
  stroke: var(--a-line);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}
.mc-anim .mc-be-tag {
  font-size: 11px;
  font-weight: 600;
}
.mc-anim .mc-eb-seg {
  transition: opacity 0.18s ease;
  stroke: #fff;
  stroke-width: 1;
}
/* A zero contribution: a line with no width, never a thin block. */
.mc-anim .mc-eb-zero {
  fill: none;
  stroke-width: 1.6;
  transition: opacity 0.18s ease;
}
.mc-anim .mc-eb-cost {
  fill: #c62828;
  fill-opacity: 0.55;
  stroke: #fff;
  stroke-width: 1;
  transition: opacity 0.18s ease;
}
.mc-anim .mc-eb-bartag {
  font-size: 11px;
  font-weight: 700;
  fill: #1f1f1f;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3;
}
.mc-anim .mc-eb-lab {
  font-size: 10.5px;
  font-weight: 600;
}
.mc-anim .mc-eb-sub {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.8;
}
.mc-anim .mc-eb-arrow {
  fill: none;
  stroke-width: 1.2;
  opacity: 0.85;
}
.mc-anim .mc-eb-head {
  stroke: none;
}
.mc-anim .mc-eb-gap {
  fill: rgba(123, 75, 183, 0.13);
}
.mc-anim .mc-eb-edge {
  stroke: #7b4bb7;
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
}
.mc-anim .mc-eb-span {
  stroke: #7b4bb7;
  stroke-width: 1.6;
}
.mc-anim .mc-eb-spanhead {
  fill: #7b4bb7;
}
.mc-anim .mc-eb-net {
  font-size: 12px;
  font-weight: 700;
  fill: #7b4bb7;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
}
.mc-anim .mc-rm-dot {
  opacity: 0.75;
}
.mc-anim .mc-pg-svg {
  max-width: 320px;
  display: block;
  margin-inline: auto;
}
.mc-anim .mc-pg-cell {
  fill: var(--a-grid, #e6e8ec);
  stroke: #fff;
  stroke-width: 1;
  transition:
    fill 0.18s ease,
    stroke 0.18s ease;
}
.mc-anim .mc-pg-a {
  fill: var(--a-accent);
  fill-opacity: 0.65;
}
.mc-anim .mc-pg-b {
  fill: var(--a-opt);
  fill-opacity: 0.65;
}
.mc-anim .mc-pg-both {
  fill: #7b4bb7;
  fill-opacity: 0.8;
}
.mc-anim .mc-pg-flag {
  stroke: #1f1f1f;
  stroke-width: 2.5;
  stroke-dasharray: 3 2;
}
.mc-anim .mc-rm-label-out {
  font-size: 10px;
}
.mc-anim .mc-rm-leader {
  stroke: var(--a-line);
  stroke-width: 1;
  opacity: 0.55;
}
.mc-anim .mc-be-tag-eq {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}
.mc-anim .mc-be-cost-t {
  fill: var(--a-opt);
}
.mc-anim .mc-be-rev-t {
  fill: var(--a-accent);
}
.mc-anim .mc-be-dot {
  fill: var(--a-opt);
  stroke: #fff;
  stroke-width: 2;
}
.mc-anim .mc-be-fixed-t {
  fill: var(--a-line);
}
.mc-anim .mc-be-loss {
  fill: rgba(198, 40, 40, 0.15);
}
.mc-anim .mc-be-profit {
  fill: rgba(46, 125, 50, 0.16);
}
.mc-anim .mc-be-region-t {
  font-size: 12px;
  font-weight: 700;
}
.mc-anim .mc-be-loss-t {
  fill: #c62828;
}
.mc-anim .mc-be-profit-t {
  fill: #2e7d32;
}
@media (prefers-color-scheme: dark) {
  .mc-anim .mc-be-loss {
    fill: rgba(255, 120, 120, 0.18);
  }
  .mc-anim .mc-be-profit {
    fill: rgba(120, 220, 130, 0.18);
  }
  .mc-anim .mc-be-loss-t {
    fill: #ff8a80;
  }
  .mc-anim .mc-be-profit-t {
    fill: #91e0a0;
  }
}

/* posterior-revision bars */
.mc-anim .mc-post-bar {
  fill: var(--a-accent);
  opacity: 0.78;
}
.mc-anim .mc-post-lab {
  fill: currentColor;
  font-size: 12px;
  font-weight: 700;
}

/* shadow-price plot */
.mc-anim .mc-sp-line {
  fill: none;
  stroke: var(--a-accent);
  stroke-width: 2.5;
}
.mc-anim .mc-sp-dot {
  fill: var(--a-opt);
  stroke: #fff;
  stroke-width: 2;
}

/* transport-network */
.mc-anim .mc-tn-edge {
  stroke: var(--a-accent);
  opacity: 0.65;
}
.mc-anim .mc-tn-edge.mc-tn-zero {
  stroke: var(--a-line);
  opacity: 0.25;
}
.mc-anim .mc-tn-node {
  stroke: #fff;
  stroke-width: 2;
}
.mc-anim .mc-tn-sup {
  fill: var(--a-accent);
}
.mc-anim .mc-tn-dem {
  fill: var(--a-opt);
}
.mc-anim .mc-tn-nlabel {
  fill: currentColor;
  font-size: 11px;
  font-weight: 600;
}
.mc-anim .mc-tn-flow {
  fill: currentColor;
  font-size: 10.5px;
}
.mc-anim .mc-tn-flow.mc-tn-zero {
  opacity: 0.4;
}

/* weighted-criteria bars */
.mc-anim .mc-wc-bar {
  fill: var(--a-accent);
  opacity: 0.6;
}
.mc-anim .mc-wc-bar.mc-wc-win {
  fill: var(--a-opt);
  opacity: 0.85;
}
.mc-anim .mc-wc-val {
  fill: currentColor;
  font-size: 11px;
  font-weight: 700;
}
.mc-anim .mc-anim-wc-controls {
  margin-top: 0.5rem;
}

/* cpm-network */
.mc-anim .mc-cpm-edge {
  fill: none;
  stroke: var(--a-line);
  stroke-width: 1.5;
}
.mc-anim .mc-cpm-edge.mc-cpm-crit-edge {
  stroke: var(--a-opt);
  stroke-width: 3;
}
.mc-anim .mc-cpm-box {
  fill: var(--a-surface);
  stroke: var(--a-accent);
  stroke-width: 1.5;
}
.mc-anim .mc-cpm-box.mc-cpm-crit {
  stroke: var(--a-opt);
  stroke-width: 3;
  fill: color-mix(in srgb, var(--a-opt) 12%, transparent);
}
.mc-anim .mc-cpm-id {
  fill: currentColor;
  font-size: 12px;
  font-weight: 700;
}
.mc-anim .mc-cpm-times {
  fill: currentColor;
  font-size: 10.5px;
}

/* venn (addition rule) */
.mc-anim .mc-venn-box {
  fill: var(--a-surface);
  stroke: var(--a-border);
  stroke-width: 1;
}
.mc-anim .mc-venn-a {
  fill: color-mix(in srgb, var(--a-accent) 20%, transparent);
  stroke: var(--a-accent);
  stroke-width: 1.5;
}
.mc-anim .mc-venn-b {
  fill: color-mix(in srgb, var(--a-opt) 20%, transparent);
  stroke: var(--a-opt);
  stroke-width: 1.5;
}
.mc-anim .mc-venn-a.mc-venn-active {
  fill: color-mix(in srgb, var(--a-accent) 42%, transparent);
}
.mc-anim .mc-venn-b.mc-venn-active {
  fill: color-mix(in srgb, var(--a-opt) 42%, transparent);
}
.mc-anim .mc-venn-lens {
  fill: color-mix(in srgb, var(--a-opt) 55%, var(--a-accent));
  stroke: none;
}
.mc-anim .mc-venn-title {
  fill: currentColor;
  font-size: 13px;
  font-weight: 600;
}
.mc-anim .mc-venn-ta {
  fill: var(--a-accent);
}
.mc-anim .mc-venn-tb {
  fill: var(--a-opt);
}
.mc-anim .mc-venn-val {
  fill: currentColor;
  font-size: 13px;
  font-weight: 700;
}
.mc-anim .mc-venn-t {
  fill: currentColor;
  font-size: 10.5px;
  opacity: 0.85;
}

/* utility-curve (risk attitudes) */
.mc-anim .mc-uc-curve {
  fill: none;
  stroke: var(--a-accent);
  stroke-width: 2.5;
}
.mc-anim .mc-uc-chord {
  stroke: var(--a-line);
  stroke-width: 1.5;
  stroke-dasharray: 5 3;
  opacity: 0.7;
}
.mc-anim .mc-uc-pt {
  fill: var(--a-accent);
  stroke: #fff;
  stroke-width: 1.5;
}
.mc-anim .mc-uc-eu {
  fill: var(--a-line);
}
.mc-anim .mc-uc-ev {
  stroke: var(--a-line);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}
.mc-anim .mc-uc-ce {
  stroke: var(--a-opt);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.mc-anim .mc-uc-prem {
  stroke: var(--a-opt);
  stroke-width: 3;
}
.mc-anim .mc-uc-lab {
  fill: currentColor;
  font-size: 10.5px;
}

/* regression (scatter + least-squares) */
.mc-anim .mc-rg-pt {
  fill: var(--a-accent);
  stroke: #fff;
  stroke-width: 1;
}
.mc-anim .mc-rg-line {
  stroke: var(--a-opt);
  stroke-width: 2.5;
}

/* series-forms (Fig 15.1 forms of forecast movement) */
.mc-anim .mc-sf-label {
  fill: currentColor;
  font-size: 12px;
  font-weight: 600;
}
.mc-anim .mc-sf-line {
  fill: none;
  stroke: var(--a-accent);
  stroke-width: 2;
}
.mc-anim .mc-sf-axis {
  stroke: var(--a-line);
  stroke-width: 1;
  opacity: 0.5;
}
