/* Differential cell counter. Scoped to [data-cells]. */
[data-cells] .cells-head { display: flex; align-items: center; gap: 8px; }
[data-cells] .cells-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
[data-cells] .cells-tl { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--body); }
[data-cells] .cells-tv { font-size: clamp(48px, 12vw, 88px); }
[data-cells] .cells-of { color: var(--body); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
[data-cells] .cells-track { flex-basis: 100%; height: 8px; border-radius: var(--pill); background: var(--soft); overflow: hidden; }
[data-cells] .cells-track span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: var(--pill); }
[data-cells].is-done .cells-track span { background: var(--signal); }
[data-cells] .cells-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
[data-cells] .cells-tile { min-width: 0; border: 0; border-radius: 12px; background: var(--canvas); color: var(--ink); cursor: pointer; font: inherit;
  min-height: 118px; padding: 10px; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 4px; text-align: left; }
[data-cells] .cells-tile:active { background: var(--pressed); }
[data-cells] .cells-tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[data-cells] .cells-tile.is-out { background: var(--softer); }
[data-cells] .cells-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
[data-cells] .cells-name { min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-cells] .cells-top kbd { font: 700 13px/1 var(--font); background: var(--soft); border-radius: 6px; padding: 4px 8px; flex: none; }
[data-cells] .cells-n { font-size: clamp(40px, 9vw, 56px); }
[data-cells] .cells-p { font-size: 15px; color: var(--body); font-variant-numeric: tabular-nums; font-weight: 600; }
[data-cells] .cells-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
[data-cells] .cells-controls .pill { min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-cells] .cells-controls .pill:not(.pill-ink) { background: var(--canvas); }
[data-cells] .cells-controls .pill:not(.pill-ink):hover { background: var(--pressed); }
[data-cells] .cells-results { margin-top: 12px; display: grid; gap: 12px; }
[data-cells] .cells-results table.t td:not(:first-child), [data-cells] .cells-results table.t th:not(:first-child) { text-align: right; }
[data-cells] .cells-sum td { font-weight: 700; }
[data-cells] .cells-wbc { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
[data-cells] .cells-wbc .field { max-width: 260px; }
[data-cells] .cells-wbc .inp { background: var(--soft); }
[data-cells] .cells-wbcnote { margin: 0; font-size: 14px; flex: 1; min-width: 200px; }
[data-cells] .cells-rows { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
[data-cells] .cells-row, [data-cells] .cells-rowhead { display: grid; grid-template-columns: minmax(0, 1fr) 56px 64px 36px; gap: 8px; align-items: center; }
[data-cells] .cells-rowhead { font-size: 13px; font-weight: 600; color: var(--body); }
[data-cells] .cells-row .inp { padding: 10px; }
[data-cells] .cells-key { text-align: center; text-transform: uppercase; font-weight: 700; }
[data-cells] .cells-row input[type="checkbox"] { justify-self: center; }
[data-cells] .cells-note { grid-column: 1 / -1; margin: 0; font-size: 14px; }
[data-cells] .cells-hist { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
[data-cells] .cells-hist p { margin: 0; }
[data-cells] .cells-res { text-align: left !important; font-size: 14px; }
body.is-focus [data-cells] .cells-grid { flex: 1; min-height: 0; grid-auto-rows: minmax(100px, 1fr); }
body.is-focus [data-cells] .cells-tools .pill { display: none; }
@media (max-width: 400px) {
  [data-cells] .cells-grid { grid-template-columns: 1fr 1fr; }
  [data-cells] .cells-controls .pill { font-size: 14px; }
}
