.product-pdf-dialog {
  width: min(68rem, calc(100% - 2rem));
  height: calc(100vh - 2rem);
  height: min(56rem, calc(100dvh - 2rem));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #e4e4e7;
  border-radius: 1rem;
  background: #fff;
  color: #18181b;
  overflow: hidden;
}

.product-pdf-dialog::backdrop { background: rgb(24 24 27 / 65%); }
.product-pdf-layout { display: flex; flex-direction: column; height: 100%; }
.product-pdf-header, .product-pdf-toolbar, .product-pdf-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.product-pdf-header, .product-pdf-toolbar {
  flex: none;
  padding: .5rem .875rem;
  border-bottom: 1px solid #e4e4e7;
}
.product-pdf-header { justify-content: space-between; }
.product-pdf-header h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9375rem;
  font-weight: 700;
}
.product-pdf-toolbar { justify-content: space-between; flex-wrap: wrap; }
.product-pdf-controls span {
  min-width: 3rem;
  text-align: center;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}
.product-pdf-dialog button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 .625rem;
  border: 1px solid #d4d4d8;
  border-radius: .5rem;
  color: #27272a;
  background: #fff;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}
.product-pdf-dialog button:not(:disabled):hover { background: #eff6ff; border-color: #93c5fd; }
.product-pdf-dialog button:disabled { color: #71717a; background: #f4f4f5; cursor: default; }
.product-pdf-notice { padding: .75rem .875rem; font-size: .875rem; }
.product-pdf-notice a { color: #1d4ed8; text-decoration: underline; }
.product-pdf-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 12px;
  background: #e4e4e7;
}
.product-pdf-scroll canvas {
  display: block;
  max-width: none;
  margin-inline: auto;
  background: #fff;
  box-shadow: 0 1px 4px rgb(24 24 27 / 18%);
}

@media (max-width: 640px) {
  .product-pdf-dialog {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .product-pdf-header { padding-top: max(.5rem, env(safe-area-inset-top)); }
  .product-pdf-toolbar { justify-content: center; }
  .product-pdf-scroll { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
