.pdf-editor-page .page::before, .pdf-editor-page .page::after { content: none; }
.pdf-edit-main { max-width: 1200px; margin: 36px auto 0; }
.pdf-edit-head h1 { margin: 0; font-size: 40px; line-height: 1.15; }
.pdf-edit-head p { margin: 10px 0 24px; color: var(--muted); }
.pdf-edit-start .upload-box {
  width: 100%; min-height: 180px; padding: 20px; margin: 0; align-items: center; justify-content: center;
  border: 1px dashed #bd8f94; border-radius: 8px; background: #fff8f7;
}
.pdf-edit-start .upload-box.is-over { background: #ffedeb; border-color: var(--action-fill); }
.pdf-edit-start .upload-hint { margin: 0; text-align: center; }
.pdf-edit-start button { min-height: 44px; }
.pdf-edit-start #edit-demo { width: auto; }
.pdf-edit-next-steps { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--quiet-border); }
.pdf-edit-next-steps .tool-button { width: auto; min-height: 44px; padding: 6px 10px; font-size: 14px; }
.pdf-edit-status { margin: 12px 0; color: var(--ink); }
.pdf-edit-status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.pdf-edit-status.is-error { color: #962735; }
.pdf-edit-workspace { margin-top: 18px; border: 1px solid var(--quiet-border); border-radius: 8px; background: #fff; }
.pdf-edit-filebar, .pdf-edit-tools, .pdf-edit-options, .pdf-edit-marks {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px;
}
.pdf-edit-filebar { justify-content: space-between; }
.pdf-edit-filebar strong { overflow-wrap: anywhere; min-width: 0; }
.pdf-edit-actions, .pdf-edit-modes, .pdf-edit-history, .pdf-edit-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pdf-edit-actions { gap: 8px; }
.pdf-edit-actions :is(.tool-button, .button), .pdf-edit-options .tool-button, .pdf-edit-marks .tool-button {
  width: auto; min-height: 44px; padding: 8px 12px; font-size: 14px;
}
.pdf-edit-tools, .pdf-edit-options, .pdf-edit-marks { border-top: 1px solid var(--quiet-border); }
.pdf-edit-nav { margin-inline-start: auto; }
.pdf-edit-tools button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer;
}
.pdf-edit-tools button:hover:not(:disabled), .pdf-edit-tools [aria-pressed="true"] { border-color: #dcaaae; background: #fff0ef; color: var(--action-hover); }
.pdf-edit-tools button:disabled { opacity: .38; cursor: default; }
.pdf-edit-tools svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pdf-edit-tools .pdf-edit-replace-mode { display: inline-flex; gap: 8px; width: auto; padding: 0 10px; font: inherit; font-weight: 750; border-color: var(--quiet-border); }
.pdf-edit-replace-panel { padding: 10px 12px; border-top: 1px solid var(--quiet-border); }
.pdf-edit-replace-panel > label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 750; }
.pdf-edit-replace-panel select { width: min(100%, 42ch); }
.pdf-edit-replace-panel p { margin: 7px 0 0; font-size: 14px; }
.pdf-edit-replace-panel p:empty { margin: 0; }
.pdf-edit-scan-options { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.pdf-edit-scan-options label { font-size: 14px; font-weight: 750; }
.pdf-edit-scan-options select { width: auto; font-size: 16px; }
.pdf-edit-scan-options button { width: auto; min-height: 44px; font-size: 14px; padding: 8px 12px; }
.pdf-edit-scan-options[hidden], .pdf-edit-scan-options [hidden] { display: none; }
.pdf-edit-inline {
  position: absolute; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px;
  gap: 3px; align-items: start; border-radius: 5px; box-shadow: 0 2px 12px #1a1f3d26;
}
.pdf-edit-inline[hidden] { display: none; }
.pdf-edit-workspace .pdf-edit-inline input { width: 100%; min-height: 44px; font-size: max(16px, var(--inline-font, 16px)); border: 2px solid var(--action-fill); }
.pdf-edit-inline :is(.button, .tool-button) { width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; }
.pdf-edit-inline svg, .pdf-edit-page-actions svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pdf-edit-workspace :is(input, select) {
  min-height: 42px; min-width: 0; max-width: 100%; padding: 6px 8px; border: 1px solid #b4afbd;
  border-radius: 6px; background: #fff; font: inherit; color: var(--ink);
}
.pdf-edit-nav input, .pdf-edit-options input[type="number"] { width: 64px; }
.pdf-edit-workspace :is(input[type="range"], input[type="checkbox"]) { padding: 0; min-height: 38px; accent-color: var(--action-fill); }
.pdf-edit-options input[type="range"] { width: min(150px, 100%); }
.pdf-edit-options input[type="color"] { width: 48px; padding: 4px; cursor: pointer; }
.pdf-edit-options label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pdf-edit-options #edit-text-option { flex: 1 1 210px; }
#edit-text { flex: 1; }
.pdf-edit-marks select { max-width: min(100%, 36ch); }
.pdf-edit-view {
  min-height: 180px; max-height: 74vh; padding: 12px; overflow: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--quiet-border); background: #eeedf2;
}
.pdf-edit-view[aria-busy="true"]:before { content: 'Cargando página…'; display: block; padding: 12px; text-align: center; color: var(--muted); }
.pdf-edit-sheet {
  position: relative; width: min(100%, calc(62vh * var(--sheet-ratio)), calc(690px * var(--sheet-ratio)));
  margin-inline: auto; box-shadow: 0 3px 16px #1a1f3d2e; background: #fff;
}
.pdf-edit-sheet > canvas, .pdf-edit-sheet > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdf-edit-sheet > svg { overflow: hidden; user-select: none; }
.pdf-edit-sheet > svg:not([data-mode="select"]) { touch-action: none; cursor: crosshair; }
.pdf-edit-sheet > svg:is([data-mode="replace"], [data-mode="fill"], [data-mode="signature"]) { touch-action: pan-x pan-y; cursor: default; }
.pdf-edit-text-target { fill: #4138bc14; stroke: #5646a9; stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: text; }
.pdf-edit-text-target:is(:hover, .is-active) { fill: #644ccb26; stroke-width: 2px; }
.pdf-edit-sheet [data-mode="select"] [data-mark] { touch-action: none; cursor: move; }
.pdf-edit-sheet .is-selected { filter: drop-shadow(0 0 1.7px #5940c4); }
.pdf-edit-pagination, .pdf-edit-page-actions, .pdf-edit-search-panel {
  padding: 8px 12px; border-top: 1px solid var(--quiet-border);
}
.pdf-edit-pagination { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pdf-edit-thumbnails { display: flex; flex: 1; min-width: 0; gap: 6px; padding: 4px; overflow-x: auto; overscroll-behavior-x: contain; }
.pdf-page-thumb { flex: 0 0 62px; display: grid; grid-template-rows: 42px auto; gap: 1px; justify-items: center; padding: 4px; border: 1px solid #dad7df; border-radius: 6px; background: #fff; font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; }
.pdf-page-thumb[aria-current="page"] { border-color: var(--action-fill); color: var(--action-hover); }
.pdf-page-thumb[aria-pressed="true"] { background: #fde5e4; border-color: var(--action-fill); }
.pdf-page-thumb > span:first-child { display: grid; align-content: center; justify-items: center; width: 42px; height: 42px; overflow: hidden; }
.pdf-page-thumb img { width: auto; height: auto; max-width: 41px; max-height: 41px; }
.pdf-edit-page-actions, #edit-search-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pdf-edit-workspace :is(.pdf-edit-pagination, .pdf-edit-page-actions, #edit-search-form, #edit-crop-options) button { width: auto; min-height: 44px; padding: 6px 10px; font-size: 14px; }
.pdf-edit-page-actions [aria-pressed="true"] { background: #fff0ef; color: var(--action-hover); }
#edit-search-form > input { flex: 1 1 175px; font-size: 16px; }
.pdf-edit-check { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; }
#edit-search-status { margin: 6px 0; }
#edit-search-status:empty, #edit-search-results:empty { display: none; }
#edit-search-results { max-height: 180px; overflow-y: auto; list-style: none; padding: 0; margin: 0; }
#edit-search-results button { width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid var(--quiet-border); padding: 6px 2px; background: white; text-align: start; color: var(--ink); font: inherit; cursor: pointer; overflow-wrap: anywhere; }
#edit-search-results strong { margin-inline-end: 8px; }
.pdf-sign-dialog { width: min(calc(100% - 28px), 520px); padding: 16px; border: 1px solid var(--quiet-border); border-radius: 8px; color: var(--ink); }
.pdf-sign-dialog::backdrop { background: #1a1f3d66; }
.pdf-sign-dialog h2 { margin: 0 0 12px; font-size: 22px; }
.pdf-sign-dialog canvas { width: 100%; aspect-ratio: 720 / 260; border: 1px solid #bbb6c6; border-radius: 6px; touch-action: none; cursor: crosshair; }
.pdf-sign-dialog .pdf-edit-actions { justify-content: flex-end; margin-top: 12px; }
.pdf-sign-dialog .pdf-edit-actions button { min-height: 44px; }
.pdf-edit-import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); gap: 6px; max-height: min(46vh, 350px); overflow-y: auto; padding: 4px; }
.pdf-edit-import-grid .pdf-page-thumb { grid-template-rows: 58px auto; }
.pdf-edit-import-grid .pdf-page-thumb > span:first-child { width: 56px; height: 56px; }
.pdf-edit-import-grid .pdf-page-thumb img { max-width: 55px; max-height: 55px; }
.pdf-edit-related { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 24px; }
.pdf-edit-related a { text-decoration: underline; text-underline-offset: 4px; }
.pdf-edit-details { margin-top: 32px; max-width: 75ch; }
.pdf-edit-details h2 { font-size: 23px; margin: 0 0 12px; }
.pdf-edit-details details { border-top: 1px solid var(--quiet-border); padding: 10px 0; }
.pdf-edit-details details p { color: var(--muted); margin: 8px 0 0; }
.pdf-edit-details summary { font-weight: 700; cursor: pointer; }
.pdf-editor-page [hidden] { display: none !important; }
.pdf-editor-page.is-editing .pdf-edit-head h1 { font-size: 25px; }
@media (max-width: 680px) {
  .pdf-edit-main { margin-top: 24px; }
  .pdf-edit-head h1 { font-size: 32px; }
  .pdf-edit-tools { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 4px; padding: 6px 8px; }
  .pdf-edit-tools .pdf-edit-replace-mode { grid-column: 1; grid-row: 1; font-size: 14px; }
  .pdf-edit-history { grid-column: 2; grid-row: 1; justify-self: end; display: grid; grid-template-columns: repeat(4, minmax(27px, 37px)); width: min(100%, 148px); }
  .pdf-edit-modes { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(7, minmax(32px, 1fr)); }
  .pdf-edit-tools :is(.pdf-edit-history, .pdf-edit-modes, .pdf-edit-nav) button { width: 100%; }
  .pdf-edit-modes, .pdf-edit-history { gap: 0; }
  .pdf-edit-nav { grid-column: 1 / -1; grid-row: 3; margin-inline-start: 0; display: grid; grid-template-columns: repeat(3, minmax(29px, 1fr)) minmax(36px, 43px) max-content minmax(29px, 1fr) 72px; gap: 1px; }
  .pdf-edit-nav input { width: 100%; }
  .pdf-edit-nav select { width: 100%; font-size: 13px; padding-inline: 4px; }
  .pdf-editor-page.is-editing .pdf-edit-main { margin-top: 15px; }
  .pdf-edit-pagination { padding: 5px 8px; }
}
