.pdf-cleaner-page textarea,
.pdf-cleaner-page input,
.pdf-cleaner-page button {
  font: inherit;
}

.pdf-cleaner-page textarea:focus-visible,
.pdf-cleaner-page input:focus-visible {
  outline: 3px solid rgba(31, 106, 74, 0.28);
  outline-offset: 2px;
}

.pdf-hero {
  max-width: 820px;
  margin-top: 46px;
  margin-bottom: 30px;
}

.pdf-hero h1 {
  font-size: clamp(38px, 6vw, 62px);
}

.pdf-cleaner-tool {
  overflow: visible;
}

.pdf-tool-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.pdf-tool-heading h2 {
  margin: 2px 0 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.pdf-tool-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.pdf-tool-kicker {
  margin: 0;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.pdf-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.pdf-editor-panel {
  min-width: 0;
  padding: 20px;
  background: var(--paper);
}

.pdf-editor-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.pdf-editor-label label {
  font-size: 13px;
  font-weight: 750;
}

.pdf-editor-label span {
  color: var(--muted-light);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pdf-editor-panel textarea {
  width: 100%;
  min-height: 330px;
  display: block;
  resize: vertical;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

.pdf-editor-panel textarea[readonly] {
  background: #f8f9f6;
}

.pdf-editor-panel textarea::placeholder {
  color: #98a29b;
}

.pdf-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
  padding: 18px 26px;
  border: 0;
  border-top: 1px solid var(--line);
}

.pdf-options legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

.pdf-options legend + * {
  clear: left;
}

.pdf-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
}

.pdf-options input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--green);
}

.pdf-cleaner-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 26px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 20px 20px;
  background: #faf9f5;
}

.pdf-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pdf-status.is-success {
  color: var(--green-dark);
  font-weight: 700;
}

.pdf-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.pdf-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.pdf-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.pdf-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.pdf-button-primary {
  min-width: 118px;
  border: 1px solid var(--green);
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 7px 18px rgba(31, 106, 74, 0.18);
}

.pdf-button-primary:hover:not(:disabled) {
  background: var(--green-dark);
}

.pdf-button-secondary {
  border: 1px solid var(--line-strong);
  color: var(--green-dark);
  background: #ffffff;
}

.pdf-button-secondary:hover:not(:disabled),
.pdf-button-quiet:hover:not(:disabled) {
  border-color: rgba(31, 106, 74, 0.42);
  background: var(--green-soft);
}

.pdf-button-quiet {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.pdf-guide {
  margin-top: 42px;
}

.pdf-heuristic-note {
  margin-top: 34px;
}

@media (max-width: 820px) {
  .pdf-editor-grid {
    grid-template-columns: 1fr;
  }

  .pdf-editor-panel textarea {
    min-height: 250px;
  }

  .pdf-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-cleaner-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .pdf-hero {
    margin-top: 34px;
  }

  .pdf-tool-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
  }

  .pdf-editor-panel {
    padding: 14px;
  }

  .pdf-editor-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .pdf-options {
    grid-template-columns: 1fr;
    padding: 17px 18px;
  }

  .pdf-cleaner-footer {
    padding: 18px;
  }

  .pdf-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-button {
    width: 100%;
    padding: 0 8px;
  }

  .pdf-button-primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media print {
  .pdf-cleaner-page .site-header,
  .pdf-cleaner-page .pdf-hero,
  .pdf-cleaner-page .pdf-editor-panel:first-child,
  .pdf-cleaner-page .pdf-options,
  .pdf-cleaner-page .pdf-cleaner-footer,
  .pdf-cleaner-page .trust-row,
  .pdf-cleaner-page .pdf-guide,
  .pdf-cleaner-page .site-footer {
    display: none !important;
  }

  .pdf-cleaner-page,
  .pdf-cleaner-page .page-shell,
  .pdf-cleaner-page .tool-card,
  .pdf-cleaner-page .pdf-editor-grid,
  .pdf-cleaner-page .pdf-editor-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .pdf-cleaner-page .pdf-editor-grid {
    display: block;
  }

  .pdf-cleaner-page .pdf-tool-heading {
    padding: 0 0 16px;
    border: 0;
  }

  .pdf-cleaner-page #pdf-output {
    min-height: 0;
    overflow: visible;
    border: 0;
    white-space: pre-wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdf-cleaner-page *,
  .pdf-cleaner-page *::before,
  .pdf-cleaner-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
