.pdfwb-open {
  overflow: hidden !important;
}

.pdfwb-layer,
.pdfwb-layer * {
  box-sizing: border-box;
}

.pdfwb-layer {
  --pdfwb-ink: #12243a;
  --pdfwb-muted: #607188;
  --pdfwb-line: #dce5ec;
  --pdfwb-teal: #087f73;
  --pdfwb-teal-dark: #05665d;
  --pdfwb-orange: #ef7d2d;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
  background:
    radial-gradient(circle at 15% 10%, rgba(8, 127, 115, 0.2), transparent 34%),
    rgba(8, 22, 38, 0.76);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.pdfwb-layer[hidden] {
  display: none !important;
}

.pdfwb-dialog {
  width: min(760px, 100%);
  max-height: min(900px, calc(100vh - 24px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--pdfwb-ink);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  box-shadow: 0 32px 90px rgba(0, 14, 28, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pdfwb-header {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 18px 22px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(135deg, #0b3f50, #087f73);
}

.pdfwb-brand {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.pdfwb-eyebrow {
  margin: 0 0 3px;
  color: #c7fff7;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pdfwb-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.25rem, 3vw, 1.72rem);
  font-weight: 780;
  line-height: 1.15;
}

.pdfwb-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font: 300 1.75rem/1 system-ui, sans-serif;
  transition: background 160ms ease, transform 160ms ease;
}

.pdfwb-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.pdfwb-close:focus-visible,
.pdfwb-action:focus-visible,
.pdfwb-upload:focus-within,
.pdfwb-field input:focus-visible,
.pdfwb-field select:focus-visible,
.pdfwb-field textarea:focus-visible {
  outline: 3px solid rgba(239, 125, 45, 0.42);
  outline-offset: 2px;
}

.pdfwb-body {
  overflow-y: auto;
  padding: clamp(18px, 4vw, 30px);
  scrollbar-width: thin;
  scrollbar-color: #a9bbb9 transparent;
}

.pdfwb-summary {
  margin: 0 0 16px;
  color: #33475d;
  font-size: 1rem;
  line-height: 1.6;
}

.pdfwb-privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #c7ebe6;
  border-radius: 14px;
  color: #19584f;
  background: #f0fbf9;
}

.pdfwb-privacy > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: var(--pdfwb-teal);
  font-weight: 900;
}

.pdfwb-privacy p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.pdfwb-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 86px;
  padding: 16px;
  border: 1.5px dashed #a8c7c2;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(8, 127, 115, 0.035), transparent),
    #fbfdfd;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.pdfwb-upload:hover {
  border-color: var(--pdfwb-teal);
  background-color: #f5fbfa;
  transform: translateY(-1px);
}

.pdfwb-upload-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--pdfwb-teal), #0aa18f);
  box-shadow: 0 9px 22px rgba(8, 127, 115, 0.2);
  font-size: 1.55rem;
  font-weight: 500;
}

.pdfwb-upload > span:nth-child(2) {
  min-width: 0;
}

.pdfwb-upload strong,
.pdfwb-upload small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdfwb-upload strong {
  color: var(--pdfwb-ink);
  font-size: 0.94rem;
}

.pdfwb-upload small {
  margin-top: 4px;
  color: var(--pdfwb-muted);
  font-size: 0.77rem;
}

.pdfwb-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pdfwb-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pdfwb-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.pdfwb-field-wide {
  grid-column: 1 / -1;
}

.pdfwb-field > span {
  color: #34495f;
  font-size: 0.78rem;
  font-weight: 760;
}

.pdfwb-field input,
.pdfwb-field select,
.pdfwb-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd8e2;
  border-radius: 12px;
  color: var(--pdfwb-ink);
  background: #fff;
  font: 500 0.88rem/1.35 inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.pdfwb-field textarea {
  min-height: 112px;
  resize: vertical;
}

.pdfwb-field input:hover,
.pdfwb-field select:hover,
.pdfwb-field textarea:hover {
  border-color: #91aaa6;
}

.pdfwb-auxiliary {
  margin-top: 16px;
}

.pdfwb-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--pdfwb-orange);
  border-radius: 4px 12px 12px 4px;
  color: #66503f;
  background: #fff8f2;
  font-size: 0.79rem;
  line-height: 1.55;
}

.pdfwb-result {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #d7e3ea;
  border-radius: 13px;
  color: #355169;
  background: #f5f8fa;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.5;
}

.pdfwb-result[hidden] {
  display: none;
}

.pdfwb-result[data-kind="progress"] {
  border-color: #bfd9ed;
  color: #235e83;
  background: #f0f8fe;
}

.pdfwb-result[data-kind="success"] {
  border-color: #a9dfcf;
  color: #176b5c;
  background: #effbf7;
}

.pdfwb-result[data-kind="error"] {
  border-color: #f4c0bd;
  color: #9c2824;
  background: #fff4f3;
}

.pdfwb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 30px);
  border-top: 1px solid var(--pdfwb-line);
  background: #fbfcfd;
}

.pdfwb-footer > span {
  color: var(--pdfwb-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.pdfwb-action {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--pdfwb-teal), var(--pdfwb-teal-dark));
  box-shadow: 0 9px 20px rgba(8, 127, 115, 0.2);
  cursor: pointer;
  font: 760 0.88rem/1 inherit;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.pdfwb-action:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(8, 127, 115, 0.26);
}

.pdfwb-action:disabled,
.pdfwb-close:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 620px) {
  .pdfwb-layer {
    align-items: end;
    padding: 0;
  }

  .pdfwb-dialog {
    width: 100%;
    max-height: 96dvh;
    border-radius: 24px 24px 0 0;
  }

  .pdfwb-header {
    grid-template-columns: 45px minmax(0, 1fr) 38px;
    min-height: 80px;
    padding: 14px 16px;
  }

  .pdfwb-brand {
    width: 45px;
    height: 45px;
    border-radius: 13px;
  }

  .pdfwb-close {
    width: 38px;
    height: 38px;
  }

  .pdfwb-body {
    padding: 18px 16px;
  }

  .pdfwb-fields {
    grid-template-columns: 1fr;
  }

  .pdfwb-field-wide {
    grid-column: auto;
  }

  .pdfwb-footer {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .pdfwb-action {
    width: 100%;
  }

  .pdfwb-footer > span {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdfwb-layer *,
  .pdfwb-layer *::before,
  .pdfwb-layer *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .pdfwb-dialog,
  .pdfwb-upload,
  .pdfwb-field input,
  .pdfwb-field select,
  .pdfwb-field textarea,
  .pdfwb-action,
  .pdfwb-close {
    border: 1px solid CanvasText;
  }
}
