.iv {
  --paper: #fff;
  --field: #f4f5f2;
  --ink: #242a29;
  --dim: #56605e;
  --line: #d3d9d5;
  --rule: #e3e6e2;
  --pass: #216045;
  --hold: #87510a;
  --digits: var(--mono), var(--sans), sans-serif;
  min-width: 0;
  color: var(--ink);
  color-scheme: light;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.iv *, .iv *::before, .iv *::after { box-sizing: border-box }
.iv h2, .iv h3, .iv h4, .iv p, .iv dl, .iv dd, .iv figure { margin: 0 }
.iv h2, .iv h3, .iv h4 { color: var(--ink); font-weight: 650; line-height: 1.3 }
.iv h2 { font-size: clamp(23px, 1.8vw, 32px); letter-spacing: -.025em }
.iv h3 { font-size: clamp(16px, 1.2vw, 22px) }
.iv h4 { font-size: 14px }
.iv small, .iv-dim, .iv-note, .iv-hint { color: var(--dim) }
.iv small { font: 450 .8em var(--sans) }
.iv h3 small, .iv h4 small { margin-left: .6em; font: 500 12px var(--sans) }
.iv button, .iv input { font: inherit }
.iv button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.4;
  cursor: pointer;
}
.iv button:hover:not(:disabled) { filter: none; background: #eef0ed; border-color: #8d9992 }
.iv button:disabled { cursor: default; opacity: .45 }
.iv :focus-visible { outline: 2px solid #414e48; outline-offset: 2px }
.iv svg { flex-shrink: 0 }
.iv-crumb {
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 2;
  min-height: 36px; padding: 3px 18px; border-bottom: 1px solid var(--line);
  background: var(--field); color: var(--dim); font-size: 12px;
}
.iv-crumb button { padding: 3px 1px; border-color: transparent; background: transparent }
.iv-crumb button:hover:not(:disabled), .iv .iv-link:hover { text-decoration: underline }
.iv-crumb strong { color: var(--ink); font-weight: 600 }
.iv-clock { margin-left: auto; font: 12px var(--digits); white-space: nowrap }
.iv-body { max-width: 1800px; padding: 16px clamp(14px, 1.4vw, 26px) 14px; margin: 0 auto }
.iv-sectionhead, .iv-panel-top, .iv-pagination, .iv-footer, .iv-statusline, .iv-switch { display: flex; align-items: center }
.iv-sectionhead { gap: 12px; padding-bottom: 10px }
.iv-index { padding: 3px 7px; color: #434d48; background: var(--field); border: 1px solid var(--line); font: 600 13px var(--digits) }
.iv-headmeta { margin-left: auto; color: var(--dim); font-size: 12px }
.iv-statusline { flex-wrap: wrap; gap: 5px 18px; min-height: 33px; padding: 0 0 10px; color: var(--dim); font-size: 12px }
.iv-statusline strong { font-weight: 600; color: var(--ink) }
.iv-tag, .iv-badge {
  display: inline-flex; align-items: center; gap: .4em; padding: 2px 7px;
  border-radius: 2px; font-size: 11px; font-weight: 550; white-space: nowrap;
  border: 1px solid var(--line); background: #f1f2ef; color: #525a56;
}
.iv-badge.on { border-color: #c2d8c6; color: var(--pass); background: #e7f0e7 }
.iv-badge.warn, .iv-tag.warn { border-color: #e6cea3; color: var(--hold); background: #faf1dd }
.iv .iv-warn-text { color: var(--hold) }
.iv-panel, .iv-estimate, .iv-score { min-width: 0; border: 1px solid var(--line); background: var(--paper) }
.iv-panel-top { justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line) }
.iv-hint { font-size: 12px }
.iv-field { display: flex; align-items: center; gap: 8px; width: min(260px,32%); margin-left: auto; padding: 0 8px; border: 1px solid #b7bfb9; border-radius: 2px; color: var(--dim) }
.iv-field input { width: 100%; min-width: 0; padding: 7px 0; background: transparent; border: 0; color: var(--ink); font-size: 13px }
.iv-field:focus-within { outline: 2px solid #606d65; outline-offset: 1px }
.iv-field input:focus { outline: 0 }
.iv-field input::placeholder { color: #626a64; opacity: 1 }
.iv-filter { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); font-size: 12px; white-space: nowrap }
.iv-filter input, .iv-track input { accent-color: var(--ink) }
.iv-filter input { width: 15px; height: 15px }
.iv-table-wrap { max-width: 100%; overflow: auto; scrollbar-color: #abb3ac transparent }
.iv table { width: 100%; border-collapse: collapse; line-height: 1.45; white-space: nowrap; font-variant-numeric: tabular-nums }
.iv th, .iv td { padding: 9px 15px; text-align: left; font-weight: 450; border: 0; border-bottom: 1px solid var(--rule); vertical-align: middle }
.iv thead th { font: 550 12px var(--sans); color: var(--dim); background: var(--field); border-bottom: 1px solid var(--line) }
.iv tbody tr:last-child > * { border-bottom: none }
.iv tr[data-history-minute]:first-child, .iv-register tbody tr:hover { background: #f6f7f4 }
.iv-register, .iv-readings { table-layout: fixed; min-width: 520px }
.iv-register :is(th,td):nth-child(1) { width: 18% }
.iv-register :is(th,td):nth-child(2) { width: 11% }
.iv-register :is(th,td):nth-child(3) { width: 22% }
.iv-register :is(th,td):nth-child(4) { width: 15% }
.iv-register :is(th,td):nth-child(5) { width: 10% }
.iv :is(.iv-register,.iv-readings) .iv-num,
.iv-register th:nth-child(3), .iv-register th:nth-child(5),
.iv-readings th:nth-child(2), .iv-readings th:nth-child(3) { text-align: right }
.iv-num, .iv-register td:nth-child(4), [data-history-minute] time,
[data-history-minute] td:nth-child(n+3) { font-family: var(--digits); font-size: 14px }
.iv-register td:nth-child(6) { font-size: 12px }
.iv .iv-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); border-color: transparent; background: transparent; padding: 2px 0; font-weight: 650 }
.iv-link svg { width: 12px; height: 12px; color: var(--dim) }
.iv-register .iv-link { font-family: var(--digits); font-size: 14px }
.iv .iv-empty { padding: 25px; text-align: center; color: var(--dim) }
.iv-pagination, .iv-footer { flex-wrap: wrap; gap: 9px; font-size: 12px; color: var(--dim) }
.iv-pagination { border-top: 1px solid var(--line); padding: 7px 15px }
.iv-pagination > span { margin-right: auto }
.iv-pagination b { font: 550 12px var(--digits) }
.iv-footer { justify-content: space-between; margin: 9px 0 12px }
.iv-note { padding: 9px 0; font-size: 12px; line-height: 1.55 }
.iv-note.inset { border-top: 1px solid var(--rule); padding: 8px 15px }
.iv details > summary { cursor: pointer; font-weight: 600; color: var(--ink) }
.iv details[open] > summary { background: var(--field) }
.iv-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, 1fr); gap: 12px }
.iv-readings { min-width: 415px }
.iv-readings th[scope=row] { font-weight: 550 }
.iv-estimate { display: flex; flex-direction: column; padding: 12px 17px; border-top: 2px solid #565f59 }
.iv-big { padding: 7px 0 9px; font: 520 clamp(29px, 2.8vw, 45px)/1.14 var(--digits); color: var(--ink); letter-spacing: -.04em }
.iv-big small, .iv-scored strong small { font: 550 13px var(--sans); letter-spacing: 0 }
.iv-estimate dl { margin-top: auto; border-top: 1px solid var(--line) }
.iv-estimate dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 12px }
.iv-estimate dl div:last-child { border: 0 }
.iv-estimate dt { color: var(--dim) }
.iv-estimate dd { font-weight: 600 }
.iv-score { margin-top: 10px; background: var(--field) }
.iv-score-prompt, .iv-scored { display: flex; align-items: center; gap: 12px; padding: 12px 16px }
.iv-score-prompt p { margin-top: 2px; font-size: 12px; color: var(--dim) }
.iv .iv-action, .iv .iv-quiet { display: inline-flex; align-items: center; gap: 8px }
.iv .iv-action, .iv .iv-action:hover { margin-left: auto; padding: 7px 13px; background: var(--ink); color: #fff; border: 1px solid var(--ink); font-size: 13px }
.iv-scored { align-items: stretch }
.iv-scored > div { flex: 1; padding: 0 12px; border-left: 1px solid var(--line) }
.iv-scored > div:first-child { padding-left: 0; border: 0 }
.iv-kicker { display: block; margin-bottom: 4px; color: var(--dim); font-size: 12px }
.iv-scored strong { color: var(--ink); font: 600 21px var(--digits) }
.iv-budget { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid var(--line); background: var(--field) }
.iv-budget label { font-weight: 550 }
.iv-budget output { font: 600 clamp(22px, 2vw, 32px) var(--digits) }
.iv-track { flex: 1; min-width: 120px }
.iv-track input { width: 100%; margin: 0; display: block; cursor: pointer }
.iv-track > div { position: relative; display: flex; justify-content: space-between; margin-top: 3px; color: var(--dim); font: 11px var(--digits) }
.iv-cut { position: absolute; left: var(--cut); transform: translateX(-50%); color: var(--ink); white-space: nowrap; font: 550 11px var(--sans) }
.iv-cut::before { content: ""; width: 1px; height: 7px; position: absolute; left: 50%; bottom: 100%; background: #7f8a82 }
.iv-threshold { padding-left: 14px; border-left: 1px solid var(--line) }
.iv-threshold span { display: block; color: var(--dim); font-size: 12px }
.iv-threshold strong { font: 600 20px var(--digits) }
.iv-comptable { margin-top: 12px; container-type: inline-size; --plot-width: clamp(156px,15vw,220px) }
.iv-comptable table { table-layout: fixed; min-width: 580px }
.iv-comptable :is(th,td):first-child { width: 29% }
.iv-comptable td:not(:first-child), .iv-comptable th:not(:first-child) { text-align: right }
.iv-comptable td { font: 14px var(--digits) }
.iv-comptable :is(td,th) { padding: 7px 14px }
.iv-comptable tbody th { color: var(--dim); font-size: 12px }
.iv-comptable .iv-reference { background: #f3f5f1 }
.iv-comptable thead .iv-reference { color: var(--ink); background: #e7eae5 }
.iv-comptable .iv-link { font: 550 12px var(--sans) }
.iv-theory-body { display: grid; grid-template-columns: var(--plot-width) minmax(0,1fr) }
@media (min-width: 821px) {
  /* Keep the three strategy columns on the same grid across both tables. */
  .iv-theory-body table :is(th,td):first-child { width: calc(29cqw - var(--plot-width)) }
}
.iv-riskplot { display: flex; flex-direction: column; align-items: stretch; justify-content: center; padding: 6px 12px 4px; border-right: 1px solid var(--line) }
.iv-riskplot figcaption, .iv-riskplot > span { font-size: 10px; color: var(--dim) }
.iv-riskplot > span { text-align: center }
.iv-riskplot svg { width: 100%; max-height: 96px; overflow: visible }
.iv-axis, .iv-limit, .iv-curve { fill: none; vector-effect: non-scaling-stroke }
.iv-axis { stroke: #87918b; stroke-width: 1 }
.iv-limit { stroke: #929c96; stroke-width: 1; stroke-dasharray: 3 3 }
.iv-curve { stroke: #343d37; stroke-width: 1.8 }
.iv-ticks { fill: var(--dim); font: 10px var(--digits) }
.iv-cursor { stroke: white; stroke-width: 1.3 }
.iv-cursor.warn { fill: var(--hold) }
.iv-cursor.on { fill: var(--pass) }
.iv-switch { border: 1px solid var(--line); border-radius: 3px }
.iv-switch button { border: 0; border-radius: 0; font-size: 12px }
.iv-switch button[aria-pressed=true] { background: var(--ink); color: white }
.iv-failures { padding: 12px 16px; border-top: 1px solid var(--line) }
.iv-failbuttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 }
.iv-failbuttons button { display: inline-flex; gap: 7px; align-items: center; font: 13px var(--digits) }
.iv-failures .iv-pagination { padding: 5px 0 0; border: none }
@media (min-width:1001px) {
  #detail { max-height: max(420px, calc(100dvh - 150px)); min-width: 0; overflow: auto }
}
@media (min-width:1500px) and (min-height:880px) {
  .iv-body { padding: 24px 28px }
  .iv-panel-top { padding: 16px 19px }
  .iv th, .iv td { padding-block: 12px }
  .iv-comptable :is(th,td) { padding-block: 10px }
}
@media (max-height:800px) and (min-width:821px) {
  .iv-body { padding: 10px 12px }
  .iv-sectionhead { padding-bottom: 7px }
  .iv-statusline { min-height: 25px; padding-bottom: 7px }
  .iv th, .iv td, .iv-panel-top { padding-block: 6px }
  .iv-budget { padding-block: 8px }
  .iv-comptable { margin-top: 8px }
  .iv-score-prompt, .iv-scored { padding-block: 8px }
}
@media (max-width:820px) {
  .iv-split { grid-template-columns: 1fr }
  .iv-budget { flex-wrap: wrap; gap: 8px 12px }
  .iv-theory-body { grid-template-columns: 1fr }
  .iv-riskplot { width: 210px; border-right: none }
}
@media (max-width:570px) {
  .iv-clock { font-size: 10px; margin-left: auto }
  .iv-sectionhead { flex-wrap: wrap }
  .iv-panel-top { flex-wrap: wrap }
  .iv-field { order: 2; width: 100% }
  .iv-score-prompt, .iv-scored { flex-wrap: wrap }
  .iv-budget .iv-track { flex-basis: 100%; order: 2 }
}
