/* Shared close controls for staff, library and customer/technician web windows.
   Header/window geometry stays in surface-system and each surface's layout.
   Only explicitly marked close buttons receive this treatment, never Cancel,
   remove-line, payment or workflow actions. Existing click handlers stay intact. */
html body button.window-close {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  align-self: flex-start;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  margin: 0 0 0 auto !important;
  border: 1px solid #6d87a5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #214e80 !important;
  font-size: 26px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-decoration: none;
  box-shadow: 0 2px 5px #10284024 !important;
  cursor: pointer;
  touch-action: manipulation;
  transform: none !important;
  transition: background-color 150ms ease, border-color 150ms ease,
    color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}
html body button.window-close svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  pointer-events: none;
}
@media (hover: hover) {
  html body button.window-close:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #e1edff !important;
    border-color: #2563eb !important;
    color: #143f83 !important;
    box-shadow: 0 3px 9px #10284040 !important;
  }
}
html body button.window-close:focus-visible {
  outline: 3px solid #68b8ff !important;
  outline-offset: 3px;
}
html body button.window-close:active:not(:disabled):not([aria-disabled="true"]) {
  background: #c7dcfa !important;
  border-color: #1749a5 !important;
  color: #123468 !important;
  box-shadow: inset 0 2px 4px #10284050 !important;
  transform: translateY(1px) scale(.96) !important;
}
html body button.window-close:is(:disabled,[aria-disabled="true"]) {
  background: #edf1f5 !important;
  border-color: #c7d1de !important;
  color: #6b7c91 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}
/* Close-only forms and header action groups keep the same right-hand anchor.
   Auto margin on a close button alone cannot push its enclosing group. */
body :is(dialog,.drawer,[aria-modal="true"]) header > :is(div,form):has(> .window-close) {
  margin-left: auto;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  html body button.window-close { transition: none; }
  html body button.window-close:active:not(:disabled):not([aria-disabled="true"]) { transform: none !important; }
}
