.save-bar { position: sticky; top: 12px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: 0 0 var(--space-4); padding: var(--space-4); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); }
.save-bar strong { display: block; font-size: var(--text-ui); font-weight: 400; }
.save-bar p { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-meta); }
.save-bar__buttons { display: flex; align-items: center; flex: 0 0 auto; gap: var(--space-2); }
.save-bar:focus { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
/* Grid editing must not move the rows when the first draft or save notice appears. */
.order-book-page > .save-bar {
  position: fixed;
  top: auto;
  right: var(--page-gutter);
  bottom: var(--space-4);
  left: calc(var(--sidebar-width, 0px) + var(--page-gutter));
  z-index: 50;
  margin: 0;
}
.order-book-page #order-sheet { height: var(--sheet-draft-height, auto); scroll-padding-bottom: calc(var(--sheet-draft-clearance, 0px) + var(--space-3)); }
.order-book-page #order-sheet::after {
  content: "";
  display: block;
  height: var(--sheet-draft-clearance, 0px);
  pointer-events: none;
  overflow-anchor: none;
}
.order-book-page .inventory-sheet-scroll { height: var(--inventory-draft-height, auto); scroll-padding-bottom: calc(var(--inventory-draft-clearance, 0px) + var(--space-3)); }
.order-book-page .inventory-sheet-scroll::after {
  content: "";
  display: block;
  height: var(--inventory-draft-clearance, 0px);
  pointer-events: none;
  overflow-anchor: none;
}
/* Save feedback shares the draft footer's scroll clearance, never the topbar. */
.sheet-feedback {
  position: fixed;
  right: var(--page-gutter);
  bottom: var(--space-4);
  left: calc(var(--sidebar-width, 0px) + var(--page-gutter));
  z-index: 50;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet-feedback > .sheet-save-status { min-width: 0; max-width: none; margin: 0; white-space: normal; overflow-wrap: anywhere; }
.sheet-feedback > .sheet-save-status:empty { display: none; }
.sheet-feedback > .save-bar { position: static; margin: 0; padding: 0; border: 0; }
/* Inventory's recovery footer already contains the same complete message. */
.inventory-page .sheet-feedback:has(> .save-bar:not([hidden])) > .sheet-save-status { display: none; }
/* Both idle and active refresh feedback stay outside the table's flow. */
.workspace-refresh-feedback-slot { position: fixed; z-index: 50; right: var(--page-gutter); left: calc(var(--sidebar-width, 0px) + var(--page-gutter)); bottom: var(--workspace-feedback-bottom, var(--space-4)); margin: 0; }
.workspace-refresh-feedback-slot:has(.workspace-refresh-feedback__message:not(:empty)) { padding: var(--space-4); border-top: 1px solid var(--line); background: var(--surface); }
.workspace-refresh-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); min-width: 0; }
.workspace-refresh-feedback__message { min-width: 0; margin: 0; white-space: normal; overflow-wrap: anywhere; }
.workspace-refresh-feedback[data-state="error"] .workspace-refresh-feedback__message { color: var(--red-ink); }
.workspace-shell > .workspace-content > main[data-controller~="workspace-refresh"] { padding-bottom: calc(var(--page-bottom) + var(--workspace-feedback-clearance, 0px)); }
.workspace-shell main[data-controller~="workspace-refresh"] :is(a, button, input, select, textarea, summary, [tabindex]) { scroll-margin-bottom: calc(var(--workspace-feedback-clearance, 0px) + var(--space-4)); }
@media (max-width: 760px) {
  .save-bar { flex-wrap: wrap; top: 0; padding: var(--space-3); }
  .save-bar__buttons { width: 100%; justify-content: flex-end; }
  .order-book-page > .save-bar { top: auto; bottom: calc(var(--mobile-nav-height, 70px) + var(--space-3)); }
  .sheet-feedback { bottom: calc(var(--mobile-nav-height, 70px) + var(--space-3)); padding: var(--space-3); }
  .workspace-refresh-feedback-slot { bottom: var(--workspace-feedback-bottom, calc(var(--mobile-nav-height, 70px) + var(--space-3))); }
  .workspace-refresh-feedback-slot:has(.workspace-refresh-feedback__message:not(:empty)) { padding: var(--space-3); }
}
