html:has(.invoice-dialog[open]),
body:has(.invoice-dialog[open]) {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.invoice-dialog-status[hidden] {
  display: none;
}

.invoice-dialog-status.is-error::before {
  animation: none;
  border-color: #c88173;
}
.invoice-open-button {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 13px;
  margin-top: 12px;
  padding: 13px 15px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(110deg, #fff 0%, #f7fbf8 100%);
  border: 1px solid #dce9e1;
  border-radius: 17px;
  box-shadow: 0 8px 22px rgba(44, 83, 64, .06);
  cursor: pointer;
}

.invoice-open-button:hover {
  border-color: #b7d6c4;
  box-shadow: 0 11px 26px rgba(44, 83, 64, .11);
}

.invoice-open-button:focus-visible {
  outline: 3px solid #72a88b;
  outline-offset: 3px;
}

.invoice-open-button__icon {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  color: #17624d;
  background: transparent;
}

.invoice-open-button__icon img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.invoice-open-button__copy {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.invoice-open-button__copy strong {
  font-size: clamp(19px, 5.4vw, 24px);
  font-weight: 800;
  line-height: 1.2;
}

.invoice-open-button__arrow {
  color: #397361;
}

.invoice-dialog {
  width: min(1040px, calc(100% - 28px));
  height: min(92dvh, 960px);
  max-width: none;
  max-height: 92dvh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #f2f6f5;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(18, 38, 30, .35);
}
.invoice-dialog[open] { animation: invoice-pop .28s cubic-bezier(.2, .8, .2, 1) both; }
.invoice-dialog::backdrop { background: rgba(17, 31, 25, .6); backdrop-filter: blur(6px); }
.invoice-dialog-shell { display: grid; width: 100%; height: 100%; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.invoice-dialog-header {
  display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 20px; background: #fff; border-bottom: 1px solid #e3ebe7;
}
.invoice-dialog-header span { display: block; margin-bottom: 3px; color: #5c8271; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.invoice-dialog-header h2 { margin: 0; font-family: Bricolage, Geist, sans-serif; font-size: 21px; font-weight: 500; line-height: 1.15; }
.invoice-dialog-close {
  display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; padding: 0;
  color: #34584a; background: #eef4f0; border: 1px solid #dbe7e0; border-radius: 50%; cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.invoice-dialog-close:hover { background: #e0ece5; transform: rotate(90deg); }
.invoice-dialog-close:focus-visible { outline: 3px solid #72a88b; outline-offset: 2px; }
.invoice-dialog-close svg { width: 18px; height: 18px; }
.invoice-dialog-frame { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #f2f6f5; }
.invoice-dialog-frame[hidden] { display: none; }
.invoice-dialog-status {
  display: grid; justify-items: center; gap: 10px; margin: 0; padding: 48px 24px;
  color: #526976; font-size: 13px; line-height: 1.5; text-align: center;
}
.invoice-dialog-status::before {
  content: ""; width: 38px; height: 38px; border: 3px solid #d8e6df; border-top-color: #2f9a77;
  border-radius: 50%; animation: invoice-spin .9s linear infinite;
}
@keyframes invoice-spin { to { transform: rotate(360deg); } }
@keyframes invoice-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .invoice-dialog { width: calc(100% - 16px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border-radius: 22px; }
  .invoice-dialog-header { min-height: 58px; padding: 8px 10px 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .invoice-dialog[open], .invoice-dialog-status::before { animation: none; }
  .invoice-dialog-close, .invoice-dialog-close:hover { transition: none; transform: none; }
}
