/* intelligence-trends.css — 智力变化趋势 (.itr). Scoped; tokens mirror the approved V2 overview
   (home-overview.css): near-black, fluorescent green, mono tabular figures. Dark is the default,
   html[data-theme="light"] selects light. Layout follows the component's own width (container
   "itr"), not the viewport.
   Ticket 299 · multi-line chart. Eight line slots, each bound to one pick for as long as it stays
   selected; slots 5–8 are also dashed. Validated with the dataviz palette checker
   (scripts/validate_palette.js, OKLab ΔE×100, all pairs inside each group of four):
     dark  #39ff88 #6aa8ff #ff6ec7 #ffb02e | #b39bff #ff6b5b #3fd0e0 #eef2ef on #09110c
           CVD ≥ 8.6 / 8.1, normal ≥ 24.3 / 18.7, contrast ≥ 3:1 (all 8); lightness-band check
           fails by design — the neon green is the site's brand accent and the set is neon-on-black;
     light #087a40 #1f62c9 #c2338f #cf7f00 | #7a5be0 #d03a2a #00838f #3d434a on #fbfdfa
           CVD ≥ 9.7 / 12.6, normal ≥ 24.4 / 19.7, contrast ≥ 3:1 (all 8); #3d434a sits below the
           lightness band on purpose (a neutral ink line).
   Cross-group look-alikes (e.g. pink/red, green/cyan) are separated by the dash, the legend row,
   the direct label and the batch readout — identity is never colour alone. */

.itr {
  --itr-sans: var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif);
  --itr-mono: var(--font-mono, "JetBrains Mono", "SF Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace);
  --itr-r: 4px;
  --itr-hit: 36px;
  color-scheme: dark;
  --itr-bg: #050806;
  --itr-surface: #09110c; --itr-surface-2: #0c1610; --itr-surface-3: #112019; --itr-sunken: #040705;
  --itr-line: #193a29; --itr-line-2: #2a5a40; --itr-line-soft: #10251a;
  --itr-text: #ddeae1; --itr-text-2: #a2b8aa; --itr-text-3: #6f8a79;
  --itr-accent: #39ff88; --itr-accent-2: #22c76a; --itr-accent-strong: #8dffbf;
  --itr-accent-soft: rgba(57, 255, 136, .08); --itr-accent-line: rgba(57, 255, 136, .34);
  --itr-gap: rgba(162, 184, 170, .055);
  --itr-warn: #f2c14e; --itr-focus: #39ff88;
  --itr-s0: #39ff88; --itr-s1: #6aa8ff; --itr-s2: #ff6ec7; --itr-s3: #ffb02e;
  --itr-s4: #b39bff; --itr-s5: #ff6b5b; --itr-s6: #3fd0e0; --itr-s7: #eef2ef;
  --itr-dash: 6 4;
}
html[data-theme="light"] .itr {
  color-scheme: light;
  --itr-bg: #f3f6f2;
  --itr-surface: #fbfdfa; --itr-surface-2: #f3f7f3; --itr-surface-3: #e3ebe4; --itr-sunken: #e8efe9;
  --itr-line: #cfdfd3; --itr-line-2: #a7c2af; --itr-line-soft: #e0eae2;
  --itr-text: #0e1c14; --itr-text-2: #3b5345; --itr-text-3: #5b7264;
  --itr-accent: #087a40; --itr-accent-2: #0b8f4c; --itr-accent-strong: #055a2f;
  --itr-accent-soft: rgba(8, 122, 64, .07); --itr-accent-line: rgba(8, 122, 64, .32);
  --itr-gap: rgba(59, 83, 69, .06);
  --itr-warn: #9a5b00; --itr-focus: #087a40;
  --itr-s0: #087a40; --itr-s1: #1f62c9; --itr-s2: #c2338f; --itr-s3: #cf7f00;
  --itr-s4: #7a5be0; --itr-s5: #d03a2a; --itr-s6: #00838f; --itr-s7: #3d434a;
}
@media (pointer: coarse) { .itr { --itr-hit: 44px; } }
.itr .itr-c0 { --c: var(--itr-s0); } .itr .itr-c1 { --c: var(--itr-s1); } .itr .itr-c2 { --c: var(--itr-s2); } .itr .itr-c3 { --c: var(--itr-s3); }
.itr .itr-c4 { --c: var(--itr-s4); } .itr .itr-c5 { --c: var(--itr-s5); } .itr .itr-c6 { --c: var(--itr-s6); } .itr .itr-c7 { --c: var(--itr-s7); }

.itr { container: itr / inline-size; display: block; min-width: 0; color: var(--itr-text); background: var(--itr-bg); font: 400 14px/1.5 var(--itr-sans); }
/* --itr-bg equals the site page colour in each theme, so on the site it is invisible; it keeps
   the component legible if a host page does not switch its own background with data-theme. */
.itr *, .itr *::before, .itr *::after { box-sizing: border-box; }
.itr [hidden] { display: none !important; }
.itr p { margin: 0; }
.itr button, .itr select, .itr input { font: inherit; color: inherit; touch-action: manipulation; }
.itr button { cursor: pointer; }
.itr :focus-visible { outline: 2px solid var(--itr-focus); outline-offset: 2px; }
.itr .is-mono { font-family: var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr .is-break { overflow-wrap: anywhere; }
.itr-sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.itr-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); background: transparent; color: var(--itr-accent); font: 500 12px/1.2 var(--itr-sans); white-space: nowrap; }
.itr-btn:hover { border-color: var(--itr-line-2); }
@media (pointer: coarse) { .itr-btn { min-height: 44px; } }

/* line key: a short stroke of the line colour (dashed for slots 5–8) */
.itr-sw { display: inline-block; flex: none; width: 16px; height: 2.5px; border-radius: 1px; background: var(--c, var(--itr-text-3)); }
.itr .is-dash .itr-sw, .itr .is-dash > .itr-lr-t .itr-sw { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }

/* ── head ── */
.itr-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.itr-title-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.itr-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }

/* non-default task set notice */
.itr-vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; padding: 6px 6px 6px 10px; border-left: 2px solid var(--itr-warn); background: var(--itr-surface-2); color: var(--itr-text-2); font-size: 12.5px; line-height: 1.55; }
.itr-vbar p { flex: 1 1 260px; min-width: 0; }
.itr-vbar .itr-btn { min-height: var(--itr-hit); }

/* ── card ── */
.itr-focus { min-width: 0; margin-top: 12px; padding: 12px 16px 10px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); background: var(--itr-surface); scroll-margin-top: calc(var(--nav-h, 48px) + 8px); }

/* toolbar: pick button · x range · y scale */
.itr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.itr-bar-r { display: flex; flex-wrap: wrap; gap: 6px; }
.itr-add { display: inline-flex; align-items: center; gap: 8px; min-height: var(--itr-hit); padding: 0 12px 0 10px; border: 1px solid var(--itr-line-2); border-radius: var(--itr-r); background: var(--itr-surface-2); color: var(--itr-text); font: 600 13px/1.2 var(--itr-sans); white-space: nowrap; }
.itr-add:hover { border-color: var(--itr-accent-line); }
.itr-add[aria-expanded="true"] { border-color: var(--itr-accent); box-shadow: inset 0 0 0 1px var(--itr-accent-line); }
.itr-add-i { position: relative; width: 10px; height: 10px; flex: none; }
.itr-add-i::before, .itr-add-i::after { content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 2px; border-radius: 1px; background: var(--itr-accent); transition: transform .14s ease; }
.itr-add-i::after { transform: rotate(90deg); }
.itr-add[aria-expanded="true"] .itr-add-i::after { transform: rotate(0deg); }
.itr-add-n { color: var(--itr-text-3); font: 500 11.5px/1 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-seg { display: inline-flex; border: 1px solid var(--itr-line); border-radius: var(--itr-r); overflow: hidden; }
.itr-seg button { min-height: var(--itr-hit); padding: 0 10px; border: 0; background: transparent; color: var(--itr-text-2); font-size: 12px; white-space: nowrap; }
.itr-seg button + button { border-left: 1px solid var(--itr-line); }
.itr-seg button:hover { color: var(--itr-text); }
.itr-seg button[aria-pressed="true"] { background: var(--itr-accent-soft); color: var(--itr-accent-strong); font-weight: 600; }
html[data-theme="light"] .itr-seg button[aria-pressed="true"] { color: var(--itr-accent); }
.itr-seg button:focus-visible { outline-offset: -3px; }

/* picker */
.itr-picker { margin-top: 10px; padding: 10px; border: 1px solid var(--itr-line-soft); border-radius: var(--itr-r); background: var(--itr-surface-2); }
.itr-pk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.itr-search { flex: 1 1 220px; min-width: 0; min-height: var(--itr-hit); padding: 0 10px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); background: var(--itr-surface); color: var(--itr-text); font: 13px/1.2 var(--itr-mono); }
.itr-search::placeholder { color: var(--itr-text-3); }
.itr-search:focus-visible { outline-offset: 0; border-color: var(--itr-accent-line); }
.itr-pk-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.itr-pk-count { margin-right: 4px; color: var(--itr-text-3); font: 11.5px/1 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-pk-note { min-height: 0; margin-top: 6px !important; color: var(--itr-warn); font-size: 12px; }
.itr-pk-note:empty { display: none; }
.itr-pk-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 18px; margin-top: 10px; }
.itr-pk-g { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 4px 10px; min-width: 0; }
.itr-pk-m { color: var(--itr-text); font: 600 12.5px/1.25 var(--itr-mono); overflow-wrap: anywhere; }
.itr-pk-e { display: flex; flex-wrap: wrap; gap: 4px; }
.itr-pk-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 64px; min-height: var(--itr-hit); padding: 0 9px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); background: transparent; color: var(--itr-text-2); font: 500 12px/1 var(--itr-mono); white-space: nowrap; }
.itr-pk-b .itr-sw { width: 12px; background: var(--itr-line-2); opacity: .55; }
.itr-pk-b:hover { border-color: var(--itr-line-2); color: var(--itr-text); }
.itr-pk-b[aria-pressed="true"] { border-color: var(--c); background: var(--itr-surface-3); color: var(--itr-text); font-weight: 700; box-shadow: inset 0 0 0 1px var(--c); }
.itr-pk-b[aria-pressed="true"] .itr-sw { background: var(--c); opacity: 1; }
.itr-pk-b.is-dash[aria-pressed="true"] .itr-sw { background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 6px); }
.itr-pk-b[aria-disabled="true"] { border-style: dashed; color: var(--itr-text-3); cursor: not-allowed; }
@container itr (min-width: 900px) { .itr-pk-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* readout: viewed batch + legend rows (value leads, comparable change follows) */
.itr-ro { margin-top: 10px; }
.itr-ro-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 24px; color: var(--itr-text-2); font: 11.5px/1.5 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr[data-scrubbing] .itr-ro-when { color: var(--itr-accent); }
.itr-ro-tag { padding: 0 6px; border: 1px solid var(--itr-line); border-radius: 3px; color: var(--itr-text-3); font-size: 10.5px; line-height: 17px; cursor: help; }
.itr-back { min-height: 28px; }
.itr-lgd { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.itr-lr { display: inline-flex; align-items: stretch; min-width: 0; border: 1px solid var(--itr-line-soft); border-radius: var(--itr-r); background: var(--itr-surface-2); transition: border-color .12s ease, background-color .12s ease, opacity .12s ease; }
.itr-lr.is-hot { border-color: var(--c); background: var(--itr-surface-3); }
.itr-lr-t { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: var(--itr-hit); padding: 0 6px 0 10px; border: 0; border-radius: var(--itr-r) 0 0 var(--itr-r); background: transparent; text-align: left; }
.itr-lr-t:focus-visible { outline-offset: -2px; }
.itr-lr-n { min-width: 0; color: var(--itr-text-2); font: 600 12px/1.2 var(--itr-mono); white-space: nowrap; }
.itr-lr-v { min-width: 6ch; color: var(--itr-text); font: 700 14px/1 var(--itr-mono); font-variant-numeric: tabular-nums; text-align: right; }
.itr-lr-v.is-missing { color: var(--itr-text-3); font-size: 12px; font-weight: 500; }
.itr-lr-d { min-width: 3.4em; color: var(--itr-text-3); font: 500 11px/1 var(--itr-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.itr-lr-d[data-kind="delta"] { color: var(--itr-text-2); }
.itr-lr-x { display: inline-grid; place-items: center; width: 30px; min-height: var(--itr-hit); padding: 0; border: 0; border-left: 1px solid var(--itr-line-soft); border-radius: 0 var(--itr-r) var(--itr-r) 0; background: transparent; color: var(--itr-text-3); font-size: 16px; line-height: 1; }
.itr-lr-x:hover { color: var(--itr-text); background: var(--itr-surface-3); }
.itr-lr-x:focus-visible { outline-offset: -2px; }
.itr-lr.is-off .itr-lr-t > :not(.itr-sw) { opacity: .45; }
.itr-lr.is-off .itr-sw { background: transparent !important; box-shadow: inset 0 0 0 1px var(--itr-line-2); }
.itr-lr.is-off .itr-lr-n { text-decoration: line-through; text-decoration-color: var(--itr-text-3); }
.itr-lr.is-na { border-style: dashed; }
.itr-lr.is-na .itr-lr-v { color: var(--itr-text-3); }
@media (pointer: coarse) { .itr-lr-x { width: 44px; } }
.itr-none { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 6px; padding: 10px; border: 1px dashed var(--itr-line-2); border-radius: var(--itr-r); color: var(--itr-text-2); font-size: 12.5px; }
.itr-none p { flex: 1 1 100%; }

/* chart: full card width, one y-axis */
.itr-chart { min-width: 0; margin-top: 8px; }
.itr-plot { position: relative; border-radius: var(--itr-r); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.itr-plot:focus-visible { outline-offset: 3px; }
.itr-svg { display: block; overflow: visible; font-family: var(--itr-mono); }
.itr-gap { fill: var(--itr-gap); }
.itr-runline { fill: none; stroke: var(--itr-line-2); stroke-width: 1; }
.itr-runlab { fill: var(--itr-text-2); font-size: 10.5px; font-weight: 600; }
.itr-runlab.is-unverified { fill: var(--itr-text-3); font-weight: 500; }
.itr-grid { fill: none; stroke: var(--itr-line-soft); stroke-width: 1; shape-rendering: crispEdges; }
.itr-grid.is-max { stroke: var(--itr-line); }
.itr-base { fill: none; stroke: var(--itr-line); stroke-width: 1; shape-rendering: crispEdges; }
.itr-ytick, .itr-xlab { fill: var(--itr-text-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.itr-xlab:not(.is-time) { fill: var(--itr-text-2); }
.itr-xlab.is-on { fill: var(--itr-text); font-weight: 700; }
.itr-xtick { stroke: var(--itr-line); stroke-width: 1; shape-rendering: crispEdges; }
.itr-ln { transition: opacity .12s ease; }
.itr-lpath { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.itr-ln.is-dash .itr-lpath { stroke-dasharray: var(--itr-dash); stroke-linecap: butt; }
.itr-dot { fill: var(--c); stroke: var(--itr-surface); stroke-width: 1.5; }
.itr-dot.is-iso { fill: var(--itr-surface); stroke: var(--c); stroke-width: 2; }
.itr-plot.has-hot .itr-ln:not(.is-hot) { opacity: .2; }
.itr-ln.is-hot .itr-lpath { stroke-width: 3; }
.itr-endkey { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linecap: round; }
.itr-endkey.is-dash { stroke-dasharray: 4 3; stroke-linecap: butt; }
.itr-endlab { fill: var(--itr-text-2); font-size: 11px; font-weight: 600; }
.itr-msg { fill: var(--itr-text-3); font: 12.5px var(--itr-sans); }
.itr-cross { stroke: var(--itr-text-3); stroke-width: 1; stroke-dasharray: 2 3; shape-rendering: crispEdges; }
.itr-ring { fill: var(--itr-surface); stroke: var(--c); stroke-width: 2; }
.itr-ring.is-hot { stroke-width: 2.75; }
.itr-hint { display: none; margin-top: 4px !important; color: var(--itr-text-3); font-size: 10.5px; line-height: 1.5; }
.itr-plot:focus-visible ~ .itr-hint { display: block; }
.itr-cap2 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-top: 2px !important; color: var(--itr-text-3); font: 10.5px/1.6 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-cap-y { color: var(--itr-text-2); }

/* floating batch readout (mouse/keyboard on wide plots; pointer-events none, never resting) */
.itr-tip { position: absolute; left: 0; top: 0; z-index: 2; min-width: 168px; max-width: 280px; padding: 7px 9px 6px; border: 1px solid var(--itr-line-2); border-radius: var(--itr-r); background: var(--itr-surface); background: color-mix(in srgb, var(--itr-surface) 94%, transparent); box-shadow: 0 6px 18px rgba(0, 0, 0, .28); pointer-events: none; font: 11.5px/1.45 var(--itr-mono); font-variant-numeric: tabular-nums; }
html[data-theme="light"] .itr-tip { box-shadow: 0 6px 18px rgba(14, 28, 20, .12); }
.itr-tip-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 4px !important; }
.itr-tip-h b { color: var(--itr-text); }
.itr-tip-h span { color: var(--itr-text-3); font-size: 10.5px; }
.itr-tip ul { display: grid; grid-template-columns: 16px auto auto minmax(0, 1fr); align-items: center; gap: 2px 7px; margin: 0; padding: 0; list-style: none; }
.itr-tip li { display: contents; }
.itr-tip li b { color: var(--itr-text); font-weight: 700; text-align: right; }
.itr-tip li b.is-missing { color: var(--itr-text-3); font-weight: 500; }
.itr-tip li small { color: var(--itr-text-3); font-size: 10.5px; }
.itr-tip li span { min-width: 0; color: var(--itr-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itr-tip li.is-hot span { color: var(--itr-text); font-weight: 700; }

/* small disclosure inside the card (batch details and sources) */
.itr-mini { margin-top: 6px; }
.itr-mini > summary { display: flex; align-items: center; gap: 6px; width: fit-content; min-height: 32px; color: var(--itr-text-3); font-size: 12px; cursor: pointer; list-style: none; }
.itr-mini > summary::-webkit-details-marker { display: none; }
.itr-mini > summary::before { content: ""; flex: none; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s ease; }
.itr-mini[open] > summary::before { transform: rotate(90deg); }
.itr-mini > summary:hover { color: var(--itr-text-2); }
.itr-mini > .itr-sec-b { display: grid; gap: 6px; padding: 4px 0 4px; }
@media (pointer: coarse) { .itr-mini > summary { min-height: 44px; } }
.itr-now-s { color: var(--itr-text-2); font: 11.5px/1.55 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-now-s b { color: var(--itr-text); font-weight: 600; }
.itr-now-n p { color: var(--itr-text-3); font-size: 11.5px; line-height: 1.55; }
.itr-now-n:empty { display: none; }
.itr-pd { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; padding: 6px 8px; border: 1px solid var(--itr-line-soft); border-radius: var(--itr-r); background: var(--itr-surface-2); font-size: 11.5px; line-height: 1.5; }
.itr-pd dt { color: var(--itr-text-3); white-space: nowrap; }
.itr-pd dd { margin: 0; min-width: 0; color: var(--itr-text); }
.itr-pd-note { display: block; color: var(--itr-text-3); font-size: 10.5px; }
.itr-dset-k { color: var(--itr-text-3); font-size: 11.5px; }
.itr-dset { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 11.5px; line-height: 1.5; }
.itr-dset li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.itr-dset-n { min-width: 9em; color: var(--itr-text-2); font: 600 11.5px var(--itr-mono); }
.itr-link { color: var(--itr-accent); text-decoration: none; overflow-wrap: anywhere; }
.itr-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.itr-sha { color: var(--itr-text-3); font: 10.5px var(--itr-mono); }
.itr-src-x { display: block; margin-top: 2px; font-size: 11px; }
.itr-lg { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; padding: 0; list-style: none; color: var(--itr-text-3); font: 10.5px/1.6 var(--itr-mono); }
.itr-lg li { display: inline-flex; align-items: center; gap: 5px; }
.itr-lg i { display: inline-block; flex: none; }
.itr-lg-line { width: 16px; height: 0; border-top: 2px solid var(--itr-text-2); }
.itr-lg-iso { width: 9px; height: 9px; border: 2px solid var(--itr-text-2); border-radius: 50%; }
.itr-lg-gap { width: 9px; height: 12px; background: var(--itr-gap); box-shadow: inset 0 0 0 1px var(--itr-line-soft); }
.itr-lg-dash { width: 16px; height: 0; border-top: 2px dashed var(--itr-text-2); }

/* ── collapsed sections below the card ── */
.itr-more { margin-top: 10px; }
.itr-more > .itr-sec { border-top: 1px solid var(--itr-line-soft); }
.itr-more > .itr-sec:last-child { border-bottom: 1px solid var(--itr-line-soft); }
.itr-more > .itr-sec > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; min-height: 44px; padding: 6px 2px 6px 0; color: var(--itr-text-2); font-size: 13px; cursor: pointer; list-style: none; }
.itr-more > .itr-sec > summary::-webkit-details-marker { display: none; }
.itr-more > .itr-sec > summary::before { content: ""; flex: none; width: 0; height: 0; margin: 0 2px 0 4px; border-left: 5px solid var(--itr-text-3); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s ease; }
.itr-more > .itr-sec[open] > summary::before { transform: rotate(90deg); }
.itr-more > .itr-sec > summary:hover { color: var(--itr-text); }
.itr-more > .itr-sec[open] > summary { color: var(--itr-text); }
.itr-sec-t { min-width: 0; }
.itr-sec-m { color: var(--itr-text-3); font: 11.5px/1.4 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-more > .itr-sec > .itr-sec-b { padding: 2px 0 14px; }

/* matrix (small multiples: one sparkline per model × effort) */
.itr-cap-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-bottom: 6px; font: 11.5px/1.5 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-cap { color: var(--itr-text-2); }
.itr[data-scrubbing] .itr-cap { color: var(--itr-accent); }
.itr-cap-y { color: var(--itr-text-3); }
.itr-cap-note { margin: -2px 0 6px !important; color: var(--itr-text-3); font: 11px/1.5 var(--itr-mono); }
.itr-cap-note:empty { display: none; }
.itr-matrix { --itr-name: 120px; min-width: 0; }
.itr-mrow { display: grid; grid-template-columns: var(--itr-name) repeat(var(--itr-cols, 6), minmax(0, 1fr)); gap: 4px; align-items: stretch; }
.itr-mrow + .itr-mrow { margin-top: 4px; }
.itr-mhead { margin-bottom: 2px; color: var(--itr-text-3); font: 500 10.5px/1.6 var(--itr-mono); letter-spacing: .04em; }
.itr-mhead > span { padding: 0 2px; text-align: center; }
.itr-mhead > .itr-mname { text-align: left; }
.itr-mname { display: flex; align-items: center; min-width: 0; padding-right: 6px; font: 600 12.5px/1.25 var(--itr-mono); color: var(--itr-text); overflow-wrap: anywhere; }
.itr-mcell { display: block; min-width: 0; }
.itr-cell {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 26px; align-items: baseline; column-gap: 4px;
  width: 100%; height: 100%; min-height: 58px; margin: 0; padding: 5px 7px 4px; overflow: hidden;
  border: 1px solid var(--itr-line-soft); border-radius: var(--itr-r); background: var(--itr-surface-2); color: var(--itr-text); text-align: left;
  transition: border-color .12s ease, background-color .12s ease;
}
button.itr-cell:hover { border-color: var(--itr-line-2); }
button.itr-cell[aria-pressed="true"] { border-color: var(--c, var(--itr-accent)); background: var(--itr-surface-3); box-shadow: inset 0 0 0 1px var(--c, var(--itr-accent)); }
button.itr-cell[aria-pressed="true"] .itr-cell-e { display: block; }
.itr-cell-e { display: none; grid-column: 1 / -1; color: var(--itr-text-3); font: 500 10px/1.4 var(--itr-mono); letter-spacing: .04em; }
.itr-cell-v { min-width: 0; font: 700 15px/1.15 var(--itr-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.itr-cell.is-missing .itr-cell-v { color: var(--itr-text-3); font-weight: 500; }
.itr-cell-d { font: 500 10px/1 var(--itr-mono); font-variant-numeric: tabular-nums; color: var(--itr-text-3); white-space: nowrap; text-align: right; }
.itr-spark { grid-column: 1 / -1; align-self: end; display: block; width: 100%; height: 26px; overflow: visible; }
.itr-sline { fill: none; stroke: var(--itr-accent-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.itr-sdot { fill: none; stroke: var(--itr-accent-2); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.itr-scur { fill: none; stroke: var(--itr-accent-strong); stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.itr-sgap { fill: none; stroke: var(--itr-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
button.itr-cell[aria-pressed="true"] :is(.itr-sline, .itr-sdot) { stroke: var(--c, var(--itr-accent)); }
.itr-cell.is-na { display: flex; flex-direction: column; justify-content: center; gap: 2px; border-color: transparent; background: transparent; box-shadow: inset 0 0 0 1px var(--itr-line-soft); }
.itr-na { color: var(--itr-text-3); font: 11px/1.3 var(--itr-mono); text-align: center; }

/* task sets */
.itr-views-row { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.itr-views-solo { margin-bottom: 10px; }
.itr-view { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 44px; padding: 4px 10px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); background: transparent; color: var(--itr-text-2); text-align: left; }
.itr-view b { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.itr-view small { color: var(--itr-text-3); font: 10.5px/1.3 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-view:hover { border-color: var(--itr-line-2); color: var(--itr-text); }
.itr-view[aria-pressed="true"] { border-color: var(--itr-accent-line); background: var(--itr-accent-soft); color: var(--itr-text); box-shadow: inset 0 0 0 1px var(--itr-accent-line); }
.itr-view[aria-pressed="true"] b { color: var(--itr-accent-strong); }
html[data-theme="light"] .itr-view[aria-pressed="true"] b { color: var(--itr-accent); }
.itr-view[aria-pressed="true"] small { color: var(--itr-text-2); }

/* explanations: rules, bases, batches, fingerprints, exclusions */
.itr-rules { color: var(--itr-text-2); font-size: 12.5px; line-height: 1.65; }
.itr-span { margin-top: 4px !important; color: var(--itr-text-3); font: 11.5px/1.5 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-vnote { margin-top: 8px !important; padding: 6px 10px; border-left: 2px solid var(--itr-accent-line); background: var(--itr-surface-2); color: var(--itr-text-2); font-size: 12px; line-height: 1.6; }
.itr-sub { margin: 14px 0 0; color: var(--itr-text-3); font: 600 11.5px/1.4 var(--itr-sans); letter-spacing: .02em; }
.itr-groups { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.itr-group { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 26px; padding: 2px 9px 2px 3px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); background: var(--itr-surface-2); font: 11.5px/1.35 var(--itr-mono); color: var(--itr-text-2); }
.itr-group-l { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 3px; background: var(--itr-accent-soft); color: var(--itr-accent); font-weight: 700; }
.itr-group-t { color: var(--itr-text); }
.itr-group-j, .itr-group-n { color: var(--itr-text-3); }
.itr-group-note { color: var(--itr-text-2); }
.itr-group.is-unverified .itr-group-l { background: transparent; color: var(--itr-text-3); box-shadow: inset 0 0 0 1px var(--itr-line-2); }
.itr-badge { padding: 0 5px; border: 1px solid var(--itr-warn); border-radius: 3px; color: var(--itr-warn); font-size: 10.5px; line-height: 16px; }
.itr-tbl-scroll { margin-top: 6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--itr-line) transparent; }
.itr-tbl { width: 100%; border-collapse: collapse; font: 11.5px/1.35 var(--itr-mono); font-variant-numeric: tabular-nums; }
.itr-tbl th, .itr-tbl td { padding: 5px 7px; border-bottom: 1px solid var(--itr-line-soft); text-align: left; vertical-align: top; white-space: nowrap; }
.itr-tbl thead th { color: var(--itr-text-3); font-weight: 500; }
.itr-tbl .is-wrap { white-space: normal; min-width: 160px; }
.itr-basis { display: block; color: var(--itr-text-3); font-size: 10.5px; }
.itr-data td { text-align: right; }
.itr-data tbody th { position: sticky; left: 0; z-index: 1; background: var(--itr-bg); color: var(--itr-text); font-weight: 600; }
.itr-data thead tr:last-child th { text-align: right; }
.itr-data thead tr:last-child th:first-child { position: sticky; left: 0; z-index: 1; background: var(--itr-bg); text-align: left; }
.itr-tbl-run { text-align: center !important; color: var(--itr-text-2) !important; border-bottom-color: var(--itr-line-2) !important; }
.itr-tbl-run.is-unverified { color: var(--itr-warn) !important; }
.itr-tbl-corner { border-bottom: 0 !important; }
.itr-data td.is-missing { color: var(--itr-text-3); }
.itr-tbl-note { margin-left: 2px; color: var(--itr-warn); }
.itr-tbl-notes, .itr-excluded { margin: 6px 0 0; padding: 0 0 0 2px; list-style: none; color: var(--itr-text-2); font-size: 11.5px; line-height: 1.6; }
.itr-fps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 6px; }
.itr-fp { padding: 8px 10px; border: 1px solid var(--itr-line-soft); border-radius: var(--itr-r); background: var(--itr-surface-2); font-size: 11.5px; }
.itr-fp.is-unverified { border-color: color-mix(in srgb, var(--itr-warn) 45%, transparent); }
.itr-fp p { color: var(--itr-text-2); }
.itr-fp dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 6px 0 0; }
.itr-fp dt { color: var(--itr-text-3); }
.itr-fp dd { margin: 0; color: var(--itr-text); overflow-wrap: anywhere; white-space: pre-line; }
.itr-empty { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 18px; border: 1px solid var(--itr-line); border-radius: var(--itr-r); color: var(--itr-text-2); font-size: 13px; }
.itr-empty strong { color: var(--itr-text); }

/* ── narrow component widths ── */
@container itr (max-width: 900px) {
  .itr-matrix { --itr-name: 96px; }
  .itr-mname { font-size: 11.5px; }
}
@container itr (max-width: 559px) {
  .itr-title { font-size: 18px; }
  /* the container cannot restyle itself: the 44px touch size is set on the card */
  .itr-focus { --itr-hit: 44px; padding: 10px 10px 8px; }
  /* toolbar: pick button full width, the two switches share the next row */
  .itr-add { flex: 1 1 100%; justify-content: flex-start; }
  .itr-add-n { margin-left: auto; }
  .itr-bar-r { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .itr-bar-r .itr-seg { display: flex; min-width: 0; }
  .itr-seg button { flex: 1 1 0; min-width: 0; padding: 0 6px; }
  /* picker: model name on its own line, efforts three across */
  .itr-pk-top { display: grid; grid-template-columns: minmax(0, 1fr); }
  .itr-pk-acts { justify-content: flex-end; }
  .itr-pk-g { grid-template-columns: minmax(0, 1fr); }
  .itr-pk-e { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .itr-pk-b { min-width: 0; padding: 0 4px; }
  /* legend: one full-width row per line, value right-aligned */
  .itr-lgd { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .itr-lr { display: flex; }
  .itr-lr-t { flex: 1 1 auto; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 2px 6px; padding: 6px 8px; }
  .itr-lr-n { grid-column: 2; grid-row: 1; overflow: visible; white-space: normal; overflow-wrap: anywhere; }
  .itr-lr-v { grid-column: 3; grid-row: 1; }
  .itr-lr-d { grid-column: 2 / 4; grid-row: 2; text-align: right; }
  .itr-lr-x { width: 44px; }
  .itr-back { min-height: 44px; }
  .itr-cap2 { justify-content: flex-start; }
  .itr-pd { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .itr-pd dt { margin-top: 3px; }
  /* matrix → one block per model, efforts three across; every cell keeps value, delta and sparkline */
  .itr-mhead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .itr-mrow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .itr-mrow + .itr-mrow { margin-top: 12px; }
  .itr-mrow > .itr-mname { grid-column: 1 / -1; padding: 0 0 1px; font-size: 13px; }
  .itr-cell { grid-template-rows: auto auto 26px; min-height: 70px; padding: 4px 7px 4px; }
  .itr-cell-e { display: block; }
  .itr-cell-v { font-size: 16px; }
}

/* ── modes ── */
@media (prefers-reduced-motion: reduce) {
  .itr *, .itr *::before, .itr *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  /* colours collapse: every slot gets its own dash pattern instead */
  .itr-lpath, .itr-endkey, .itr-ring { stroke: CanvasText; }
  .itr-c1 .itr-lpath { stroke-dasharray: 9 3; } .itr-c2 .itr-lpath { stroke-dasharray: 2 3; } .itr-c3 .itr-lpath { stroke-dasharray: 9 3 2 3; }
  .itr-c4 .itr-lpath { stroke-dasharray: 5 5; } .itr-c5 .itr-lpath { stroke-dasharray: 12 4; } .itr-c6 .itr-lpath { stroke-dasharray: 1 5; } .itr-c7 .itr-lpath { stroke-dasharray: 12 3 3 3 3 3; }
  .itr-ln.is-hot .itr-lpath { stroke: Highlight; }
  .itr-dot { fill: CanvasText; stroke: Canvas; } .itr-dot.is-iso { fill: Canvas; stroke: CanvasText; }
  .itr-sw { background: CanvasText !important; }
  .itr-cell[aria-pressed="true"], .itr-view[aria-pressed="true"], .itr-pk-b[aria-pressed="true"], .itr-seg button[aria-pressed="true"], .itr-lr.is-hot { outline: 2px solid Highlight; }
  .itr-sline, .itr-sdot, .itr-scur, button.itr-cell[aria-pressed="true"] :is(.itr-sline, .itr-sdot) { stroke: Highlight; }
  .itr-cross, .itr-runline, .itr-xtick, .itr-grid, .itr-base { stroke: GrayText; }
  .itr-gap { fill: transparent; } .itr-sgap { stroke: GrayText; }
  .itr-ytick, .itr-xlab, .itr-runlab, .itr-endlab, .itr-msg { fill: CanvasText; stroke: none; }
  .itr-tip { border-color: CanvasText; background: Canvas; }
  .itr-lg-line, .itr-lg-iso, .itr-lg-dash { border-color: CanvasText; }
  .itr-link { color: LinkText; }
}
@media print {
  .itr-bar, .itr-picker, .itr-hint, .itr-back, .itr-lr-x, .itr-tip, .itr-vbar .itr-btn { display: none !important; }
  .itr-focus { break-inside: avoid; }
}

/* Ticket 299 browser polish by Codex: stable colour + pattern for every real combination. */
.itr .itr-pattern1 { --itr-dash: 9 3; }
.itr .itr-pattern2 { --itr-dash: 2 3; }
.itr .itr-pattern3 { --itr-dash: 9 3 2 3; }
.itr .itr-pattern4 { --itr-dash: 12 4 2 4; }
.itr .itr-pattern5 { --itr-dash: 6 3 2 3 2 3; }
