/* Page rules of the m8_reporting package, linked by the base layout (web/templating.py module_stylesheets). The dashboard kit (F-18) comes first,
   the page rules after it, as before when the kit was in ris.css. */
/* Scoreboard kit A (SCB-03): critical-number card, gauge, trend, status summary, decision queue, stage flow, source
   chips and heat table. Status is a colour, an icon and a word; geometry sits in SVG attributes, colour in classes. */
.status-summary { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.sum-item { display: inline-flex; align-items: center; gap: .3rem; font-weight: 550; text-decoration: none; color: inherit; }
.sum-item strong { font-weight: 750; color: inherit; }
a.sum-item:hover { text-decoration: underline; }
.sum-bad { color: var(--bad); }
.sum-warn { color: var(--warn); }
.sum-ok { color: var(--ok); }
.sum-none { color: var(--ink-soft); }
.cn-card { display: flex; flex-direction: column; min-width: 0; padding: .8rem 1rem .7rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.cn-title { display: block; margin: 0; font-size: var(--text-ui); font-weight: 650; line-height: 1.3; letter-spacing: -.005em; }
.cn-gauge { display: block; margin: .3rem -.35rem 0; padding: .3rem .35rem 0; border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: background-color var(--dur-fast); }
.cn-gauge:hover { background: var(--hover); }
.cn-gauge:hover .gauge-value { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.cn-status { display: flex; justify-content: center; margin: -.1rem 0 .45rem; }
.cn-target { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .45rem; margin: 0 0 .15rem; font-size: var(--text-meta); }
.cn-target strong { font-weight: 650; }
.cn-target .tag { height: 1.2rem; font-size: var(--text-meta); }
.tag-default { background: var(--surface); color: var(--ink-soft); border: 1px dashed var(--control-line); }
.cn-basis { margin: 0 0 .6rem; font-size: var(--text-meta); line-height: 1.4; color: var(--ink-soft); text-align: center; }
.cn-basis a { font-weight: 600; text-decoration: none; }
.cn-basis a:hover { text-decoration: underline; }
.cn-tail { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; margin-top: auto; padding-top: .55rem; border-top: 1px solid var(--line); }
.cn-trend { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.cn-foot { display: flex; align-items: center; gap: .5rem; font-size: var(--text-meta); }
.cn-foot .person { min-width: 0; font-weight: 550; }
.cn-foot .person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gauge { position: relative; width: 8.2rem; max-width: 100%; margin: 0 auto; }
.gauge-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gauge-center { position: absolute; left: 0; right: 0; top: 40%; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.gauge-value { font-size: 1.95rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gauge-value-long { font-size: 1.45rem; }
.gauge-value .pct { font-size: .55em; font-weight: 650; margin-left: .05em; }
.gauge-unit { margin-top: .2rem; font-size: var(--text-meta); font-weight: 600; color: var(--ink-soft); }
.g-track { fill: none; stroke: var(--gauge-track); stroke-width: 10; stroke-linecap: round; }
.g-fill { fill: none; stroke-width: 10; stroke-linecap: round; }
.g-f-ok { stroke: var(--ok); }
.g-f-warn { stroke: var(--warn); }
.g-f-bad { stroke: var(--bad); }
.g-ring { fill: none; stroke: var(--chart-edge); stroke-width: 5.5; }
.g-zone { fill: none; stroke-width: 3.5; }
.g-ok { stroke: var(--zone-ok); }
.g-warn { stroke: var(--zone-warn); }
.g-bad { stroke: var(--zone-bad); }
.g-target { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.delta { display: inline-flex; align-items: center; gap: .2rem; min-width: 0; white-space: nowrap; font-size: var(--text-meta); }
.delta strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-word { font-weight: 650; }
.delta-worse, .delta-better, .delta-same { color: var(--ink-soft); }
.delta .muted { font-weight: 450; }
.spark { flex: 0 0 auto; width: 4.25rem; height: 1.3rem; overflow: visible; }
.spark polyline { fill: none; stroke: var(--spark-line); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-end { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.queue { margin: 0; padding: .25rem 0; list-style: none; }
.q-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .3rem 1.25rem; color: var(--ink); text-decoration: none; transition: background-color var(--dur-fast); }
.queue li + li .q-row { border-top: 1px solid var(--line); }
.q-row:hover { background: var(--hover); }
.q-row:hover .q-label { text-decoration: underline; }
.q-count { font-size: 1.4rem; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.q-label { display: block; font-size: var(--text-ui); font-weight: 600; line-height: 1.3; }
.q-sub { display: inline-flex; align-items: center; gap: .25rem; margin-top: .1rem; font-size: var(--text-meta); color: var(--ink-soft); }
.q-sub.q-old { color: var(--warn); font-weight: 600; }
.q-cta { display: inline-flex; align-items: center; gap: .1rem; font-size: var(--text-meta); font-weight: 650; color: var(--selected-ink); }
.q-cta-view { color: var(--ink-soft); }
.q-row.is-zero .q-count { color: var(--ink-soft); font-weight: 500; }
.q-row.is-zero .q-label { font-weight: 500; color: var(--ink-soft); }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(6.5rem, .8fr); gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
/* Every stage spans the four rows of the flow (title, count, sub-line, age cells) through a subgrid, so counts and
   age cells line up whatever the title length. */
.stage { position: relative; min-width: 0; display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
.stage + .stage::before { content: ""; position: absolute; left: -.95rem; top: .3rem; width: .45rem; height: .45rem; border-top: 1.5px solid var(--control-hover-line); border-right: 1.5px solid var(--control-hover-line); transform: rotate(45deg); }
.stage-head { grid-row: 1; display: flex; align-items: flex-start; gap: .4rem; min-width: 0; }
.stage-n { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border: 1px solid var(--control-line); border-radius: 50%; font-size: var(--text-meta); font-weight: 700; color: var(--ink-soft); }
.stage-n .icon { width: .65rem; height: .65rem; stroke-width: 3; }
.stage-name { min-width: 0; font-size: var(--text-meta); font-weight: 700; line-height: 1.5; color: var(--ink); overflow-wrap: break-word; hyphens: auto; }
.stage-figure { grid-row: 2; display: flex; align-items: baseline; gap: .35rem; margin-top: .35rem; }
.stage-count { font-size: 1.95rem; font-weight: 750; line-height: 1.1; color: var(--ink); text-decoration: none; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stage-count:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.stage-noun { font-size: var(--text-meta); color: var(--ink-soft); }
.stage-sub { grid-row: 3; margin: .1rem 0 .6rem; font-size: var(--text-meta); color: var(--ink-soft); }
.stage-sub a { text-decoration: none; font-weight: 600; }
.stage-sub a:hover { text-decoration: underline; }
.age-strip { grid-row: 4; display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.age-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); align-items: center; gap: .5rem; }
.age-name { font-size: var(--text-meta); color: var(--ink-soft); }
.age { display: block; padding: .12rem 0; border: 1px solid var(--chart-edge); border-radius: var(--small-radius); color: var(--ink); font-size: var(--text-meta); font-weight: 650; text-align: center; text-decoration: none; font-variant-numeric: tabular-nums; }
.age:hover { outline: 1px solid var(--control-hover-line); }
.age-0 { background: var(--age-0); }
.age-1 { background: var(--age-1); }
.age-2 { background: var(--age-2); }
.age-3 { background: var(--age-3); }
.age.is-zero { color: var(--ink); font-weight: 500; }
/* The tile's background is drawn around the stage so that its padding does not push its rows out of line. */
.stage-end { z-index: 0; padding-right: .6rem; }
.stage-end .stage-sub { grid-row: 3 / span 2; }
.stage-end::after { content: ""; position: absolute; z-index: -1; inset: -.6rem 0 -.6rem -.8rem; border-radius: var(--radius); background: var(--surface); }
.stage.stage-end::before { left: -1.15rem; top: .9rem; }
.sw { display: inline-block; width: .7rem; height: .7rem; border: 1px solid var(--chart-edge); border-radius: 2px; flex: 0 0 auto; }
.src-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.src-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 1.85rem; padding: 0 .65rem 0 .55rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: var(--text-meta); font-weight: 600; }
.src-chip a { display: inline-flex; align-items: center; gap: .4rem; color: inherit; text-decoration: none; }
.src-chip a:hover { text-decoration: underline; }
.src-chip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2.5px var(--ok-surface); }
.src-n { color: var(--ink-soft); font-weight: 500; font-variant-numeric: tabular-nums; }
.src-chip.src-warn { border-color: var(--warn-line); background: var(--warn-surface); color: var(--warn); }
.src-chip.src-warn .dot { background: var(--warn); box-shadow: 0 0 0 2.5px var(--warn-halo); }
.src-chip.src-warn .src-n { color: inherit; }
.src-state { display: inline-flex; align-items: center; gap: .2rem; font-size: var(--text-meta); font-weight: 650; }
.heat-table th, .heat-table td { padding: .3rem .5rem; }
.heat-table th:first-child { padding-left: 1.25rem; }
.heat-table td:last-child, .heat-table th:last-child { padding-right: 1.25rem; }
.heat-table td.num, .heat-table thead th.num { text-align: center; }
.heat { display: block; min-width: 2.4rem; padding: .3rem 0; border-radius: var(--small-radius); color: var(--ink); font-weight: 650; text-align: center; text-decoration: none; font-variant-numeric: tabular-nums; }
.heat:hover { outline: 1px solid var(--control-hover-line); }
.heat-0 { background: transparent; color: var(--ink-soft); }
.heat-1 { background: var(--heat-1); }
.heat-2 { background: var(--heat-2); }
.heat-3 { background: var(--heat-3); }
.heat-4 { background: var(--heat-4); color: var(--brand-ink); }
.heat-table td.total a, .heat-table .sum-row a { font-weight: 750; color: var(--ink); text-decoration: none; }
.heat-table .sum-row th, .heat-table .sum-row td { border-top: 1px solid var(--control-line); background: var(--sum-surface); }
@media (max-width: 800px) {
  .cn-card { display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); grid-template-areas: "head head" "gauge status" "gauge target" "gauge basis" "trend trend"; column-gap: .9rem; padding: .8rem .9rem .7rem; }
  .cn-title { grid-area: head; min-height: 0; margin-bottom: .2rem; }
  .cn-status { grid-area: status; justify-content: flex-start; margin: 0 0 .2rem; align-self: end; }
  .cn-gauge { grid-area: gauge; margin: 0; padding: 0; align-self: center; }
  .gauge { width: 7.2rem; }
  .gauge-value { font-size: 1.75rem; }
  .gauge-value-long { font-size: 1.35rem; }
  .cn-target { grid-area: target; justify-content: flex-start; margin: 0; }
  .cn-basis { grid-area: basis; text-align: left; margin: .2rem 0 .3rem; }
  .cn-tail { grid-area: trend; margin-top: .3rem; }
  .q-row { padding: .7rem 1rem; min-height: 3.3rem; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stage { grid-row: auto; grid-template-rows: none; grid-template-columns: minmax(0, 1fr) 9.5rem; grid-template-areas: "head strip" "fig strip" "sub strip"; column-gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); }
  .stage:first-child { border-top: 0; padding-top: 0; }
  .stage + .stage::before { display: none; }
  .stage-head { grid-area: head; }
  .stage-figure { grid-area: fig; align-items: center; margin-top: .1rem; }
  .stage-count { display: inline-flex; align-items: center; min-height: var(--touch); padding-inline: .6rem; margin-inline: -.6rem; font-size: 1.6rem; }
  .stage-sub { grid-area: sub; margin: 0; }
  .age-strip { grid-area: strip; align-self: center; }
  .stage-end { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin-top: .4rem; border-top: 0; padding: .6rem .8rem; }
  .stage-end::after { inset: 0; }
  .stage-end .stage-figure, .stage-end .stage-sub { margin: 0; }
  .client-name, .client-sub > a, .src-chip a, .src-state { display: inline-flex; align-items: center; min-height: var(--touch); }
  .src-chip { min-height: var(--touch); }
  .age-row { grid-template-columns: var(--touch) minmax(0, 1fr); }
  .age { display: flex; align-items: center; justify-content: center; min-height: var(--touch); padding: 0; }
}
/* Scoreboard kit B (SCB-04): bullet bar, line chart with its table toggle, tabs, filter group, workload status chip, band
   editor and order buttons. Geometry is in SVG attributes, colour in classes; no gradients, edge bars or hover lifts. */
.bullet { display: block; width: 100%; height: 16px; }
.b-zone { shape-rendering: crispEdges; stroke: var(--chart-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.b-ok { fill: var(--zone-ok); }
.b-warn { fill: var(--zone-warn); }
.b-bad { fill: var(--zone-bad); }
.b-value { fill: var(--ink); }
.b-target { stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-card .card-title .section-heading { margin-bottom: 0; }
.view-toggle { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--control-radius); }
.view-toggle button, .tabs button, .segmented-btns button { min-height: 1.75rem; padding: 0 .6rem; border-radius: var(--small-radius); color: var(--ink-soft); font-size: var(--text-meta); box-shadow: none; }
.view-toggle button[aria-pressed="true"], .segmented-btns button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--selected); border-color: transparent; color: var(--selected-ink); }
.view-toggle button[aria-pressed="true"]:hover, .segmented-btns button[aria-pressed="true"]:hover, .tabs button[aria-selected="true"]:hover { background: var(--selected); color: var(--selected-ink); }
/* Without script both views show and the toggle, which could not work, is not drawn. */
html:not(.js) .view-toggle, html:not(.js) [data-tabs], html:not(.js) .filter-group { display: none; }
/* With script, the table stays in the DOM (it is the accessible representation) but is visually hidden in chart view;
   keyboard focus inside it reveals it. */
html.js .chart-card[data-view="chart"] .chart-table:not(:focus-within) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html.js .chart-card[data-view="table"] .chart-visual, html.js .chart-card[data-view="table"] .legend { display: none; }
.chart-table { margin-top: .5rem; }
html.js .chart-card[data-view="chart"] .table-scroll-hint { display: none; }
.plot { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); }
.plot-y { position: relative; }
.plot-y span { position: absolute; right: .5rem; transform: translateY(-50%); font-size: var(--text-meta); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plot-y .y-top { top: 0; }
.plot-y .y-mid { top: 50%; }
.plot-y .y-bot { top: 100%; }
.plot-area { position: relative; height: 10.5rem; }
.plot-area.h-sm { height: 6.5rem; }
.plot-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plot-svg .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plot-svg .axis { stroke: var(--control-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plot-svg .target-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.plot-svg .line-1 { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.plot-svg .col-1 { fill: var(--series-1); }
.plot-svg .col-2 { fill: var(--paper); stroke: var(--series-1); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* The markers live in a second layer that is not stretched: a circle drawn in the stretched plot becomes an ellipse in WebKit. */
.plot-markers { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.plot-markers .pt { fill: var(--series-1); }
.plot-markers .pt-hole { fill: var(--paper); }
.plot-x, .plot-v { display: flex; margin-left: 2.6rem; text-align: center; }
.plot-x span, .plot-v span { flex: 1 1 0; min-width: 0; }
@media (max-width: 800px) { .plot-x[data-months="12"] span:nth-child(even), .plot-v[data-months="12"] span:nth-child(even) { visibility: hidden; } }
.plot-x { margin-top: .35rem; font-size: var(--text-meta); color: var(--ink-soft); }
.plot-v { margin-top: .4rem; font-size: var(--text-meta); font-weight: 650; font-variant-numeric: tabular-nums; }
.plot-v.v-2 { margin-top: .1rem; font-weight: 500; color: var(--ink-soft); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.1rem; margin: .85rem 0 0; padding: 0; list-style: none; font-size: var(--text-meta); color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: .35rem; }
.legend .sw { display: inline-block; width: 1.1rem; height: 0; border-top: 2px solid var(--series-1); }
.legend .sw-target { border-top: 2px dashed var(--ink); }
.legend .sw-col-1, .legend .sw-col-2 { width: .7rem; height: .7rem; border: 1.5px solid var(--series-1); border-radius: 2px; background: var(--series-1); }
.legend .sw-col-2 { background: var(--paper); }
.legend .sw-hole { width: .6rem; height: .6rem; border: 2px solid var(--series-1); border-radius: 50%; background: var(--paper); }
.hbar-cell { width: 45%; }
.hbar-cell svg { display: block; width: 100%; height: .7rem; }
.hbar-cell rect { fill: var(--series-1); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; margin-bottom: 1.5rem; }
.pair > * { margin-bottom: 0; }
.multiple-now { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; min-height: 2.8rem; margin: 0 0 .5rem; font-size: var(--text-meta); align-content: flex-start; }
.multiple-now strong { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; }
.multiple-now .u { font-size: var(--text-meta); font-weight: 600; color: var(--ink-soft); }
.multiple-now .pct { font-size: var(--text-meta); font-weight: 600; }
@media (max-width: 800px) { .hbar-cell { width: 30%; } .bar-table th.num { white-space: nowrap; } .pair { grid-template-columns: minmax(0, 1fr); } }
.chart-note { margin: .6rem 0 0; font-size: var(--text-meta); color: var(--ink-soft); }
.tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--control-radius); }
.tab-panel { margin-top: .75rem; }
.tab-panel:focus-visible { outline-offset: 4px; }
.tab-title { margin: 0 0 .5rem; font-size: var(--text-ui); font-weight: 650; }
html.js .tab-title { display: none; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.segmented-btns { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--paper); }
.segmented-btns .n { font-weight: 500; opacity: .8; }
.filter-group .count { font-size: var(--text-ui); color: var(--ink-soft); }
.cn-chip { display: inline-flex; align-items: center; gap: .3rem; height: 1.65rem; padding: 0 .5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--neutral-surface); color: var(--ink-soft); font-size: var(--text-meta); font-weight: 600; white-space: nowrap; text-decoration: none; }
.cn-chip strong { color: inherit; font-weight: 750; }
a.cn-chip:hover { border-color: var(--control-hover-line); }
.cn-chip-ok { background: var(--ok-surface); border-color: var(--ok-line); color: var(--ok); }
.cn-chip-warn { background: var(--warn-surface); border-color: var(--warn-line); color: var(--warn); }
.cn-chip-bad { background: var(--bad-surface); border-color: var(--bad-line); color: var(--bad); }
.plain-v { display: inline-flex; align-items: center; height: 1.65rem; font-size: var(--text-ui); font-weight: 650; color: var(--ink-soft); text-decoration: none; }
.not-tracked { display: block; font-size: var(--text-meta); }
/* Client workload scoreboard (SCB-10): one row per client; below 1100 px one card per client. */
.wl th, .wl td { padding: .7rem .6rem; vertical-align: top; }
/* The generic table rule gives every cell a 7rem minimum; the nine number columns must fit the panel. */
.wl.wl td:not(.text) { min-width: 0; }
.wl td.cnc { width: 6.5rem; }
.wl td.dec { width: 4.5rem; }
.wl thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.wl thead th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.wl thead th.sub { font-weight: 600; }
.wl td.num, .wl th.num { text-align: right; }
.wl td.dec-head { display: none; }
.client { display: flex; flex-direction: column; gap: .3rem; min-width: 11rem; }
@media (max-width: 1100px) {
  .wl thead { display: none; }
  .wl, .wl tbody, .wl tr, .wl th, .wl td { display: block; width: auto; }
  .wl tbody tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem .9rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); }
  .wl th, .wl td, .wl th:first-child, .wl td:last-child { padding: 0; border: 0; min-width: 0; }
  .wl td.cnc, .wl td.dec { width: auto; }
  .wl th[scope="row"] { grid-column: 1 / -1; }
  .wl td.dec-head { display: block; grid-column: 1 / -1; font-size: var(--text-meta); font-weight: 700; color: var(--ink-soft); }
  .wl td.num { text-align: left; }
  .wl td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .1rem; font-size: var(--text-meta); font-weight: 600; color: var(--ink-soft); }
}
@media (max-width: 800px) {
  .wl tbody tr { padding: .9rem 1rem; gap: .6rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .wl td.cnc, .wl td.dec { grid-column: span 6; }
  .wl td[data-label]::before { overflow-wrap: anywhere; hyphens: auto; }
  /* A decision cell holds one figure: the label sits on top and the figure at the bottom, so figures line up whatever the label's length. */
  .wl td.dec { display: flex; flex-direction: column; align-items: flex-start; }
  .wl td.dec::before { margin-bottom: auto; }
  .wl td.num.dec a[data-figure-value] { justify-content: flex-start; }
}
/* Executive summary (SCB-10): phone first, one row per critical number. */
.exec { max-width: 46rem; }
.kpi-group-bad { color: var(--bad); }
.kpi-group-warn { color: var(--warn); }
.kpi-group-ok { color: var(--ok); }
.kpi-list, .also { margin: 0; padding: 0; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow: hidden; }
.kpi-list li + li, .also li + li { border-top: 1px solid var(--line); }
.kpi { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto 4.5rem; align-items: center; gap: .85rem; padding: .85rem 1rem; color: var(--ink); text-decoration: none; }
.kpi:hover { background: var(--hover); }
.kpi .bullet { height: 12px; max-width: 14rem; margin-top: .4rem; }
.also a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; color: var(--ink); font-size: var(--text-ui); text-decoration: none; }
.also a:hover { background: var(--hover); }
.also strong { font-size: 1.1rem; font-weight: 750; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
  .kpi { grid-template-columns: 2.1rem minmax(0, 1fr) auto; gap: .7rem; padding: .85rem .9rem; min-height: 4.6rem; }
  .kpi .bullet { max-width: none; }
  .exec .page-actions .button { flex: 1; }
}
.preview-row { background: var(--surface); }
.preview { flex-direction: column; align-items: stretch; gap: .45rem; }
.preview .bullet { height: 16px; }
.preview-status { display: block; min-height: 1.4rem; font-size: var(--text-meta); }
.preview-status[data-status="invalid"] { color: var(--bad); font-weight: 600; }
.order-list { position: relative; }
.order-list > ol { margin: 0; padding: 0; list-style: none; }
.order-buttons { display: inline-flex; gap: .25rem; }
.order-list .setting-control { align-items: center; gap: 1rem; }
.order-buttons button { width: var(--touch); min-height: var(--touch); padding: 0; font-size: 1rem; }
.order-inputs { display: none; }
@media (max-width: 639px) {
  .plot-area { height: 9rem; }
  .plot { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .plot-x, .plot-v { margin-left: 2.2rem; }
  .tabs, .segmented-btns { width: 100%; }
  .tabs button, .segmented-btns button { flex: 1 1 auto; padding: 0 .4rem; white-space: normal; line-height: 1.15; }
  /* Touch targets are 44 px (these rules are more specific than the shell's button rule, so they repeat it). */
  .view-toggle button, .tabs button, .segmented-btns button { min-height: var(--touch); }
  .cn-chip, .plain-v, button.link-button[data-reset-default] { height: auto; min-height: var(--touch); }
}
/* Scoreboard Dashboard (SCB-06): the page grid, link lists, deadline tables and source summary. */
.due-bar { display: block; width: 100%; height: .8rem; }
.bar-over { fill: var(--bad); }
.bar-due { fill: var(--paper); stroke: var(--warn); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.cn-grid { margin: 0; padding: 0; list-style: none; }
/* Three across, and the last row stretches so that no row ends in a hole (two across under 1100 px, one under 800 px). */
.grid-balanced { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.grid-balanced > * { grid-column: span 2; }
.grid-balanced > :last-child:nth-child(3n + 1) { grid-column: span 6; }
.grid-balanced > :last-child:nth-child(3n + 2), .grid-balanced > :nth-last-child(2):nth-child(3n + 1) { grid-column: span 3; }
@media (max-width: 1100px) {
  .grid-balanced > *, .grid-balanced > :nth-last-child(2):nth-child(3n + 1), .grid-balanced > :last-child:nth-child(3n + 2) { grid-column: span 3; }
  .grid-balanced > :last-child:nth-child(odd) { grid-column: span 6; }
}
@media (max-width: 800px) {
  .grid-balanced { grid-template-columns: minmax(0, 1fr); }
  .grid-balanced > *, .grid-balanced > :last-child:nth-child(odd), .grid-balanced > :last-child:nth-child(3n + 1), .grid-balanced > :last-child:nth-child(3n + 2), .grid-balanced > :nth-last-child(2):nth-child(3n + 1) { grid-column: 1 / -1; }
}
.pair-wide { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 800px) { .pair-wide { grid-template-columns: minmax(0, 1fr); } }
.multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 0 calc(-1 * var(--panel-pad, 1.5rem)); }
.wl-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; margin-bottom: .5rem; }
.client-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; }
.client-name { font-weight: 650; color: var(--ink); text-decoration: none; }
.client-name:hover { color: var(--accent); text-decoration: underline; }
.client-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: var(--text-meta); font-weight: 450; color: var(--ink-soft); }
.client-sub a { font-weight: 600; }
.asof-t { white-space: nowrap; }
.cro-sub { display: block; margin-top: .2rem; font-size: var(--text-meta); font-weight: 450; color: var(--ink-soft); }
.cro-sub a { color: var(--ink-soft); font-weight: 650; }
.fig-n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-group { margin-bottom: 1.25rem; }
.kpi-group-h { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-size: var(--text-meta); font-weight: 700; color: var(--ink-soft); }
.kpi-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--radius); font-weight: 700; }
.kpi-main { min-width: 0; }
.kpi-label { display: block; font-size: var(--text-body-sm); font-weight: 650; line-height: 1.3; }
.kpi-meta { display: block; margin-top: .1rem; font-size: var(--text-meta); color: var(--ink-soft); }
.kpi-side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; text-align: right; }
.kpi-value { font-size: 1.55rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-spark { width: 4.5rem; height: 1.6rem; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dash-grid > .span-4 { grid-column: span 4; }
.dash-grid > .span-5 { grid-column: span 5; }
.dash-grid > .span-7 { grid-column: span 7; }
.dash-grid > .span-8 { grid-column: span 8; }
.dash-grid > .dash-stack.span-4 { grid-column: span 4; }
.dash-grid > .align-start { align-self: start; }
.dash-grid > .span-12 { grid-column: 1 / -1; }
.link-list { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: 0 0 .9rem; padding: 0; list-style: none; font-size: var(--text-ui); }
.link-list a { text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.status-chips { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.status-chips .link-list { margin: 0; }
.foot-links { margin: .9rem 0 0; }
.fig-n { font-weight: 650; text-decoration: none; }
.bar-cell { width: 28%; min-width: 6rem; }
.table-note { margin: .5rem 0 0; font-size: var(--text-meta); color: var(--ink-soft); }
.src-summary { margin: 0 0 .75rem; font-size: var(--text-ui); }
.src-summary a { text-decoration: none; }
.src-alert { display: flex; align-items: flex-start; gap: .5rem; margin-top: .75rem; padding: .6rem .75rem; border: 1px solid var(--warn-line); border-radius: var(--radius); background: var(--warn-surface); font-size: var(--text-meta); }
.stat-list { margin: 0; padding: 0; list-style: none; font-size: var(--text-ui); }
.stat-list li + li { border-top: 1px solid var(--line); }
.stat-list a { display: flex; align-items: baseline; gap: .6rem; padding: .35rem 0; text-decoration: none; }
.stat-list a:hover { text-decoration: underline; }
.stat-list strong { min-width: 3.2rem; font-size: 1.1rem; }
@media (max-width: 1100px) {
  .metric-grid:not(.grid-balanced) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .metric-grid { gap: .65rem; }
}
@media (max-width: 800px) {
  .cn-grid.grid-balanced { gap: .6rem; }
}
.multiples .plot-x[data-months="12"] span:nth-child(even), .multiples .plot-v[data-months="12"] span:nth-child(even) { visibility: hidden; }
.multiples > .card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.multiples .card-head { flex-direction: column; align-items: flex-start; gap: .4rem; border-bottom: 0; }
.multiples .card-head h3 { font-size: var(--text-ui); font-weight: 650; }
@media (max-width: 800px) {
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .multiples > .card + .card { border-top: 1px solid var(--line); }
}
.wl-summary .help { margin: 0; font-size: var(--text-meta); }
.fig-n.is-zero { color: var(--ink-soft); font-weight: 500; }
@media (max-width: 800px) {
  .wl-summary .segmented-btns { width: 100%; }
}
.kpi-group-h .n { font-weight: 500; }
.kpi-bad .kpi-icon { background: var(--bad-surface); color: var(--bad); }
.kpi-warn .kpi-icon { background: var(--warn-surface); color: var(--warn); }
.kpi-ok .kpi-icon { background: var(--ok-surface); color: var(--ok); }
.kpi-none .kpi-icon { background: var(--neutral-surface); color: var(--ink-soft); }
.kpi-value .u { font-size: var(--text-meta); font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.kpi-value .pct { font-size: .55em; font-weight: 650; margin-left: .05em; }
.kpi-side .delta { justify-content: flex-end; }
@media (max-width: 800px) {
  .kpi-spark { display: none; }
}
.dash-grid > .card { margin-bottom: 0; }
.src-alert > .icon { margin-top: .15rem; color: var(--warn); }
@media (max-width: 1100px) {
  .dash-grid > .card, .dash-grid > .dash-stack, .dash-grid > .dash-stack.span-4 { grid-column: 1 / -1; }
}

.tile-group + .tile-group { margin-top: 1.25rem; }
.group-title { margin: 0 0 .6rem; font-size: var(--text-ui); font-weight: 650; }
.tile-group .section-heading { margin-bottom: .6rem; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 1rem; }
.dash-stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.dash-stack > .card { margin: 0; }
.bar-table { table-layout: fixed; }
.bar-table th:first-child { width: 40%; }
.bar-table th.num { width: 6.5rem; white-space: nowrap; }
.stage-table td.num a { font-variant-numeric: tabular-nums; }
.dash-grid .data th[scope="row"] { min-width: 7rem; }
@media (min-width: 801px) { .dash-grid .data.stacked th, .dash-grid .data.stacked td { padding-left: .5rem; padding-right: .5rem; white-space: normal; } .dash-grid .bar-cell { width: 20%; min-width: 4.5rem; } }
