#receipt-main-window {
  container: receipt-frame / inline-size;
  --receipt-shell-head: 44px;
  --receipt-shell-action: 32px;
  --receipt-shell-gap: 24px;
  --receipt-shell-vertical: 40px;
  position: fixed;
  inset: 0;
  width: min(var(--receipt-shell-width, 900px), calc(100vw - var(--receipt-shell-gap)));
  height: min(var(--receipt-shell-height, 610px), calc(100dvh - var(--receipt-shell-vertical)));
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #a9c0c5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px #17334e42;
}
#receipt-main-window:popover-open, #receipt-main-window:not([popover]):not([hidden]) { display: flex; flex-direction: column; }
#receipt-main-window:not([popover]) { z-index: 16; }
#receipt-main-window::backdrop { background: #152e4640; backdrop-filter: blur(2px); pointer-events: none; }
#receipt-main-window[data-maximized] { --receipt-shell-rendered-width: calc(100vw - 12px); --receipt-shell-rendered-height: calc(100dvh - 12px); }
#receipt-main-window > header {
  position: relative;
  min-height: var(--receipt-shell-head);
  flex: 0 0 var(--receipt-shell-head);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 14px;
  background: linear-gradient(110deg, #153144 10%, #204c5b 59%, #29646a);
  color: #fff8e9;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
#receipt-main-window > header::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, #edbc64 0, #edbc64 80px, #9acabc 80px, transparent 68%);
  pointer-events: none;
}
#receipt-main-window .receipt-window-title {
  flex: 1;
  display: block !important;
  outline: none !important;
  min-width: 0;
  margin: 0;
  color: #fff8e9 !important;
  font: 600 14px/1.2 'Segoe UI', system-ui, sans-serif !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
#receipt-main-window .receipt-window-title span { margin: 0 !important; padding: 0 !important; }
#receipt-main-window .receipt-window-buttons { display: flex; }
#receipt-main-window .receipt-window-back {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: var(--receipt-shell-action) !important;
  padding: 0 7px !important;
  border: 1px solid #bdd2cd !important;
  border-radius: 5px;
  background: #eff7f5 !important;
  color: #204c5b !important;
  font: 600 12px 'Segoe UI', system-ui, sans-serif;
}
#receipt-main-window .receipt-window-back svg { width: 14px; height: 14px; }
#receipt-main-window .receipt-window-back[hidden] { display: none !important; }
#receipt-main-window .receipt-window-buttons > button {
  display: grid;
  place-items: center;
  width: var(--receipt-shell-action) !important;
  min-width: var(--receipt-shell-action) !important;
  min-height: var(--receipt-shell-action) !important;
  height: var(--receipt-shell-action) !important;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 5px;
  background: transparent !important;
  color: #fff8e9 !important;
}
#receipt-main-window .receipt-window-buttons svg { width: 16px; height: 16px; pointer-events: none; }
#receipt-main-window .receipt-window-buttons > button:hover { background: #ffffff22 !important; }
#receipt-main-window .receipt-window-buttons > .receipt-window-close:hover { background: #9f4849 !important; }
#receipt-main-window > header:focus-visible, #receipt-main-window .receipt-window-buttons > button:focus-visible,
#receipt-main-window > .receipt-window-resize:focus-visible { outline: 2px solid #f2c96f !important; outline-offset: -2px; }
#receipt-main-window > .receipt-window-body { flex: 1; min-height: 0; overflow: hidden; position: relative; background: #fff; container-type: size; }
#receipt-main-window iframe { display: block; width: 100%; height: 100%; border: 0; }
.receipt-bounded-frame { box-sizing: border-box !important; }
.receipt-bounded-frame > header { touch-action: none !important; cursor: grab; }
.receipt-bounded-frame > .receipt-window-resize {
  appearance: none !important;
  position: absolute;
  display: grid !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 4;
  align-items: end;
  justify-items: end;
  border: 0 !important;
  border-radius: 4px;
  cursor: nwse-resize;
  touch-action: none;
}
.receipt-bounded-frame > .receipt-window-resize svg {
  width: 14px !important;
  height: 14px !important;
  pointer-events: none;
  color: #476773 !important;
  opacity: 0;
}
.receipt-bounded-frame > [data-corner="bottom-right"] svg { opacity: .85; }
.receipt-bounded-frame > .receipt-window-resize:is(:hover,:focus-visible) svg { opacity: 1; }
.receipt-bounded-frame > .receipt-window-resize:focus-visible { outline: 1px solid #bd8f42 !important; outline-offset: -1px; }
.receipt-bounded-frame > [data-corner="bottom-right"] { right: 3px; bottom: 3px; }
.receipt-bounded-frame > [data-corner="bottom-left"] { left: 3px; bottom: 3px; transform: scaleX(-1); cursor: nesw-resize; }
.receipt-bounded-frame > [data-corner^="top"] { top: 2px; width: 9px !important; height: 17px !important; }
.receipt-bounded-frame > [data-corner^="top"] svg { width: 8px !important; height: 8px !important; color: #fff3d8 !important; }
.receipt-bounded-frame > [data-corner="top-left"] { left: 2px; transform: rotate(180deg); }
.receipt-bounded-frame > [data-corner="top-right"] { right: 2px; transform: scaleY(-1); cursor: nesw-resize; }
.receipt-bounded-frame:is(.purchase-documents-dialog, .p68-config-window) { display: flex; flex-direction: column; overflow: hidden; }
.receipt-bounded-frame > :is(.purchase-documents-body, .p66-window-body) { min-height: 0; overflow: auto; }
.receipt-confirm-dialog.receipt-bounded-frame[open] { display: flex; flex-direction: column; overflow: hidden; }
.receipt-confirm-dialog.receipt-bounded-frame > p { min-height: 0; overflow: auto; }
.receipt-confirm-dialog.receipt-bounded-frame > :is(header, form) { flex: 0 0 auto; }
#receipt-window-dock {
  position: fixed;
  inset: auto 12px max(12px, env(safe-area-inset-bottom)) auto;
  margin: 0;
  min-height: 40px;
  z-index: 17;
  padding: 0 12px;
  border: 1px solid #49777b;
  border-radius: 7px;
  background: #244f58 !important;
  color: #fff6e4 !important;
  font: 600 13px 'Segoe UI', system-ui, sans-serif;
}
#receipt-window-dock:focus-visible { outline: 2px solid #f2c96f !important; outline-offset: -2px; }
#receipt-main-window:not([popover])[hidden], #receipt-window-dock:not([popover])[hidden] { display: none !important; }
@media (max-width: 767px), (pointer: coarse) {
  #receipt-main-window { --receipt-shell-head: 48px; --receipt-shell-action: 44px; --receipt-shell-gap: 16px; --receipt-shell-vertical: 44px; }
  #receipt-window-dock { min-height: 44px; }
}
@container receipt-frame (max-width: 390px) {
  #receipt-main-window > header:has(.receipt-window-back:not([hidden])) .receipt-window-title span { display: none; }
}
