/* Scoped receipt component; the surrounding activation layout is unchanged. */
.receipt-host { position: relative; margin-top: -1px; isolation: isolate; text-align: center; }
.receipt-host .paper-slot { width: min(86%, 350px); height: 12px; padding: 3px 6px; position: relative; z-index: 3; margin: 0 auto; background: #a8a8a8; border-top: 1px solid #858585; box-shadow: 0 1px #f6f6f6, inset 0 -1px #7e7e7e; }
.receipt-host .paper-slot::before { content: ""; position: absolute; inset: 3px 6px; background: #272727; box-shadow: inset 0 2px 3px #000, 0 1px #f6f6f6; }
.receipt-host .paper-slot::after { content: ""; position: absolute; left: 11px; right: 11px; top: 8px; height: 13px; background: linear-gradient(#0005, transparent); pointer-events: none; }
/* The full paper remains in normal flow, reserving its final height before it
   moves. Only transform animates, so replay cannot shift surrounding controls. */
.receipt-host .paper-output { position: relative; z-index: 2; margin: -4px auto 0; padding: 0 12px 18px; overflow: hidden; width: min(calc(86% + 8px), 344px); }
.receipt-host .paper-shadow { padding-top: 0; filter: drop-shadow(0 5px 4px #00000022); transform: translateY(0); }
.receipt-host .receipt { position: relative; padding: 25px 23px 22px; color: #272724; background-color: #faf9f5; background-image: repeating-linear-gradient(0deg, #00000003 0, #00000003 1px, transparent 1px, transparent 3px), linear-gradient(95deg, #eeece6aa 0%, #ffffff00 12%, #ffffff55 48%, #eeece630 100%); font-family: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", monospace; font-size: 11px; line-height: 1.6; text-align: left; overflow-wrap: anywhere; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), 98% 100%, 96% calc(100% - 6px), 94% 100%, 92% calc(100% - 6px), 90% 100%, 88% calc(100% - 6px), 86% 100%, 84% calc(100% - 6px), 82% 100%, 80% calc(100% - 6px), 78% 100%, 76% calc(100% - 6px), 74% 100%, 72% calc(100% - 6px), 70% 100%, 68% calc(100% - 6px), 66% 100%, 64% calc(100% - 6px), 62% 100%, 60% calc(100% - 6px), 58% 100%, 56% calc(100% - 6px), 54% 100%, 52% calc(100% - 6px), 50% 100%, 48% calc(100% - 6px), 46% 100%, 44% calc(100% - 6px), 42% 100%, 40% calc(100% - 6px), 38% 100%, 36% calc(100% - 6px), 34% 100%, 32% calc(100% - 6px), 30% 100%, 28% calc(100% - 6px), 26% 100%, 24% calc(100% - 6px), 22% 100%, 20% calc(100% - 6px), 18% 100%, 16% calc(100% - 6px), 14% 100%, 12% calc(100% - 6px), 10% 100%, 8% calc(100% - 6px), 6% 100%, 4% calc(100% - 6px), 2% 100%, 0 calc(100% - 6px)); }
.receipt-host .receipt p { margin: 0; }
.receipt-host .receipt-brand { display: flex; align-items: center; justify-content: center; gap: 9px; }
.receipt-host .receipt-brand strong { font: 700 20px/1.3 "Courier New", monospace; letter-spacing: -.5px; white-space: nowrap; }
.receipt-host .receipt-monogram { display: grid; place-items: center; flex-shrink: 0; width: 27px; height: 27px; color: #faf9f5; background: #262624; font: 700 11px "Courier New", monospace; border-radius: 5px; }
.receipt-host .receipt .receipt-subtitle { text-align: center; font-size: 12px; margin-top: 10px; letter-spacing: 2px; }
.receipt-host .receipt .receipt-english { margin-top: 3px; text-align: center; color: #595953; font-size: 8px; letter-spacing: 1.5px; }
.receipt-host .receipt-divider { border-top: 1px dashed #77776e; margin: 16px 0; }
.receipt-host .receipt-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.receipt-host .product-line strong { font-size: 14px; min-width: 0; }
.receipt-host .product-line>span { flex-shrink: 0; }
.receipt-host .receipt .product-description { color: #696960; margin-top: 5px; font-size: 10px; }
.receipt-host .receipt-details { margin: 17px 0 0; display: grid; gap: 7px; }
.receipt-host .receipt-details>div { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: 10px; align-items: baseline; }
.receipt-host .receipt-details dt { color: #64645b; }
.receipt-host .receipt-details dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.receipt-host .price-line { align-items: center; justify-content: flex-end; }
.receipt-host .price-line>strong { font: 700 31px/1.2 "Courier New", monospace; letter-spacing: -1px; white-space: nowrap; }
.receipt-host .price-line small { font-size: 16px; letter-spacing: 0; margin-right: 4px; }
.receipt-host .receipt .currency-note { text-align: right; color: #6d6d64; font-size: 9px; margin-top: 4px; }
.receipt-host .receipt-meta { font-size: 9px; margin-top: 0; gap: 5px; }
.receipt-host .receipt-barcode { height: 32px; margin-top: 15px; opacity: .86; background: repeating-linear-gradient(90deg, #202020 0 2px, transparent 2px 4px, #202020 4px 5px, transparent 5px 8px, #202020 8px 12px, transparent 12px 14px, #202020 14px 16px, transparent 16px 19px, #202020 19px 20px, transparent 20px 23px, #202020 23px 26px, transparent 26px 29px); }
.receipt-host .receipt .receipt-thanks { font-size: 11px; text-align: center; letter-spacing: 1.4px; font-weight: 700; margin-top: 17px; }
.receipt-host .receipt .receipt-domain { font-size: 9px; text-align: center; color: #5a5a51; margin-top: 4px; }
.receipt-host .receipt-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; }
.receipt-host .receipt-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 46px; padding: 12px 10px; font-size: 13px; line-height: 1.5; }
.receipt-host .receipt-actions button>span { min-width: 0; overflow-wrap: anywhere; }
.receipt-host .receipt-actions svg { width: 16px; height: 16px; }
.receipt-host .receipt-save { color: var(--navy); font-weight: 700; }
.receipt-host .receipt-status { min-height: 38px; margin: 10px 0 0; color: #515151; font-size: 11px; line-height: 1.7; }
.receipt-host .receipt-image-open { margin-top: 4px; font-size: 11px; min-height: 32px; }
.receipt-host .receipt-image-dialog { width: min(440px, calc(100% - 24px)); padding: 3px; max-height: calc(100dvh - 32px); overflow: auto; color: var(--text); border: 0; }
.receipt-host .receipt-image-dialog::backdrop { background: #001e1ec9; }
.receipt-host .receipt-image-dialog .titlebar { position: sticky; top: 0; z-index: 1; gap: 12px; height: auto; min-height: 36px; }
.receipt-host .receipt-image-close { flex-shrink: 0; min-width: 48px; min-height: 28px; padding: 4px 8px; font-size: 12px; line-height: 1.5; }
.receipt-host .receipt-image-dialog-body { padding: 15px; text-align: center; }
.receipt-host .receipt-image-dialog-body>p { margin: 0 0 15px; font-size: 12px; line-height: 1.7; }
.receipt-host #receipt-image-preview { display: block; width: min(100%, 320px); height: auto; margin: 0 auto; }
.receipt-host .receipt-download { display: block; padding: 14px; margin-top: 16px; text-align: center; text-decoration: none; }
.receipt-host[data-state="ready"] .paper-shadow { transform: translateY(calc(-100% - 8px)); }
.receipt-host[data-state="printing"] .paper-shadow { animation: receipt-feed-paper 3.4s linear both; will-change: transform; }
.receipt-host[data-state="complete"] .paper-shadow { transform: translateY(0); }
.receipt-host[data-state="printing"] .paper-slot span { position: absolute; right: 0; top: 3px; width: 2px; height: 4px; background: #173a2a; animation: receipt-printing-light .48s steps(2, end) infinite; }
@keyframes receipt-feed-paper {
  0% { transform: translateY(calc(-100% - 8px)); }
  8% { transform: translateY(-96%); }
  86% { transform: translateY(-10%); }
  96% { transform: translateY(-1%); }
  100% { transform: translateY(0); }
}
@keyframes receipt-printing-light { 50% { background: #68e792; } }
@media (max-width: 760px) {
  .receipt-host .receipt { padding-left: 19px; padding-right: 19px; }
  .receipt-host .paper-output { width: min(calc(94% + 8px), 344px); }
  .receipt-host .paper-slot { width: min(94%, 350px); }
}
@media (max-width: 360px) {
  .receipt-host .receipt-brand { gap: 7px; }
  .receipt-host .receipt-brand strong { font-size: 16px; }
  .receipt-host .receipt-monogram { width: 23px; height: 23px; font-size: 10px; }
  .receipt-host .receipt { padding-left: 15px; padding-right: 15px; }
  .receipt-host .price-line>strong { font-size: 24px; }
  .receipt-host .price-line small { font-size: 11px; }
  .receipt-host .receipt-details { font-size: 10px; }
  .receipt-host .receipt-meta { font-size: 8px; }
  .receipt-host .receipt-actions { gap: 8px; }
  .receipt-host .receipt-actions button { gap: 6px; font-size: 12px; padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .receipt-host .paper-shadow { transform: none !important; animation: none !important; will-change: auto; }
  .receipt-host .paper-slot span { animation: none !important; }
}
