/* Scoped styles for the Lecture 8 expected-utility explorer. */
.wrl {
  --wrl-ink: #263b34;
  --wrl-muted: #52615a;
  --wrl-line: #c8c1b5;
  --wrl-surface: #fffdf8;
  --wrl-canvas: #f4f0e6;
  --wrl-blue: #4477aa;
  --wrl-risk: #882255;
  --wrl-sure: #228833;
  --wrl-insured: #aa3377;
  --wrl-axis: #000;
  --wrl-selected: #173f32;
  --wrl-selected-ink: #fff;
  color: var(--wrl-ink);
  background: var(--wrl-surface);
  border: 1px solid var(--wrl-line);
  border-radius: 12px;
  margin: 1.4rem 0 2rem;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.5;
}
body.quarto-dark .wrl {
  --wrl-ink: #edf3ee;
  --wrl-muted: #b7c8bf;
  --wrl-line: #52615a;
  --wrl-surface: #182b25;
  --wrl-canvas: #11201b;
  --wrl-blue: #66ccee;
  --wrl-risk: #cc6677;
  --wrl-sure: #76c992;
  --wrl-insured: #d6a4df;
  --wrl-axis: #edf3ee;
  --wrl-selected: #66ccee;
  --wrl-selected-ink: #11201b;
}
.wrl *, .wrl *::before, .wrl *::after { box-sizing: border-box; }
.wrl [hidden] { display: none !important; }
.wrl p { margin: 0 0 .8rem; }
.wrl h4 { color: var(--wrl-ink); font-size: 1.2rem; line-height: 1.3; margin: 0 0 .65rem; }
.wrl-header { display: flex; align-items: flex-start; gap: 1.2rem; padding: 1.4rem 1.5rem 1rem; }
.wrl-header > div { min-width: 0; flex: 1; }
.wrl-header p:last-child { margin-bottom: 0; }
.wrl .wrl-eyebrow { color: var(--wrl-muted); font-size: .875rem; margin-bottom: .5rem; }
.wrl button, .wrl input, .wrl select { font: inherit; }
.wrl button { cursor: pointer; line-height: 1.35; }
.wrl button:focus-visible, .wrl input:focus-visible, .wrl select:focus-visible, .wrl summary:focus-visible, .wrl-panel:focus-visible {
  outline: 3px solid var(--wrl-blue);
  outline-offset: 3px;
}
.wrl-reset, .wrl-quote-presets button {
  background: transparent;
  color: var(--wrl-ink);
  border: 1px solid var(--wrl-line);
  border-radius: 6px;
  padding: .55rem .75rem;
  min-height: 42px;
  font-size: .875rem !important;
}
.wrl-reset { flex: 0 0 auto; }
.wrl-reset:hover, .wrl-quote-presets button:hover { background: var(--wrl-canvas); border-color: var(--wrl-muted); }
.wrl-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--wrl-canvas); border-block: 1px solid var(--wrl-line); }
.wrl-tabs button { display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; text-align: left; border: 0; border-right: 1px solid var(--wrl-line); padding: .85rem .9rem; background: transparent; color: var(--wrl-ink); font-size: .9375rem; min-height: 78px; }
.wrl-tabs button:last-child { border-right: 0; }
.wrl-tabs button > span { font-size: .8125rem; opacity: .85; }
.wrl-tabs button[aria-selected="true"] { background: var(--wrl-selected); color: var(--wrl-selected-ink); font-weight: 650; }
.wrl-tabs button:not([aria-selected="true"]):hover { background: var(--wrl-surface); }
.wrl-panel { padding: 1.4rem 1.5rem; }
.wrl-step-intro { margin-bottom: 1.2rem; }
.wrl-step-intro h4 { font-size: 1.125rem; }
.wrl-scenario { font-weight: 600; }
.wrl .wrl-options p { margin-bottom: .35rem; }
.wrl .wrl-options p:last-child { margin-bottom: 0; }
.wrl-workspace { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 1.2rem; }
.wrl-controls { border-right: 1px solid var(--wrl-line); padding-right: 1.1rem; min-width: 0; }
.wrl-control { margin-bottom: 1.3rem; }
.wrl-control label { display: block; font-size: .9375rem; font-weight: 650; margin-bottom: .35rem; }
.wrl-control output { display: block; font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.wrl-control input[type="range"] { width: 100%; accent-color: var(--wrl-blue); min-height: 36px; margin: .25rem 0 0; cursor: pointer; }
.wrl-range-labels { display: flex; justify-content: space-between; gap: .65rem; font-size: .8125rem; line-height: 1.35; color: var(--wrl-muted); }
.wrl-range-labels > span:last-child { text-align: right; }
.wrl-range-labels strong { display: block; color: var(--wrl-ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.wrl-control select, .wrl-control input[type="number"] { width: 100%; min-height: 44px; background-color: var(--wrl-surface); color: var(--wrl-ink); border: 1px solid var(--wrl-line); border-radius: 5px; padding: .55rem .6rem; }
.wrl-control select { appearance: none; padding-right: 1.7rem; background-image: linear-gradient(45deg, transparent 50%, var(--wrl-muted) 50%), linear-gradient(135deg, var(--wrl-muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.wrl .wrl-control-help { font-size: .875rem; color: var(--wrl-muted); margin: .45rem 0 0; }
.wrl-check { display: flex; gap: .55rem; align-items: flex-start; font-size: .875rem; cursor: pointer; margin-bottom: 1.1rem; }
.wrl-check input { margin-top: .25rem; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--wrl-blue); }
.wrl-quote-presets { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.wrl-quote-presets button { padding: .4rem .55rem; font-size: .875rem !important; }
.wrl-quote-presets button:disabled { opacity: .55; cursor: not-allowed; }
.wrl .wrl-error { margin: .6rem 0 0; font-size: .875rem; color: var(--wrl-risk); font-weight: 600; }
.wrl input[aria-invalid="true"] { border: 2px solid var(--wrl-risk); }
.wrl-visual { min-width: 0; }
.wrl-chart { width: 100%; min-height: 350px; background: var(--wrl-canvas); border-radius: 6px; overflow: hidden; }
.wrl-chart svg { display: block; width: 100%; overflow: visible; }
.wrl-chart svg text { font-family: inherit; }
.wrl .wrl-loading { padding: 1.5rem; color: var(--wrl-muted); }
.wrl .wrl-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem .9rem; list-style: none; padding: 0; margin: .9rem min(16%, 48px) .6rem min(26.6667%, 80px); font-size: .875rem; }
.wrl-legend li { display: flex; flex: 1 1 70px; max-width: 140px; min-width: 0; flex-direction: column; gap: .35rem; align-items: center; text-align: center; line-height: 1.25; }
.wrl-key { display: block; width: 26px; height: 14px; position: relative; }
.wrl-key--utility::before { content: ""; position: absolute; height: 3px; width: 26px; background: var(--wrl-blue); top: 6px; }
.wrl-key--risky::before { content: ""; position: absolute; height: 10px; width: 10px; background: var(--wrl-risk); left: 8px; top: 2px; }
.wrl-key--certain::before { content: ""; position: absolute; height: 12px; width: 12px; border-radius: 50%; border: 3px solid var(--wrl-sure); background: var(--wrl-canvas); left: 7px; top: 1px; }
.wrl-key--insured::before { content: ""; position: absolute; height: 11px; width: 11px; border: 2px solid var(--wrl-insured); background: var(--wrl-canvas); transform: rotate(45deg); left: 8px; top: 2px; }
.wrl .wrl-chart-caption { color: var(--wrl-muted); font-size: .875rem; margin-bottom: 0; }
.wrl-eu { border-top: 1px solid var(--wrl-line); margin-top: 1.3rem; padding-top: 1.2rem; }
.wrl-eu h4 { font-size: 1.1rem; }
.wrl .wrl-eu-equation { display: grid; grid-template-columns: max-content 1.25em minmax(0, 1fr); align-items: baseline; gap: .3rem .35rem; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; margin-bottom: .8rem; }
.wrl-equation-lhs { text-align: right; }
.wrl-equation-operator { text-align: center; }
.wrl .wrl-eu-intro { font-size: .9375rem; margin-bottom: .65rem; }
.wrl .wrl-eu-context { font-size: .9375rem; font-weight: 650; margin-bottom: .5rem; }
.wrl-eu-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: .9rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--wrl-line); }
.wrl-eu-outcome strong, .wrl-eu-outcome > span, .wrl-eu-utility strong { display: block; }
.wrl-eu-outcome > span { font-size: .9375rem; font-variant-numeric: tabular-nums; }
.wrl-eu-label { display: block; color: var(--wrl-muted); font-size: .875rem; margin-bottom: .25rem; }
.wrl-eu-utility strong { font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wrl .wrl-eu-weighted p { font-size: .9375rem; margin-bottom: .45rem; font-variant-numeric: tabular-nums; }
.wrl-eu-weighted strong { font-size: 1.1rem; }
.wrl-eu-track { display: flex; height: 10px; width: 100%; background: var(--wrl-canvas); border: 1px solid var(--wrl-line); border-radius: 3px; overflow: hidden; }
.wrl-eu-fill { display: block; height: 100%; }
.wrl-eu-fill--high { background: var(--wrl-blue); }
.wrl-eu-fill--low, .wrl-eu-fill--total { background: var(--wrl-risk); }
.wrl-eu-total { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: .4rem .9rem; align-items: center; padding: .9rem 0 .5rem; }
.wrl-eu-total > span { font-size: .9375rem; }
.wrl-eu-total strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.wrl-eu-total .wrl-eu-track { grid-column: 2; }
.wrl .wrl-eu-note { font-size: .875rem; color: var(--wrl-muted); margin: .4rem 0 0; }
.wrl .wrl-eu-insured { font-size: .9375rem; margin: .85rem 0 0; padding-top: .75rem; border-top: 1px solid var(--wrl-line); }
.wrl-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.3rem; border-top: 1px solid var(--wrl-line); }
.wrl-metric { padding: .85rem .75rem .8rem 0; min-width: 0; }
.wrl-metric > span { display: block; font-size: .875rem; color: var(--wrl-muted); }
.wrl-metric strong { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.wrl-metric small { display: block; font-size: .8125rem; color: var(--wrl-muted); }
.wrl-explanation { border-top: 1px solid var(--wrl-line); padding-top: 1rem; }
.wrl .wrl-takeaway { font-weight: 650; }
.wrl .wrl-formula { font-size: .9375rem; overflow-wrap: anywhere; }
.wrl .wrl-decision { font-size: 1.35rem; line-height: 1.35; font-weight: 700; text-align: center; margin: 1.1rem 0 0; }
.wrl .wrl-payment-note { font-size: .9375rem; font-weight: 600; margin: .7rem 0 0; }
.wrl-assumptions { padding: 1rem 1.5rem; border-top: 1px solid var(--wrl-line); font-size: .9375rem; }
.wrl-assumptions summary { font-weight: 650; cursor: pointer; }
.wrl-assumptions[open] summary { margin-bottom: .8rem; }
.wrl-assumptions p:last-child { margin-bottom: 0; }
.wrl noscript p { padding: 1rem 1.5rem; }
@media (max-width: 1050px) {
  .wrl-workspace { grid-template-columns: 190px minmax(0, 1fr); gap: 1rem; }
  .wrl-panel, .wrl-header, .wrl-assumptions { padding-inline: 1rem; }
}
@media (max-width: 720px) {
  .wrl-workspace { grid-template-columns: minmax(0, 1fr); }
  .wrl-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; border-right: 0; border-bottom: 1px solid var(--wrl-line); padding: 0 0 1rem; }
  .wrl-control { margin-bottom: .6rem; }
  .wrl-controls > [data-wrl-visible="quote"] { grid-column: 1 / -1; }
  .wrl-check { grid-column: 1 / -1; }
  .wrl-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrl-tabs button { min-height: 70px; }
  .wrl-tabs button:nth-child(2) { border-right: 0; }
  .wrl-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--wrl-line); }
  .wrl-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrl-eu-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .9rem; }
  .wrl-eu-weighted { grid-column: 1 / -1; }
  .wrl-eu-total { grid-template-columns: minmax(0, 1fr); }
  .wrl-eu-total .wrl-eu-track { grid-column: 1; }
}
@media (max-width: 430px) {
  .wrl-header { flex-wrap: wrap; }
  .wrl-reset { min-height: 40px; }
  .wrl-controls { grid-template-columns: minmax(0, 1fr); }
  .wrl-metric strong { font-size: 1.1rem; }
  .wrl-tabs button { padding: .75rem .65rem; }
}
@media print { .wrl { display: none; } }
