/* OBSCURA OS - Sheets: Version History, and the status bar's figures.
 *
 * Kept out of the page's own style block, which is held to its size
 * (design-lint.mjs), and loaded after it. */

/* The status bar's Average, Count, Min, Max and Sum: each a button that
   copies its figure (sheets-shell.js). */
#selectionMathSummary { gap: 2px; }
.sh-stat { min-height: 20px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.sh-stat:hover { background: var(--sh-hover); color: var(--ink); }
.sh-stat:focus-visible { outline: 2px solid var(--sheet-green); outline-offset: -2px; }
@media (max-width: 760px) {
  #selectionMathSummary { gap: 0; }
  #selectionMathSummary .sh-avg, #selectionMathSummary .sh-min, #selectionMathSummary .sh-max { display: none; }
}

/* Version History (sheets-versions.js): the list, newest first, and a
   version's cells, read only. */
.sh-ver-save { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0; }
.sh-ver-save .sh-f { flex: 1 1 auto; margin: 0; }
.sh-ver-list { max-height: 46vh; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.sh-ver-list > .sh-note { margin: 10px 12px; }
.sh-ver-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.sh-ver-row:last-child { border-bottom: 0; }
.sh-ver-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sh-ver-when { font-weight: 600; color: var(--ink); }
.sh-ver-kind, .sh-ver-sum { font-size: var(--text-2xs); color: var(--ink-soft); }
.sh-ver-kind.named { color: var(--sheet-green); font-weight: 600; }
.sh-ver-sum { font-variant-numeric: tabular-nums; }
.sh-ver-acts { display: flex; gap: 6px; flex: none; }
.sh-ver-acts .sh-b { min-width: 0; }
.sh-ver-prevbox { max-height: 50vh; overflow: auto; border: 1px solid var(--rule); }
.sh-ver-grid { border-collapse: collapse; font-size: var(--text-2xs); font-variant-numeric: tabular-nums; }
.sh-ver-grid th { position: sticky; top: 0; background: var(--sh-ribbon); color: var(--ink-soft); font-weight: 400; padding: 2px 6px; border: 1px solid var(--rule); }
.sh-ver-grid tbody th { position: static; text-align: right; }
.sh-ver-grid td { min-width: 64px; max-width: 180px; padding: 2px 6px; border: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-ver-grid td.num { text-align: right; }
@media (max-width: 560px) {
  .sh-ver-row { flex-wrap: wrap; }
  .sh-ver-acts { width: 100%; }
  .sh-ver-acts .sh-b { flex: 1 1 0; }
  .sh-ver-save { flex-direction: column; align-items: stretch; }
}
@media (pointer: coarse) {
  .sh-ver-acts .sh-b, .sh-ver-save .sh-b, .sh-ver-save input, #shVerSheet { min-height: 44px; }
  .sh-stat { min-height: 44px; min-width: 44px; }
}

/* ------------------------------------------------------------------------
   Motion inside the window (30 October 2026). A menu, a new sheet's tab
   and a button under the pointer each changed in one frame. Now a menu
   and its submenus fade in and come down the last few pixels over
   --dur-3 (os-menu-in, the site's menu arrival); a sheet tab that was not
   there before rises into the row, and a workbook's tabs deal in a
   --stagger apart as it opens (sheets-book.js marks them is-new and
   counts them in --deal); a control's colour eases over --dur-2 and it
   presses to 96% over --dur-1; the figures of the status bar and the
   formula bar are tabular, so a sum does not jog its neighbours as the
   selection moves; and the save state fades in when its words change
   rather than being redrawn in place. Every distance is one of
   theme.css's, nought with motion switched down, and everything that
   arrives asks for the fade it keeps then. */
.sh-menu { --os-fade: var(--dur-fade); animation: os-menu-in var(--dur-3) var(--ease-standard) backwards; }
.sheet-tab.is-new { --os-fade: var(--dur-fade); animation: os-rise-soft var(--dur-3) var(--ease-standard) backwards; animation-delay: calc(var(--stagger) * var(--deal, 0)); }
.sh-qat button, .sh-tab, .sh-big, .sh-sm, .sh-ico, .sheet-tab, .sheet-tab-add, .sh-sheetnav button, .sh-zoom button, .sh-stat, .sh-menu button, .sh-b {
  transition: background-color var(--dur-2) var(--ease-standard), border-color var(--dur-2) var(--ease-standard), color var(--dur-2) var(--ease-standard), transform var(--dur-1) var(--ease-standard);
}
.sh-qat button:active:not(:disabled), .sh-big:active:not(:disabled), .sh-sm:active:not(:disabled), .sh-ico:active:not(:disabled), .sheet-tab-add:active, .sh-sheetnav button:active, .sh-zoom button:active, .sh-b:active:not(:disabled) { transform: scale(0.96); }
:root[data-motion="none"] .sh-app :active { transform: none; }
.sheets-statusbar, .sh-fbar { font-variant-numeric: tabular-nums; }
#saveStatusBadge.is-fresh { --os-fade: var(--dur-fade); animation: os-fade-in var(--dur-2) var(--ease-standard) backwards; }
