.pdfp-button-icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdfp-workspace {
  scroll-margin-top: 1rem;
}

.pdfp-card {
  padding: clamp(.75rem, 2vw, 1.25rem);
  border: 1px solid var(--border-color, #dce3ee);
}

.pdfp-dropzone {
  min-height: 20rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .8rem;
  padding: 2.5rem 1rem;
  text-align: center;
  border: 2px dashed color-mix(in srgb, var(--primary, #2f66ec) 30%, var(--border-color, #dce3ee));
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--primary, #2f66ec) 5%, var(--surface, #fff));
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.pdfp-dropzone:is(:hover, :focus-visible, .is-dragging) {
  border-color: var(--primary, #2f66ec);
  background: color-mix(in srgb, var(--primary, #2f66ec) 9%, var(--surface, #fff));
  outline: none;
}

.pdfp-dropzone.is-dragging {
  transform: scale(.995);
}

.pdfp-dropzone h2,
.pdfp-dropzone p,
.pdfp-section-heading h2,
.pdfp-section-heading p,
.pdfp-result h2,
.pdfp-result p,
.pdfp-owner-body p,
.pdfp-information-grid h2,
.pdfp-information-grid p {
  margin: 0;
}

.pdfp-dropzone p,
.pdfp-section-heading p,
.pdfp-owner-body p,
.pdfp-result p,
.pdfp-information-grid p {
  color: var(--muted, #65748b);
}

.pdfp-drop-icon,
.pdfp-result-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.pdfp-drop-icon {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 1.4rem;
  color: var(--primary, #2f66ec);
  background: color-mix(in srgb, var(--primary, #2f66ec) 13%, transparent);
}

.pdfp-drop-icon svg {
  width: 3rem;
  height: 3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdfp-editor {
  display: grid;
  gap: 1rem;
}

.pdfp-global-alert {
  margin-top: 1rem;
}

.pdfp-editor[hidden],
.pdfp-progress[hidden],
.pdfp-result[hidden] {
  display: none;
}

.pdfp-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  padding: .85rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface-raised, #fff) 94%, var(--primary, #2f66ec));
}

.pdfp-file-badge {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: .8rem;
  color: #fff;
  background: #df252f;
  font-size: .75rem;
  font-weight: 800;
}

.pdfp-file-copy {
  min-width: 0;
  display: grid;
  gap: .2rem;
}

.pdfp-file-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdfp-file-copy span {
  color: var(--muted, #65748b);
  font-size: .9rem;
}

.pdfp-section,
.pdfp-owner,
.pdfp-result {
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: 1rem;
  background: var(--surface, #fff);
}

.pdfp-section {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.25rem);
}

.pdfp-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pdfp-section-heading > div {
  display: grid;
  gap: .3rem;
}

.pdfp-encryption-badge {
  padding: .38rem .65rem;
  border-radius: 999px;
  color: #17663a;
  background: color-mix(in srgb, #22a559 14%, transparent);
  border: 1px solid color-mix(in srgb, #22a559 30%, var(--border-color, #dce3ee));
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.pdfp-optional-badge {
  padding: .38rem .65rem;
  border-radius: 999px;
  color: var(--primary, #2f66ec);
  background: color-mix(in srgb, var(--primary, #2f66ec) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary, #2f66ec) 30%, var(--line, #dce3ee));
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.pdfp-opening-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem;
  border: 2px solid var(--line, #dce3ee);
  border-radius: .9rem;
  color: var(--text, #172033);
  background: var(--surface-alt, #f6f8fc);
  cursor: pointer;
}

.pdfp-opening-choice:has(input:checked) {
  border-color: var(--primary, #2f66ec);
  background: color-mix(in srgb, var(--primary, #2f66ec) 9%, var(--surface, #fff));
}

.pdfp-opening-choice input {
  width: 1.3rem;
  height: 1.3rem;
  margin-top: .12rem;
  accent-color: var(--primary, #2f66ec);
}

.pdfp-opening-choice span {
  display: grid;
  gap: .25rem;
}

.pdfp-opening-choice small {
  color: var(--muted, #65748b);
  font-weight: 400;
}

.pdfp-permissions-only-note {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .85rem;
  border: 1px solid color-mix(in srgb, #22a559 32%, var(--line, #dce3ee));
  border-radius: .85rem;
  color: var(--text, #172033);
  background: color-mix(in srgb, #22a559 9%, var(--surface, #fff));
}

.pdfp-permissions-only-note svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  fill: none;
  stroke: #22a559;
  stroke-width: 2;
}

.pdfp-permissions-only-note span {
  display: grid;
  gap: .2rem;
}

#pdfp-opening-fields {
  display: grid;
  gap: 1rem;
}

#pdfp-opening-fields[hidden],
.pdfp-permissions-only-note[hidden] {
  display: none;
}

.pdfp-password-grid,
.pdfp-permissions-grid,
.pdfp-information-grid {
  display: grid;
  gap: .85rem;
}

.pdfp-field {
  min-width: 0;
  display: grid;
  gap: .45rem;
  color: var(--text, #172033);
  font-weight: 700;
}

.pdfp-field small {
  min-height: 1.2em;
  color: var(--muted, #65748b);
  font-weight: 400;
}

.pdfp-field input,
.pdfp-field select,
.pdfp-owner-result input {
  width: 100%;
  min-height: 3rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: .75rem;
  color: var(--text, #172033);
  background: var(--surface, #fff);
  font: inherit;
}

.pdfp-field input:focus,
.pdfp-field select:focus,
.pdfp-owner-result input:focus {
  border-color: var(--primary, #2f66ec);
  outline: 3px solid color-mix(in srgb, var(--primary, #2f66ec) 18%, transparent);
}

.pdfp-input-action {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
}

.pdfp-input-action > input {
  min-width: 0;
}

.pdfp-icon-button {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: .75rem;
  color: var(--text, #172033);
  background: var(--surface, #fff);
  cursor: pointer;
}

.pdfp-icon-button:hover {
  border-color: var(--primary, #2f66ec);
  color: var(--primary, #2f66ec);
}

.pdfp-icon-button svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdfp-strength {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted, #65748b);
  font-size: .88rem;
}

.pdfp-strength-track {
  width: min(14rem, 55%);
  height: .45rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted, #65748b) 20%, transparent);
}

.pdfp-strength-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #d92d20;
  transition: width .2s ease, background-color .2s ease;
}

.pdfp-print-field {
  max-width: 30rem;
}

.pdfp-permission {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: .85rem;
  color: var(--text, #172033);
  background: var(--surface-alt, #f6f8fc);
  cursor: pointer;
}

.pdfp-permission:has(input:checked) {
  border-color: var(--primary, #2f66ec);
  background: color-mix(in srgb, var(--primary, #2f66ec) 8%, var(--surface, #fff));
}

.pdfp-permission input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: .12rem;
  accent-color: var(--primary, #2f66ec);
}

.pdfp-permission span {
  display: grid;
  gap: .2rem;
}

.pdfp-permission small {
  color: var(--muted, #65748b);
  font-weight: 400;
}

.pdfp-permission strong {
  color: var(--text, #172033);
}

.pdfp-card .btn-secondary {
  color: var(--text, #172033);
}

.pdfp-owner {
  overflow: hidden;
}

.pdfp-owner summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  list-style: none;
  cursor: pointer;
}

.pdfp-owner summary::-webkit-details-marker {
  display: none;
}

.pdfp-owner summary span {
  display: grid;
  gap: .2rem;
}

.pdfp-owner summary small {
  color: var(--muted, #65748b);
  font-weight: 400;
}

.pdfp-owner summary > svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform .2s ease;
}

.pdfp-owner[open] summary > svg {
  transform: rotate(180deg);
}

.pdfp-owner-body {
  display: grid;
  gap: .9rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border-color, #dce3ee);
  padding-top: 1rem;
}

.pdfp-owner-input {
  grid-template-columns: minmax(0, 1fr) auto;
}

.pdfp-owner-input .btn {
  grid-column: 1 / -1;
}

.pdfp-permission-note {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: 0;
  padding: .85rem;
  border-radius: .85rem;
  color: var(--muted, #65748b);
  background: color-mix(in srgb, #f5a623 9%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, #f5a623 28%, var(--border-color, #dce3ee));
}

.pdfp-permission-note svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.pdfp-action-dock {
  position: sticky;
  bottom: .75rem;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem;
  padding: .7rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
  box-shadow: 0 .8rem 2rem color-mix(in srgb, #09111f 14%, transparent);
  backdrop-filter: blur(14px);
}

.pdfp-action-dock .btn {
  min-height: 3.25rem;
  justify-content: center;
}

.pdfp-progress {
  padding: 1rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: 1rem;
  background: var(--surface, #fff);
}

.pdfp-progress-track {
  height: .75rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #2f66ec) 12%, transparent);
}

.pdfp-progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary, #2f66ec), #7657f5);
  transition: width .25s ease;
}

.pdfp-progress p {
  margin: .65rem 0 0;
  color: var(--muted, #65748b);
}

.pdfp-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding: 1rem;
  border-color: color-mix(in srgb, #22a559 42%, var(--border-color, #dce3ee));
  background: color-mix(in srgb, #22a559 6%, var(--surface, #fff));
}

.pdfp-result-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  color: #13733c;
  background: color-mix(in srgb, #22a559 15%, transparent);
}

.pdfp-result-icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdfp-result-copy {
  min-width: 0;
}

.pdfp-owner-result {
  grid-column: 1 / -1;
  display: grid;
  gap: .45rem;
  padding-top: .9rem;
  border-top: 1px solid color-mix(in srgb, #22a559 25%, var(--border-color, #dce3ee));
}

.pdfp-information-grid article {
  padding: 1.1rem;
}

.pdfp-information-grid article {
  display: grid;
  gap: .45rem;
}

.pdfp-card :disabled {
  cursor: not-allowed;
  opacity: .62;
}

@media (min-width: 48rem) {
  .pdfp-password-grid,
  .pdfp-permissions-grid,
  .pdfp-information-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdfp-owner-input {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .pdfp-owner-input .btn {
    grid-column: auto;
  }
}

@media (max-width: 40rem) {
  .pdfp-file-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pdfp-file-row .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pdfp-section-heading,
  .pdfp-result {
    align-items: flex-start;
  }

  .pdfp-result {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pdfp-result > .btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .pdfp-action-dock {
    grid-template-columns: 1fr;
  }

  .pdfp-owner-result .pdfp-input-action {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pdfp-owner-result .btn {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdfp-dropzone,
  .pdfp-strength-track span,
  .pdfp-progress-track span,
  .pdfp-owner summary > svg {
    transition: none;
  }
}
