/* Learn, Expected value (web/learn/ev-kit.js and the ev-*.js modules). Study room, colours from tokens only:
   indigo for the simulation, gold for the exact answer (the truth), red for your gut guess. */

.ev-head .lede { max-width: 46rem; }
.ev-sec [hidden] { display: none !important; }   /* the cards use display:flex/grid, which would beat the hidden attribute */
.ev-prereq ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.ev-prereq li { margin: .15rem 0; }
.ev-toc { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 0; }
.ev-toc button { font: inherit; font-size: .82rem; padding: .3rem .65rem; border-radius: 99px; cursor: pointer;
  border: 1px solid rgb(var(--line-rgb) / .28); background: transparent; color: var(--study-ink); }
.ev-toc button:hover { border-color: var(--arcade-accent); color: var(--arcade-accent); }
.ev-sec { scroll-margin-top: calc(var(--ln-top, 0px) + 1rem); }
.ev-sec > p, .ev-sec > ul, .ev-sec > ol { max-width: 46rem; line-height: 1.65; }
.ev-sec > ul, .ev-sec > ol { padding-left: 1.2rem; }
.ev-sec li { margin: .3rem 0; }

/* maths */
.ev-eq { font-family: "Newsreader", Georgia, serif; font-size: 1.2rem; line-height: 1.9; text-align: center; color: var(--head);
  margin: .8rem 0; padding: .2rem 0; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.ev-eq.is-left { text-align: left; }
.ev-eq + .ev-eq { margin-top: -.3rem; }
.ev-m { font-family: "Newsreader", Georgia, serif; font-size: 1.08em; white-space: nowrap; }
.ev-eq i, .ev-m i { font-style: italic; }
.ev-fr { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; text-align: center;
  font-size: .86em; line-height: 1.15; margin: 0 .12em; }
.ev-fr > span:first-child { border-bottom: 1px solid currentColor; padding: 0 .2em .05em; }
.ev-fr > span:last-child { padding: .05em .2em 0; }
.ev-approx { color: var(--arcade-muted); font-weight: 400; font-size: .92em; }

/* notes and tables */
.ev-note { max-width: 46rem; margin: 1rem 0; padding: .75rem 1rem; border-radius: 10px; line-height: 1.6;
  border-left: 3px solid var(--arcade-accent); background: color-mix(in srgb, var(--arcade-accent) 6%, transparent); }
.ev-note p { margin: .3rem 0; }
.ev-note.is-trap { border-left-color: var(--arcade-close); background: color-mix(in srgb, var(--arcade-close) 7%, transparent); }
.ev-note.is-real { border-left-color: var(--qt-teal); background: color-mix(in srgb, var(--qt-teal) 7%, transparent); }
.ev-note-h { font-weight: 700; color: var(--head); margin: 0 0 .2rem !important; }
.ev-tablewrap { overflow-x: auto; margin: .8rem 0; max-width: 100%; }
.ev-table { border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 16rem; }
.ev-table th, .ev-table td { padding: .38rem .7rem; border-bottom: 1px solid rgb(var(--line-rgb) / .18); text-align: right; white-space: nowrap; }
.ev-table th { font-weight: 600; color: var(--arcade-muted); font-size: .8rem; }
.ev-table th:first-child, .ev-table td:first-child { text-align: left; }
.ev-table tr.is-best td { color: var(--head); font-weight: 700; background: color-mix(in srgb, var(--gold-deep) 10%, transparent); }

/* a problem card */
.ev-prob { max-width: 48rem; margin: 1.2rem 0; padding: 1rem 1.15rem 1.1rem; border-radius: 14px;
  border: 1px solid rgb(var(--line-rgb) / .24); background: rgb(var(--hl) / .02); }
.ev-prob-head { display: flex; flex-direction: column; gap: .1rem; }
.ev-kind { font-size: .75rem; font-weight: 600; color: var(--arcade-accent); }
.ev-prob h3 { margin: 0 !important; font-size: 1.08rem; color: var(--head); }
.ev-q { line-height: 1.65; margin: .5rem 0 .2rem; }
.ev-q p { margin: .4rem 0; }
.ev-guess { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: .8rem 0 .2rem; }
.ev-guess label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; color: var(--arcade-muted); flex: 0 1 12rem; }
.ev-guess input { font: inherit; font-size: 1rem; padding: .5rem .65rem; border-radius: 9px; min-width: 0;
  border: 1px solid rgb(var(--line-rgb) / .35); background: var(--study); color: var(--study-ink); font-variant-numeric: tabular-nums; }
.ev-guess input[aria-invalid="true"] { border-color: var(--arcade-miss); }
.ev-locked { margin: .7rem 0 .2rem; font-size: .92rem; }
.ev-gut { color: var(--arcade-miss); font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-steps { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .7rem; }
.ev-steps li { padding: .15rem 0 .15rem .9rem; border-left: 2px solid color-mix(in srgb, var(--arcade-accent) 40%, transparent); }
.ev-step-h { margin: 0 0 .2rem; font-weight: 600; color: var(--head); }
.ev-step-no { display: block; font-size: .72rem; font-weight: 600; color: var(--arcade-faint); }
.ev-step-b { line-height: 1.65; }
.ev-step-b p { margin: .35rem 0; }
.ev-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; }
.ev-ans { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 10px;
  border-left: 3px solid var(--gold-deep); background: color-mix(in srgb, var(--gold-deep) 8%, transparent); }
.ev-ans-line { margin: 0; font-size: 1.05rem; }
.ev-ans-line strong { font-size: 1.2rem; color: var(--head); font-family: "Newsreader", Georgia, serif; }
.ev-ans-k { font-size: .78rem; font-weight: 600; color: var(--gold-soft); margin-right: .3rem; }
.ev-vs { margin: .35rem 0 0; font-size: .92rem; }
.ev-trap { margin: .8rem 0 0; padding-top: .6rem; border-top: 1px solid rgb(var(--line-rgb) / .2); line-height: 1.6; }
.ev-trap p { margin: .3rem 0; }
.ev-trap-h { font-weight: 700; color: var(--arcade-close); margin: 0 0 .1rem !important; font-size: .9rem; }
.ev-sim { margin: .8rem 0 0; }
.ev-sim-read { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .88rem; margin: .3rem 0 0; }
.ev-sim-note { flex-basis: 100%; font-size: .8rem; line-height: 1.5; }
.ev-key i, .ev-legend i { display: inline-block; width: .95rem; height: .22rem; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
i.k-run { background: var(--arcade-accent); } i.k-truth { background: var(--gold-deep); } i.k-gut { background: var(--arcade-miss); }
i.k-alt { background: var(--qt-teal); }

/* mixed practice: name the tool first */
.ev-ask { margin: .8rem 0 .4rem; font-weight: 600; color: var(--head); font-size: .92rem; }
.ev-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ev-chips button { font: inherit; font-size: .84rem; padding: .35rem .7rem; border-radius: 9px; cursor: pointer;
  border: 1px solid rgb(var(--line-rgb) / .3); background: transparent; color: var(--study-ink); }
.ev-chips button:hover:not(:disabled) { border-color: var(--arcade-accent); }
.ev-chips button:disabled { cursor: default; opacity: .6; }
.ev-chips button.is-right { opacity: 1; border-color: var(--arcade-good); color: var(--arcade-good); font-weight: 600; }
.ev-chips button.is-wrong { opacity: 1; border-color: var(--arcade-miss); color: var(--arcade-miss); text-decoration: line-through; }
.ev-tool-say { margin: .6rem 0 0; line-height: 1.6; font-size: .94rem; }

/* explorers */
.ev-lab { max-width: 52rem; margin: 1.2rem 0; padding: 1rem 1.1rem; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--arcade-accent) 28%, transparent); background: color-mix(in srgb, var(--arcade-accent) 3%, transparent); }
.ev-lab-h { margin: 0 0 .5rem; font-weight: 700; color: var(--head); }
.ev-lab .ln-row { margin: .4rem 0; }
.ev-slider { display: flex; align-items: center; gap: .6rem; font-size: .9rem; flex: 1 1 15rem; min-width: 0; }
.ev-slider span { flex: none; color: var(--arcade-muted); }
.ev-slider input { flex: 1; min-width: 5rem; accent-color: var(--arcade-accent); }
.ev-slider output { min-width: 3rem; text-align: right; font-weight: 700; color: var(--head); font-variant-numeric: tabular-nums; }
.ev-field { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; }
.ev-field input { font: inherit; width: 9rem; padding: .4rem .55rem; border-radius: 8px; border: 1px solid rgb(var(--line-rgb) / .3);
  background: var(--study); color: var(--study-ink); text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.ev-out { line-height: 1.65; }
.ev-out p { margin: .4rem 0; }
.ev-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .8rem; color: var(--arcade-muted); margin: .2rem 0 0; }

/* chart marks */
path.k-run { stroke: var(--arcade-accent); stroke-width: 1.8; }
path.k-alt { stroke: var(--qt-teal); stroke-width: 1.8; }
path.k-curve { stroke: var(--gold-deep); stroke-width: 2; }
path.k-faint { stroke: color-mix(in srgb, var(--arcade-accent) 30%, transparent); stroke-width: 1; }
path.k-faint-up { stroke: color-mix(in srgb, var(--arcade-good) 45%, transparent); stroke-width: 1; }
path.k-faint-down { stroke: color-mix(in srgb, var(--arcade-miss) 40%, transparent); stroke-width: 1; }
line.k-truth { stroke: var(--gold-deep); stroke-width: 2; stroke-dasharray: 6 4; }
line.k-gut { stroke: var(--arcade-miss); stroke-width: 2; stroke-dasharray: 3 3; }
line.k-runv { stroke: var(--arcade-accent); stroke-width: 1.5; }
line.k-edge { stroke: rgb(var(--line-rgb) / .6); stroke-width: 1.5; }
.k-truth-t { fill: var(--gold-soft); }
rect.k-hist { fill: color-mix(in srgb, var(--arcade-accent) 62%, transparent); }
rect.k-hist-alt { fill: color-mix(in srgb, var(--qt-teal) 62%, transparent); }
rect.k-gold { fill: color-mix(in srgb, var(--gold-deep) 70%, transparent); }
circle.k-pt { fill: var(--arcade-accent); }
circle.k-pt-gold { fill: var(--gold-deep); }

/* small drawings made by the modules */
.ev-strip { display: block; width: 100%; height: auto; max-width: 48rem; margin: .4rem 0; }
.ev-strip .s-line { stroke: rgb(var(--line-rgb) / .55); stroke-width: 2; }
.ev-strip .s-pt { fill: var(--arcade-accent); }
.ev-strip .s-gap { fill: color-mix(in srgb, var(--arcade-accent) 14%, transparent); }
.ev-strip .s-gap.is-alt { fill: color-mix(in srgb, var(--qt-teal) 16%, transparent); }
.ev-strip text { font: 11px Inter, system-ui, sans-serif; fill: var(--arcade-muted); }
.ev-grid { display: grid; gap: 1px; font-size: .62rem; font-variant-numeric: tabular-nums; overflow-x: auto; max-width: 100%; }
.ev-grid span { display: grid; place-items: center; min-width: 1.05rem; height: 1.05rem; border-radius: 2px; color: var(--arcade-muted); }
.ev-grid .g-go { background: color-mix(in srgb, var(--arcade-accent) 55%, transparent); color: var(--accent-ink); }
.ev-grid .g-stop { background: color-mix(in srgb, var(--gold-deep) 35%, transparent); }
.ev-grid .g-h { background: transparent; font-weight: 600; }
.ev-grid .g-here { outline: 2px solid var(--arcade-miss); outline-offset: -1px; }
.ev-practice { columns: 2 14rem; padding-left: 1.1rem; }
.ev-next { margin: 2rem 0 1rem; }
.ev-missing { color: var(--arcade-miss); }
@media (max-width: 520px) {
  .ev-eq { font-size: 1.05rem; }
  .ev-prob { padding: .85rem .85rem 1rem; }
  .ev-guess label { flex-basis: 100%; }
}
path.k-gut-l { stroke: var(--arcade-miss); stroke-width: 1.6; stroke-dasharray: 4 3; }
/* Risk: capital against risk bars, scenario grid colours. */
.rk-bar { display: inline-block; width: 5rem; height: .55rem; border-radius: 99px; background: rgb(var(--line-rgb) / .25); vertical-align: middle; margin-right: .35rem; overflow: hidden; }
.rk-bar > span { display: block; height: 100%; border-radius: 99px; }
.rk-a { background: var(--arcade-accent); } .rk-b { background: var(--qt-teal); }
.rk-grid td { font-variant-numeric: tabular-nums; }
.rk-bad { color: var(--arcade-miss); font-weight: 600; } .rk-good { color: var(--arcade-good); }
line.k-gut-v { stroke: var(--arcade-miss); stroke-width: 1.5; stroke-dasharray: 4 3; }
