/* ── Counts: the strip and the KPI tile (revamp O4, O5, E4, E5) ─────────────
   Markup from static/lib/kpi.js. Version D replaces grids of equal cards
   with one strip of counts; an item that picks the table below is a
   toggle button (aria-pressed), a link is a link, the rest is static.
   No motion on data (DESIGN.md §8): hover changes the fill, never lifts. */

.strip {
    display: flex;
    margin: 0 0 var(--sp-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border), var(--shadow-1);
    overflow-x: auto;
    scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip-item {
    position: relative;   /* contains its screen-reader text, which would otherwise widen the page */
    flex: 1 0 auto;
    display: grid;
    align-content: start;
    gap: 0;
    min-width: 128px;
    padding: 8px 14px;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    text-decoration: none;
    color: var(--text);
}
.strip-item:last-child { border-right: 0; }
.strip-item:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.strip-item:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
button.strip-item, a.strip-item { cursor: pointer; }
button.strip-item:hover, a.strip-item:hover { background: var(--hover); }
.strip-item[aria-pressed="true"] { background: var(--accent-dim); box-shadow: inset 0 -2px 0 var(--accent); }
.strip-item:focus-visible { outline-offset: -2px; }
.strip-lbl {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--fs-12);
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
}
.strip-val {
    font-size: var(--fs-kpi);
    line-height: 28px;
    font-weight: 650;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.strip-val small { margin-left: 6px; font-size: var(--fs-12); font-weight: 500; letter-spacing: 0; color: var(--warn); }
.strip-hint { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34ch; }

/* E5: zero and unknown look different. */
.kpi-unknown { font-size: var(--fs-15); font-weight: 500; font-style: italic; color: var(--text-3); letter-spacing: 0; }
.kpi-flag { display: inline-flex; color: var(--warn); }

/* ── KPI tile (Overview coverage row, O4/O5) ─────────────────────────────── */
.kpi-tile {
    display: grid;
    align-content: start;
    gap: 2px;
    min-width: 0;
    height: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border), var(--shadow-1);
    font: inherit;
    text-align: left;
    text-decoration: none;
    color: var(--text);
}
button.kpi-tile, a.kpi-tile { cursor: pointer; transition: background var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out); }
/* O5: the hover affordance is a fill and a stronger outline, not a lift. */
button.kpi-tile:hover, a.kpi-tile:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-1); }
.kpi-tile-label { display: flex; align-items: center; gap: 7px; font-size: var(--fs-13); font-weight: 500; color: var(--text-2); }
.kpi-tile-label .kpi-go { margin-left: auto; color: var(--text-3); opacity: 0; transition: opacity var(--dur-med) var(--ease-out); }
button.kpi-tile:hover .kpi-go, a.kpi-tile:hover .kpi-go, .kpi-tile:focus-visible .kpi-go { opacity: 1; }
.kpi-tile-val { font-size: var(--fs-kpi); line-height: 28px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-tile-hint { font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* O4: a 6px progress bar instead of a coloured underline and arrow. */
.kpi-bar {
    display: block;
    height: 6px;
    margin-top: 10px;
    border-radius: var(--radius-pill);
    background: var(--sunken);
    overflow: hidden;
}
.kpi-bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.kpi-bar-ok .kpi-bar-fill { background: var(--success); }
.kpi-bar-warn .kpi-bar-fill { background: var(--warn); }
.kpi-bar-error .kpi-bar-fill { background: var(--error); }

@media (max-width: 640px) {
    .strip-item { min-width: 112px; padding: 8px 12px; }
}
