.spdf-editor {
    width: min(1400px, calc(100% - 32px));
    margin: 50px auto;
    font-family: Arial, Helvetica, sans-serif;
    color: #111827;
}

.spdf-editor__header {
    margin-bottom: 32px;
    text-align: center;
}

.spdf-editor__header h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 6vw, 58px);
    line-height: 1.1;
}

.spdf-editor__header p {
    margin: 0;
    color: #6b7280;
    font-size: 18px;
}

.spdf-editor-upload {
    max-width: 900px;
    margin: 0 auto;
    padding: 75px 24px;
    border: 3px dashed #b8dced;
    border-radius: 22px;
    background: #f2f9ff;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.spdf-editor-upload.is-dragging {
    border-color: #075cab;
    background: #e3f1ff;
}

.spdf-editor-upload p {
    margin: 18px 0 0;
    color: #6b7280;
}

.spdf-editor-button,
.spdf-editor-tool {
    padding: 14px 20px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.spdf-editor-button {
    background: #075cab;
    color: #ffffff;
}

.spdf-editor-button:hover {
    background: #063b79;
}

.spdf-editor-tool {
    border: 1px solid #dceaf5;
    background: #ffffff;
    color: #4c1d95;
}

.spdf-editor-tool:hover,
.spdf-editor-tool.is-active {
    border-color: #075cab;
    background: #f2f9ff;
}

.spdf-editor-tool--danger {
    border-color: #fecaca;
    color: #dc2626;
}

.spdf-editor-tool:disabled,
.spdf-editor-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.spdf-editor-workspace {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: 700px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(31, 41, 55, 0.1);
}

.spdf-editor-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border-right: 1px solid #e5e7eb;
    background: #fafafa;
}

.spdf-editor-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
}

.spdf-editor-field input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.spdf-editor-field input[type="color"] {
    width: 100%;
    height: 44px;
    padding: 4px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
}

.spdf-editor-document {
    min-width: 0;
    padding: 26px;
    overflow: auto;
    background: #e5e7eb;
}

.spdf-editor-status {
    margin-bottom: 18px;
    color: #4c1d95;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.spdf-editor-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.spdf-editor-page {
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    background: #ffffff;
}

.spdf-editor-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.spdf-editor-overlay {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: crosshair;
}

.spdf-editor-text {
    position: absolute;
    min-width: 30px;
    padding: 3px 5px;
    border: 1px dashed transparent;
    line-height: 1.2;
    white-space: nowrap;
    cursor: move;
    user-select: none;
}

.spdf-editor-text:hover {
    border-color: #8b5cf6;
}

.spdf-editor-text.is-selected {
    border: 1px solid #075cab;
    background: rgba(245, 243, 255, 0.75);
}

.spdf-editor-text input {
    min-width: 80px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

@media (max-width: 850px) {
    .spdf-editor-workspace {
        grid-template-columns: 1fr;
    }

    .spdf-editor-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }
}

@media (max-width: 550px) {
    .spdf-editor {
        width: min(100% - 16px, 1400px);
    }

    .spdf-editor-toolbar {
        grid-template-columns: 1fr;
    }

    .spdf-editor-document {
        padding: 12px;
    }
}

.spdf-editor-text--editable {
    box-sizing: border-box;
    padding: 1px 3px;
    border: 1px solid transparent;
    background: transparent;
    line-height: 1.05;
    white-space: pre;
    cursor: text;
}

.spdf-editor-text--editable:hover {
    border-color: rgba(109, 40, 217, 0.45);
    background: rgba(255, 255, 255, 0.28);
}

.spdf-editor-text--editable.is-selected {
    z-index: 20;
    border: 1px solid #075cab;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.12);
}

.spdf-editor-text__content {
    display: inline-block;
    min-width: 10px;
    min-height: 1em;
    outline: none;
    white-space: pre;
}

.spdf-editor-text__move {
    display: none;
    position: absolute;
    top: -25px;
    left: -1px;
    width: 25px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 5px 5px 0 0;
    background: #075cab;
    color: #ffffff;
    font-size: 14px;
    cursor: move;
    touch-action: none;
}

.spdf-editor-text.is-selected .spdf-editor-text__move {
    display: grid;
    place-items: center;
}

.spdf-editor-text.is-moving {
    opacity: 0.75;
}

.spdf-editor-overlay {
    cursor: default;
}

.spdf-editor-tool.is-active + * {
    position: relative;
}

.spdf-text-hitbox {
    position: absolute;
    z-index: 5;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    cursor: text;
}

.spdf-text-hitbox:hover {
    border-color: rgba(109, 40, 217, 0.55);
    background: rgba(109, 40, 217, 0.04);
}

.spdf-text-hitbox.is-selected {
    border-color: #075cab;
    background: rgba(109, 40, 217, 0.08);
}

.spdf-text-editor {
    position: absolute;
    z-index: 30;
    box-sizing: border-box;
    min-width: 30px;
    min-height: 20px;
    padding: 2px 4px;
    border: 1px solid #075cab;
    background: #ffffff;
    line-height: 1.1;
    white-space: pre;
    box-shadow:
        0 0 0 2px rgba(109, 40, 217, 0.12),
        0 5px 14px rgba(31, 41, 55, 0.18);
}

.spdf-text-editor__content {
    display: block;
    min-width: 20px;
    min-height: 1em;
    outline: none;
    white-space: pre;
}

.spdf-text-editor__move {
    position: absolute;
    top: -27px;
    left: -1px;
    display: grid;
    width: 27px;
    height: 26px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 5px 5px 0 0;
    background: #075cab;
    color: #ffffff;
    font-size: 14px;
    cursor: move;
    touch-action: none;
}

.spdf-editor-overlay {
    cursor: default;
}

.spdf-text-preview {
    position: absolute;
    z-index: 18;
    box-sizing: border-box;
    overflow: visible;
    padding: 1px 3px;
    background: #ffffff;
    line-height: 1.1;
    white-space: pre;
    pointer-events: none;
}

.spdf-text-preview[hidden] {
    display: none;
}

.spdf-text-hitbox.has-preview {
    z-index: 19;
    background: transparent;
}

.spdf-text-hitbox {
    position: absolute;
    z-index: 10;
    box-sizing: border-box;
    min-width: 4px;
    min-height: 8px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    cursor: text;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.spdf-text-hitbox:hover {
    border-color: rgba(109, 40, 217, 0.65);
    background: rgba(109, 40, 217, 0.05);
}

.spdf-text-hitbox.is-selected {
    z-index: 15;
    border-color: #075cab;
    background: rgba(109, 40, 217, 0.08);
    box-shadow:
        0 0 0 2px rgba(109, 40, 217, 0.14);
}

.spdf-text-hitbox:focus-visible {
    outline: 2px solid #087aa5;
    outline-offset: 1px;
}

.spdf-live-text-preview {
    position: absolute;
    z-index: 20;
    box-sizing: border-box;
    overflow: visible;
    padding: 1px 3px;
    background: #ffffff;
    line-height: 1.05;
    white-space: pre;
    pointer-events: none;
}

.spdf-live-text-editor {
    position: absolute;
    z-index: 30;
    box-sizing: border-box;
    min-width: 30px;
    min-height: 20px;
    padding: 1px 3px;
    border: 1px solid #075cab;
    background: #ffffff;
    line-height: 1.05;
    white-space: pre;
    box-shadow:
        0 0 0 2px rgba(109, 40, 217, 0.15),
        0 5px 16px rgba(31, 41, 55, 0.2);
}

.spdf-live-text-editor.is-moving {
    opacity: 0.75;
}

.spdf-live-text-editor__content {
    display: block;
    min-width: 20px;
    min-height: 1em;
    outline: none;
    white-space: pre;
}

.spdf-live-text-editor__move {
    position: absolute;
    top: -27px;
    left: -1px;
    display: grid;
    width: 27px;
    height: 26px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 5px 5px 0 0;
    background: #075cab;
    color: #ffffff;
    cursor: move;
    touch-action: none;
}

.spdf-text-hitbox.has-preview {
    z-index: 25;
    background: transparent;
}
.spdf-zoom-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: -26px -26px 18px;
    padding: 12px 18px;
    border-bottom: 1px solid #d1d5db;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 3px 12px rgba(31, 41, 55, 0.08);
    backdrop-filter: blur(8px);
}

.spdf-zoom-button,
.spdf-zoom-value,
.spdf-zoom-option {
    min-height: 38px;
    border: 1px solid #dceaf5;
    border-radius: 9px;
    background: #ffffff;
    color: #4c1d95;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.spdf-zoom-button {
    width: 40px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
}

.spdf-zoom-value {
    min-width: 70px;
    padding: 0 12px;
    font-size: 14px;
}

.spdf-zoom-option {
    padding: 0 14px;
    font-size: 13px;
}

.spdf-zoom-button:hover,
.spdf-zoom-value:hover,
.spdf-zoom-option:hover {
    border-color: #075cab;
    background: #f2f9ff;
}

.spdf-zoom-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.spdf-zoom-divider {
    width: 1px;
    height: 28px;
    margin: 0 3px;
    background: #d1d5db;
}

.spdf-editor-page-shell {
    position: relative;
    flex: 0 0 auto;
    transition:
        width 0.16s ease,
        height 0.16s ease;
}

.spdf-editor-page-shell .spdf-editor-page {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    transition: transform 0.16s ease;
}

@media (max-width: 700px) {
    .spdf-zoom-toolbar {
        flex-wrap: wrap;
        margin: -12px -12px 14px;
    }

    .spdf-zoom-option {
        flex: 1;
        min-width: 130px;
    }
}

.spdf-history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.spdf-history-actions .spdf-editor-tool {
    padding: 11px 8px;
    font-size: 13px;
}

.spdf-history-actions .spdf-editor-tool:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

@media (max-width: 850px) {
    .spdf-history-actions {
        grid-column: 1 / -1;
    }
}

.spdf-editor-image {
    position: absolute;
    z-index: 35;
    box-sizing: border-box;
    border: 2px solid transparent;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.spdf-editor-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.spdf-editor-image:hover,
.spdf-editor-image.is-selected {
    border-color: #075cab;
    box-shadow:
        0 0 0 2px rgba(109, 40, 217, 0.15);
}

.spdf-editor-image.is-moving,
.spdf-editor-image.is-resizing {
    opacity: 0.8;
}

.spdf-editor-image__resize {
    position: absolute;
    right: -8px;
    bottom: -8px;
    display: none;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #075cab;
    cursor: nwse-resize;
    touch-action: none;
}

.spdf-editor-image.is-selected
.spdf-editor-image__resize {
    display: block;
}

.spdf-signature-modal[hidden]{display:none}.spdf-signature-modal{position:fixed;z-index:999999;inset:0;display:grid;padding:24px;place-items:center;background:rgba(17,24,39,.72)}.spdf-signature-modal__dialog{width:min(760px,100%);padding:26px;border-radius:18px;background:#fff;box-shadow:0 25px 60px rgba(0,0,0,.28)}.spdf-signature-modal__dialog h2{margin:0 0 8px}.spdf-signature-modal__dialog p{margin:0 0 20px;color:#6b7280}.spdf-signature-canvas-wrap{overflow:hidden;border:2px dashed #b8dced;border-radius:14px;background:repeating-linear-gradient(0deg,#fff,#fff 34px,#e3f1ff 35px)}#spdf-signature-canvas{display:block;width:100%;height:auto;max-height:280px;cursor:crosshair;touch-action:none}.spdf-signature-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.spdf-signature-modal-open{overflow:hidden}@media(max-width:600px){.spdf-signature-actions{flex-direction:column}.spdf-signature-actions button{width:100%}}

/* Editor profesional 2.3 */
.spdf-editor-workspace--pro{grid-template-columns:180px 220px minmax(0,1fr) 220px;grid-template-rows:auto 1fr;min-height:760px}
.spdf-editor-topbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid #e5e7eb;background:#fff}
.spdf-editor-topbar__actions{display:flex;gap:8px}.spdf-editor-thumbnails-panel,.spdf-editor-properties-panel{padding:16px;background:#fafafa;overflow:auto}
.spdf-editor-thumbnails-panel{border-right:1px solid #e5e7eb}.spdf-editor-properties-panel{border-left:1px solid #e5e7eb}
.spdf-editor-thumbnails-panel h3,.spdf-editor-properties-panel h3{margin:0 0 12px;font-size:15px}.spdf-editor-thumbnails{display:flex;flex-direction:column;gap:12px}
.spdf-thumb{display:flex;flex-direction:column;gap:6px;align-items:center;width:100%;padding:8px;border:1px solid #dceaf5;border-radius:10px;background:#fff;cursor:pointer}.spdf-thumb:hover{border-color:#075cab;background:#f2f9ff}.spdf-thumb canvas{max-width:100%;height:auto;box-shadow:0 2px 8px rgba(0,0,0,.12)}.spdf-thumb span{font-size:12px;font-weight:700;color:#4c1d95}
.spdf-editor-workspace--pro .spdf-editor-toolbar{grid-column:2;grid-row:2}.spdf-editor-workspace--pro .spdf-editor-document{grid-column:3;grid-row:2}.spdf-editor-workspace--pro .spdf-editor-thumbnails-panel{grid-column:1;grid-row:2}.spdf-editor-workspace--pro .spdf-editor-properties-panel{grid-column:4;grid-row:2}
.spdf-properties-summary{display:flex;justify-content:space-between;gap:10px;margin-top:18px;padding:10px;border-radius:8px;background:#fff;border:1px solid #e5e7eb}.is-thumbnails-hidden .spdf-editor-thumbnails-panel{display:none}.is-thumbnails-hidden.spdf-editor-workspace--pro{grid-template-columns:220px minmax(0,1fr) 220px}.is-thumbnails-hidden .spdf-editor-toolbar{grid-column:1}.is-thumbnails-hidden .spdf-editor-document{grid-column:2}.is-thumbnails-hidden .spdf-editor-properties-panel{grid-column:3}.is-properties-hidden .spdf-editor-properties-panel{display:none}.is-properties-hidden.spdf-editor-workspace--pro{grid-template-columns:180px 220px minmax(0,1fr)}
.spdf-editor-workspace:fullscreen{width:100vw;height:100vh;border-radius:0}.spdf-editor-workspace:fullscreen .spdf-editor-document{height:calc(100vh - 58px)}
@media(max-width:1100px){.spdf-editor-workspace--pro{grid-template-columns:160px minmax(0,1fr);grid-template-rows:auto auto 1fr}.spdf-editor-thumbnails-panel{display:none}.spdf-editor-workspace--pro .spdf-editor-toolbar{grid-column:1;grid-row:2}.spdf-editor-workspace--pro .spdf-editor-document{grid-column:2;grid-row:2/4}.spdf-editor-properties-panel{display:none}}

/* Simpleia v2.4 - anotaciones */
.spdf-annotation-tools { margin-top: 8px; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.spdf-annotation-tools h4 { margin: 0 0 10px; color: #312e81; font-size: 14px; }
.spdf-annotation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.spdf-annotation-grid .spdf-editor-tool { min-height: 42px; padding: 8px 6px; font-size: 12px; }
.spdf-annotation-grid .spdf-editor-tool.is-active { color: #fff; border-color: #075cab; background: #075cab; }
.spdf-annotation-actions { display: grid; gap: 7px; margin-top: 10px; }
.spdf-annotation-layer { position: absolute; inset: 0; z-index: 42; overflow: visible; pointer-events: none; }
.spdf-annotation-layer.is-active { pointer-events: auto; }
.spdf-annotation-object { vector-effect: non-scaling-stroke; }
.spdf-annotation-object.is-selected { filter: drop-shadow(0 0 3px #2563eb); }
.spdf-annotation-comment { cursor: pointer; }
.spdf-editor-overlay:has(.spdf-annotation-layer.is-active) .spdf-text-hitbox { pointer-events: none; }
@media (max-width: 900px) { .spdf-annotation-grid { grid-template-columns: 1fr; } }

/* Simpleia v2.4.1 - corrección de paneles y pantalla completa */
.spdf-editor-workspace--pro.is-thumbnails-hidden {
    grid-template-columns: 220px minmax(0, 1fr) 220px;
}

.spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-toolbar {
    grid-column: 1;
}

.spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-document {
    grid-column: 2;
}

.spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-properties-panel {
    grid-column: 3;
}

.spdf-editor-workspace--pro.is-properties-hidden {
    grid-template-columns: 180px 220px minmax(0, 1fr);
}

.spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-thumbnails-panel {
    grid-column: 1;
}

.spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-toolbar {
    grid-column: 2;
}

.spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-document {
    grid-column: 3;
}

.spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
    grid-template-columns: 220px minmax(0, 1fr);
}

.spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-toolbar {
    grid-column: 1;
}

.spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-document {
    grid-column: 2;
}

.spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-thumbnails-panel,
.spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-properties-panel {
    display: none;
}

.spdf-editor-document {
    min-width: 0;
}

.spdf-zoom-toolbar {
    min-width: 0;
    flex-wrap: wrap;
}

.spdf-zoom-option {
    white-space: nowrap;
}

.spdf-editor-workspace:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
}

.spdf-editor-workspace:fullscreen .spdf-editor-document {
    height: calc(100vh - 70px);
    overflow: auto;
}

.spdf-editor-workspace:fullscreen .spdf-editor-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
}

/* Simpleia v2.5: selección y portapapeles de anotaciones */
.spdf-annotation-clipboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 10px 0;
}

.spdf-annotation-clipboard .spdf-editor-tool {
    min-width: 0;
    padding: 9px 5px;
    font-size: 12px;
}

.spdf-annotation-object {
    vector-effect: non-scaling-stroke;
}

.spdf-annotation-layer.is-active .spdf-annotation-object {
    pointer-events: stroke;
}

.spdf-annotation-object.is-selected {
    filter: drop-shadow(0 0 3px rgba(109, 40, 217, 0.95));
}

.spdf-annotation-comment.is-selected rect {
    stroke: #075cab;
    stroke-width: 3;
}

/* Simpleia v2.6: inspector y capas de anotaciones */
.spdf-object-properties { display: grid; gap: 12px; margin-top: 14px; }
.spdf-object-properties h4 { margin: 8px 0 0; color: #312e81; font-size: 13px; }
.spdf-layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.spdf-layer-actions .spdf-editor-tool { min-width: 0; padding: 9px 6px; font-size: 11px; }
.spdf-annotation-layers { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.spdf-annotation-layers > p { margin: 0; color: #6b7280; font-size: 12px; }
.spdf-layer-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; text-align: left; cursor: pointer; }
.spdf-layer-item:hover, .spdf-layer-item.is-active { border-color: #075cab; background: #f2f9ff; }
.spdf-layer-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.spdf-layer-item small { flex: 0 0 auto; color: #6b7280; font-size: 10px; }
.spdf-annotation-object.is-locked { cursor: not-allowed; }

/* Simpleia v3.2.1 - editor responsive móvil */
@media (max-width: 700px) {
    .spdf-editor {
        width: calc(100% - 16px);
        margin: 20px auto;
    }

    .spdf-editor-workspace,
    .spdf-editor-workspace--pro,
    .spdf-editor-workspace--pro.is-thumbnails-hidden,
    .spdf-editor-workspace--pro.is-properties-hidden,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
    }

    .spdf-editor-workspace--pro .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-topbar {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
        padding: 10px;
    }

    .spdf-editor-topbar > strong {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        text-align: center;
        overflow-wrap: normal;
        word-break: normal;
    }

    #spdf-editor-sidebar-toggle {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
    }

    .spdf-editor-topbar__actions {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
    }

    .spdf-editor-topbar .spdf-editor-tool {
        min-width: 0;
        padding: 9px 10px;
        font-size: 12px;
        line-height: 1.2;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }

    .spdf-editor-thumbnails-panel,
    .spdf-editor-properties-panel,
    .spdf-editor-workspace--pro .spdf-editor-thumbnails-panel,
    .spdf-editor-workspace--pro .spdf-editor-properties-panel {
        display: none !important;
    }

    .spdf-editor-workspace--pro .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-toolbar {
        grid-column: 1 !important;
        grid-row: 2 !important;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        min-width: 0;
        max-height: 46vh;
        padding: 12px;
        overflow-y: auto;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
        background: #fafafa;
    }

    .spdf-editor-toolbar > .spdf-editor-tool,
    .spdf-editor-toolbar > .spdf-editor-button,
    .spdf-editor-toolbar > .spdf-editor-field,
    .spdf-editor-toolbar > .spdf-annotation-tools,
    .spdf-editor-toolbar > .spdf-history-actions {
        min-width: 0;
        width: 100%;
    }

    .spdf-editor-toolbar > .spdf-annotation-tools,
    .spdf-editor-toolbar > .spdf-history-actions,
    .spdf-editor-toolbar > .spdf-editor-field,
    #spdf-editor-download,
    #spdf-editor-reset {
        grid-column: 1 / -1;
    }

    .spdf-editor-toolbar .spdf-editor-tool,
    .spdf-editor-toolbar .spdf-editor-button {
        padding: 11px 8px;
        font-size: 13px;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }

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

    .spdf-history-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .spdf-editor-workspace--pro .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-document {
        grid-column: 1 !important;
        grid-row: 3 !important;
        width: 100%;
        min-width: 0;
        padding: 10px;
        overflow: auto;
    }

    .spdf-zoom-toolbar {
        display: flex;
        width: 100%;
        min-width: 0;
        padding: 8px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .spdf-zoom-toolbar button,
    .spdf-zoom-toolbar .spdf-zoom-option {
        flex: 0 0 auto;
        min-width: auto;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .spdf-editor-page-shell,
    .spdf-editor-page,
    .spdf-editor-page canvas {
        max-width: 100%;
    }
}

@media (max-width: 430px) {
    .spdf-editor-workspace--pro .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-topbar {
        grid-template-columns: 1fr;
    }

    #spdf-editor-sidebar-toggle,
    .spdf-editor-topbar__actions {
        grid-column: 1;
    }

    #spdf-editor-sidebar-toggle {
        grid-row: 2;
    }

    .spdf-editor-topbar__actions {
        grid-row: 3;
        justify-content: stretch;
    }

    .spdf-editor-topbar__actions .spdf-editor-tool {
        flex: 1 1 calc(50% - 4px);
    }

    .spdf-editor-workspace--pro .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-toolbar {
        grid-template-columns: 1fr;
    }

    .spdf-editor-toolbar > * {
        grid-column: 1 !important;
    }

    .spdf-annotation-grid,
    .spdf-history-actions,
    .spdf-annotation-clipboard,
    .spdf-layer-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================
   Simpleia PDF Tools v3.3.0 — Editor Studio
   Interfaz profesional de escritorio y móvil
   ========================================================== */
.spdf-editor {
    --spdf-accent: #075cab;
    --spdf-accent-2: #087aa5;
    --spdf-accent-soft: #f2f9ff;
    --spdf-border: #e5e7eb;
    --spdf-muted: #64748b;
    --spdf-ink: #0f172a;
    --spdf-panel: #ffffff;
    --spdf-canvas: #eef1f5;
    width: min(1520px, calc(100% - 28px));
    margin: 32px auto 56px;
    color: var(--spdf-ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.spdf-editor__header {
    max-width: 760px;
    margin: 0 auto 24px;
}
.spdf-editor__header h1 {
    margin-bottom: 8px;
    font-size: clamp(34px, 5vw, 48px);
    letter-spacing: -0.035em;
}
.spdf-editor__header p { color: var(--spdf-muted); font-size: 16px; }

.spdf-editor-workspace--pro {
    grid-template-columns: 170px 250px minmax(480px, 1fr) 260px;
    grid-template-rows: 60px minmax(720px, 1fr);
    min-height: 780px;
    border: 1px solid #dfe3ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 65px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .05);
}

.spdf-editor-topbar {
    min-height: 60px;
    padding: 0 14px 0 16px;
    border-bottom: 1px solid var(--spdf-border);
    background: rgba(255,255,255,.97);
    box-shadow: 0 1px 0 rgba(15,23,42,.02);
}
.spdf-editor-topbar__left,
.spdf-editor-topbar__actions { display:flex; align-items:center; gap:10px; }
.spdf-editor-app-title { display:flex; flex-direction:column; gap:1px; min-width:0; }
.spdf-editor-app-title strong { color:#111827; font-size:14px; line-height:1.2; }
.spdf-editor-app-title > span { color:#94a3b8; font-size:11px; font-weight:600; }
.spdf-editor-ready { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border:1px solid #dcfce7; border-radius:999px; background:#f0fdf4; color:#15803d; font-size:11px; font-weight:800; }
.spdf-editor-ready i { width:7px; height:7px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 3px #dcfce7; }

.spdf-editor-tool--compact {
    min-height: 36px;
    padding: 8px 11px;
    border-color:#e2e8f0;
    border-radius:9px;
    color:#334155;
    font-size:12px;
    background:#fff;
}
.spdf-editor-tool--compact:hover { border-color:#b8dced; background:#f3f9ff; color:var(--spdf-accent); }

.spdf-editor-thumbnails-panel,
.spdf-editor-toolbar,
.spdf-editor-properties-panel { scrollbar-width: thin; scrollbar-color:#cbd5e1 transparent; }
.spdf-editor-thumbnails-panel { padding:14px 12px; border-right:1px solid var(--spdf-border); background:#f8fafc; }
.spdf-editor-toolbar { gap:10px; padding:14px; border-right:1px solid var(--spdf-border); background:#fff; }
.spdf-editor-properties-panel { padding:14px; border-left:1px solid var(--spdf-border); background:#fbfcfe; }

.spdf-panel-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin:0 0 12px;
    padding:0 2px 10px;
    border-bottom:1px solid #eef2f7;
}
.spdf-panel-heading > span { color:#0f172a; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.055em; }
.spdf-panel-heading small { color:#94a3b8; font-size:10px; font-weight:700; }

.spdf-primary-tools { display:grid; grid-template-columns:1fr; gap:8px; }
.spdf-editor-tool--primary-card {
    display:grid;
    grid-template-columns:34px 1fr;
    align-items:center;
    gap:9px;
    width:100%;
    min-height:48px;
    padding:7px 10px;
    border:1px solid #e7e5e4;
    border-radius:11px;
    color:#1e293b;
    text-align:left;
    background:#fff;
    box-shadow:0 1px 2px rgba(15,23,42,.03);
}
.spdf-editor-tool--primary-card:hover { border-color:#b8dced; background:#f3f9ff; box-shadow:0 6px 16px rgba(109,40,217,.08); transform:translateY(-1px); }
.spdf-tool-icon { display:grid; width:32px; height:32px; place-items:center; border-radius:8px; background:#f2edff; color:var(--spdf-accent); font-size:15px; font-weight:900; }
.spdf-editor-tool--primary-card > span:last-child { font-size:12px; font-weight:800; }

.spdf-section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:4px 0 8px; }
.spdf-section-title > span { color:#334155; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.055em; }
.spdf-section-title small { color:#a1a1aa; font-size:9px; font-weight:700; }
.spdf-annotation-tools { margin-top:2px; padding-top:12px; border-top:1px solid #eef2f7; }
.spdf-annotation-grid { grid-template-columns:repeat(3, minmax(0,1fr)); gap:6px; }
.spdf-annotation-grid .spdf-editor-tool { min-height:42px; padding:6px 4px; border-color:#e5e7eb; border-radius:9px; color:#475569; font-size:10px; background:#fff; }
.spdf-annotation-grid .spdf-editor-tool:hover { border-color:#b8dced; color:var(--spdf-accent); background:#f3f9ff; }
.spdf-annotation-grid .spdf-editor-tool.is-active { box-shadow:0 4px 12px rgba(109,40,217,.20); }

.spdf-history-actions { gap:6px; }
.spdf-history-actions .spdf-editor-tool { min-height:38px; border-color:#e5e7eb; color:#475569; background:#fff; }

.spdf-editor-field { gap:5px; color:#475569; font-size:11px; }
.spdf-editor-field input[type="number"],
.spdf-editor-field input[type="color"] { border-color:#e2e8f0; border-radius:9px; background:#fff; }

#spdf-editor-download {
    min-height:48px;
    margin-top:4px;
    border-radius:11px;
    background:linear-gradient(135deg,#087aa5,#063b79);
    box-shadow:0 8px 18px rgba(109,40,217,.22);
}
#spdf-editor-download:hover { background:linear-gradient(135deg,#075cab,#4c1d95); transform:translateY(-1px); }
#spdf-editor-reset { color:#64748b; border-color:#e2e8f0; background:#f8fafc; }

.spdf-editor-document { padding:0; background:var(--spdf-canvas); }
.spdf-zoom-toolbar {
    margin:0;
    padding:10px 14px;
    border-bottom:1px solid #dde2e9;
    background:rgba(255,255,255,.96);
    box-shadow:0 3px 12px rgba(15,23,42,.04);
}
.spdf-zoom-button,.spdf-zoom-value,.spdf-zoom-option { min-height:34px; border-color:#e2e8f0; border-radius:8px; color:#334155; background:#fff; }
.spdf-zoom-button:hover,.spdf-zoom-value:hover,.spdf-zoom-option:hover { border-color:#b8dced; color:var(--spdf-accent); background:#f3f9ff; }
.spdf-editor-status { margin:0; padding:8px 14px 0; color:#64748b; font-size:12px; }
.spdf-editor-pages { padding:30px 34px 60px; }
.spdf-editor-page { border-radius:2px; box-shadow:0 12px 32px rgba(15,23,42,.18), 0 1px 3px rgba(15,23,42,.10); }

.spdf-thumb { padding:7px; border-color:#e2e8f0; border-radius:9px; background:#fff; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.spdf-thumb:hover { border-color:#a78bfa; box-shadow:0 6px 15px rgba(109,40,217,.08); }
.spdf-thumb span { color:#64748b; font-size:10px; }

.spdf-properties-intro { margin:0 0 12px; color:#64748b; font-size:11px; line-height:1.55; }
.spdf-properties-summary { margin-top:0; border-color:#e2e8f0; border-radius:10px; background:#fff; font-size:11px; }
.spdf-object-properties { gap:10px; }
.spdf-layer-actions { gap:6px; }
.spdf-layer-actions .spdf-editor-tool { min-height:35px; border-color:#e2e8f0; border-radius:8px; color:#475569; background:#fff; }

/* Tablet: herramientas compactas arriba y documento con mayor espacio */
@media (max-width: 1180px) and (min-width: 701px) {
    .spdf-editor-workspace--pro { grid-template-columns:190px minmax(0,1fr); grid-template-rows:60px auto minmax(620px,1fr); }
    .spdf-editor-thumbnails-panel,.spdf-editor-properties-panel { display:none; }
    .spdf-editor-workspace--pro .spdf-editor-toolbar { grid-column:1; grid-row:2/4; }
    .spdf-editor-workspace--pro .spdf-editor-document { grid-column:2; grid-row:2/4; }
}

/* Móvil: editor tipo app, lienzo primero y herramientas horizontales */
@media (max-width: 700px) {
    .spdf-editor { width:100%; margin:12px 0 32px; }
    .spdf-editor__header { padding:0 16px; margin-bottom:16px; }
    .spdf-editor__header h1 { font-size:30px; }
    .spdf-editor__header p { font-size:14px; }
    .spdf-editor-workspace--pro,
    .spdf-editor-workspace--pro.is-thumbnails-hidden,
    .spdf-editor-workspace--pro.is-properties-hidden,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
        grid-template-columns:minmax(0,1fr)!important;
        grid-template-rows:auto auto minmax(58vh,1fr)!important;
        border-right:0;
        border-left:0;
        border-radius:0;
        box-shadow:none;
    }
    .spdf-editor-topbar { grid-column:1!important; grid-row:1!important; display:flex!important; min-height:54px; padding:8px 10px; }
    .spdf-editor-topbar__left { min-width:0; flex:1; }
    .spdf-editor-app-title { flex:1; }
    .spdf-editor-app-title strong { font-size:13px; }
    .spdf-editor-app-title > span,.spdf-editor-ready { display:none; }
    .spdf-editor-tool--compact span { display:none; }
    .spdf-editor-tool--compact { width:36px; min-width:36px; height:36px; padding:0; }
    .spdf-editor-topbar__actions { flex:0 0 auto; gap:5px; }
    .spdf-editor-thumbnails-panel,.spdf-editor-properties-panel { display:none!important; }
    .spdf-editor-workspace--pro .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-toolbar {
        grid-column:1!important;
        grid-row:2!important;
        display:flex!important;
        flex-direction:row;
        align-items:center;
        gap:7px;
        width:100%;
        max-height:none;
        padding:8px 10px;
        overflow-x:auto;
        overflow-y:hidden;
        border-bottom:1px solid #e2e8f0;
        background:#fff;
        scrollbar-width:none;
    }
    .spdf-editor-toolbar::-webkit-scrollbar { display:none; }
    .spdf-editor-toolbar .spdf-panel-heading,
    .spdf-editor-toolbar .spdf-section-title,
    .spdf-editor-toolbar > .spdf-editor-field,
    .spdf-editor-toolbar > .spdf-history-actions,
    .spdf-editor-toolbar > #spdf-delete-element,
    .spdf-editor-toolbar > #spdf-editor-download,
    .spdf-editor-toolbar > #spdf-editor-reset,
    .spdf-annotation-tools > .spdf-editor-field,
    .spdf-annotation-tools > .spdf-annotation-clipboard,
    .spdf-annotation-tools > .spdf-annotation-actions { display:none!important; }
    .spdf-primary-tools { display:flex; flex:0 0 auto; gap:6px; }
    .spdf-editor-tool--primary-card { display:flex; flex-direction:column; justify-content:center; gap:2px; width:68px!important; min-width:68px!important; height:54px; padding:5px!important; text-align:center; }
    .spdf-tool-icon { width:24px; height:24px; margin:auto; border-radius:6px; font-size:12px; }
    .spdf-editor-tool--primary-card > span:last-child { font-size:9px; white-space:nowrap; }
    .spdf-annotation-tools { display:flex; flex:0 0 auto; margin:0; padding:0 0 0 7px; border-top:0; border-left:1px solid #e2e8f0; }
    .spdf-annotation-grid { display:flex; gap:6px; }
    .spdf-annotation-grid .spdf-editor-tool { width:54px; min-width:54px; height:54px; padding:4px; font-size:9px; line-height:1.15; }
    .spdf-editor-workspace--pro .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-document {
        grid-column:1!important;
        grid-row:3!important;
        padding:0;
        background:#e9edf2;
    }
    .spdf-zoom-toolbar { position:sticky; top:0; justify-content:flex-start; margin:0; padding:7px 9px; overflow-x:auto; flex-wrap:nowrap; }
    .spdf-zoom-option { min-width:auto; font-size:10px; padding:0 9px; }
    .spdf-zoom-button { width:34px; }
    .spdf-zoom-value { min-width:58px; }
    .spdf-editor-pages { padding:18px 10px 40px; }
}

@media (max-width: 430px) {
    .spdf-editor-topbar { grid-template-columns:none!important; }
    #spdf-editor-sidebar-toggle,.spdf-editor-topbar__actions { grid-column:auto!important; grid-row:auto!important; }
    .spdf-editor-topbar__actions { justify-content:flex-end; }
}


/* ==========================================================
   Simpleia PDF Tools v3.3.1 — Workspace fijo
   - Propiedades cerradas al iniciar (clase en editor.php)
   - Los paneles permanecen visibles mientras solo el documento
     desplaza sus páginas.
   ========================================================== */
@media (min-width: 1181px) {
    .spdf-editor-workspace--pro {
        height: clamp(620px, calc(100vh - 150px), 900px);
        min-height: 0;
        max-height: 900px;
        grid-template-rows: 60px minmax(0, 1fr);
        overflow: hidden;
    }

    .spdf-editor-workspace--pro > .spdf-editor-thumbnails-panel,
    .spdf-editor-workspace--pro > .spdf-editor-toolbar,
    .spdf-editor-workspace--pro > .spdf-editor-document,
    .spdf-editor-workspace--pro > .spdf-editor-properties-panel {
        min-height: 0;
        height: 100%;
    }

    .spdf-editor-thumbnails-panel,
    .spdf-editor-toolbar,
    .spdf-editor-properties-panel {
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .spdf-editor-document {
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .spdf-editor-document .spdf-zoom-toolbar {
        position: sticky;
        top: 0;
        z-index: 90;
    }
}

/* En tablet el documento también tiene desplazamiento independiente. */
@media (max-width: 1180px) and (min-width: 701px) {
    .spdf-editor-workspace--pro,
    .spdf-editor-workspace--pro.is-thumbnails-hidden,
    .spdf-editor-workspace--pro.is-properties-hidden,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
        height: clamp(600px, calc(100vh - 140px), 860px);
        min-height: 0;
        max-height: 860px;
        overflow: hidden;
    }

    .spdf-editor-workspace--pro .spdf-editor-toolbar,
    .spdf-editor-workspace--pro .spdf-editor-document {
        min-height: 0;
        height: 100%;
    }

    .spdf-editor-toolbar,
    .spdf-editor-document {
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .spdf-editor-document .spdf-zoom-toolbar {
        position: sticky;
        top: 0;
        z-index: 90;
    }
}

/* En móvil la barra de herramientas queda arriba y solo baja el lienzo. */
@media (max-width: 700px) {
    .spdf-editor-workspace--pro,
    .spdf-editor-workspace--pro.is-thumbnails-hidden,
    .spdf-editor-workspace--pro.is-properties-hidden,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
        height: min(820px, calc(100dvh - 84px));
        min-height: 560px;
        max-height: none;
        overflow: hidden;
    }

    .spdf-editor-workspace--pro .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-document {
        min-height: 0;
        height: 100%;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .spdf-editor-document .spdf-zoom-toolbar {
        position: sticky;
        top: 0;
        z-index: 90;
    }

    /* En móvil el inspector lateral no se usa; evitamos un botón sin efecto. */
    #spdf-editor-properties-toggle {
        display: none !important;
    }
}

/* ==========================================================
   Simpleia PDF Tools v3.3.2 — Zoom móvil compacto
   Evita que "Ajustar al ancho" y "Ajustar página" se salgan
   del viewport. Los controles se distribuyen en dos filas.
   ========================================================== */
@media (max-width: 700px) {
    .spdf-editor-document .spdf-zoom-toolbar,
    .spdf-zoom-toolbar {
        display:flex !important;
        flex-wrap:wrap !important;
        align-items:center;
        justify-content:center !important;
        gap:6px !important;
        width:100%;
        max-width:100%;
        box-sizing:border-box;
        padding:8px 10px !important;
        overflow-x:hidden !important;
        overflow-y:visible !important;
    }

    .spdf-zoom-button {
        flex:0 0 38px;
        width:38px !important;
        min-width:38px !important;
        height:38px;
        padding:0 !important;
    }

    .spdf-zoom-value {
        flex:0 0 66px;
        width:66px !important;
        min-width:66px !important;
        height:38px;
        padding:0 6px !important;
    }

    .spdf-zoom-divider {
        display:block !important;
        flex:0 0 100%;
        width:100%;
        height:0;
        margin:0 !important;
        border:0 !important;
    }

    .spdf-zoom-option {
        flex:1 1 calc(50% - 6px);
        width:auto !important;
        min-width:0 !important;
        max-width:none !important;
        min-height:38px;
        padding:0 8px !important;
        font-size:11px !important;
        line-height:1.15;
        white-space:nowrap;
        text-align:center;
    }
}

@media (max-width: 380px) {
    .spdf-zoom-option {
        font-size:10px !important;
        padding:0 5px !important;
    }
}

/* ==========================================================
   Simpleia PDF Tools v3.3.3 — Responsive definitivo editor
   Breakpoint amplio para teléfonos/tablets y vistas móviles
   que reportan un viewport superior a 700px.
   ========================================================== */
@media (max-width: 1024px) {
    .spdf-editor {
        width: 100% !important;
        max-width: 100% !important;
        margin: 12px 0 32px !important;
        overflow: hidden !important;
    }

    .spdf-editor-workspace,
    .spdf-editor-workspace--pro,
    .spdf-editor-workspace--pro.is-thumbnails-hidden,
    .spdf-editor-workspace--pro.is-properties-hidden,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: min(820px, calc(100dvh - 84px)) !important;
        min-height: 560px !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    .spdf-editor-workspace--pro .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-topbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-topbar {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 8px 10px !important;
        box-sizing: border-box !important;
    }

    .spdf-editor-topbar__left {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .spdf-editor-app-title {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .spdf-editor-app-title strong,
    .spdf-editor-app-title span,
    .spdf-editor-topbar button,
    .spdf-editor-topbar .spdf-editor-tool {
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        white-space: nowrap !important;
    }

    .spdf-editor-app-title strong {
        font-size: 13px !important;
    }

    .spdf-editor-app-title > span,
    .spdf-editor-ready,
    #spdf-editor-properties-toggle,
    .spdf-editor-thumbnails-panel,
    .spdf-editor-properties-panel {
        display: none !important;
    }

    #spdf-editor-sidebar-toggle {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 40px !important;
        max-width: 150px !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
    }

    .spdf-editor-topbar__actions {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        gap: 5px !important;
        min-width: 0 !important;
    }

    .spdf-editor-topbar__actions .spdf-editor-tool {
        width: auto !important;
        min-width: 38px !important;
        max-width: 130px !important;
        padding: 8px 9px !important;
        font-size: 11px !important;
    }

    .spdf-editor-workspace--pro .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-toolbar,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-toolbar {
        grid-column: 1 !important;
        grid-row: 2 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 7px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 8px 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        box-sizing: border-box !important;
        border-right: 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: #fff !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .spdf-editor-toolbar::-webkit-scrollbar { display: none; }

    .spdf-editor-toolbar .spdf-panel-heading,
    .spdf-editor-toolbar .spdf-section-title,
    .spdf-editor-toolbar > .spdf-editor-field,
    .spdf-editor-toolbar > .spdf-history-actions,
    .spdf-editor-toolbar > #spdf-delete-element,
    .spdf-editor-toolbar > #spdf-editor-download,
    .spdf-editor-toolbar > #spdf-editor-reset,
    .spdf-annotation-tools > .spdf-editor-field,
    .spdf-annotation-tools > .spdf-annotation-clipboard,
    .spdf-annotation-tools > .spdf-annotation-actions {
        display: none !important;
    }

    .spdf-primary-tools {
        display: flex !important;
        flex: 0 0 auto !important;
        gap: 6px !important;
    }

    .spdf-editor-tool--primary-card {
        display: flex !important;
        flex: 0 0 82px !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 82px !important;
        min-width: 82px !important;
        height: 56px !important;
        padding: 5px !important;
        gap: 3px !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    .spdf-editor-tool--primary-card > span:last-child {
        max-width: 100% !important;
        font-size: 9px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }

    .spdf-tool-icon {
        width: 24px !important;
        height: 24px !important;
        flex: 0 0 24px !important;
        font-size: 12px !important;
    }

    .spdf-annotation-tools {
        display: flex !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 0 0 0 7px !important;
        border-top: 0 !important;
        border-left: 1px solid #e2e8f0 !important;
    }

    .spdf-annotation-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }

    .spdf-annotation-grid .spdf-editor-tool {
        flex: 0 0 66px !important;
        width: 66px !important;
        min-width: 66px !important;
        height: 56px !important;
        padding: 4px 5px !important;
        font-size: 9px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }

    .spdf-editor-workspace--pro .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-properties-hidden .spdf-editor-document,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden .spdf-editor-document {
        grid-column: 1 !important;
        grid-row: 3 !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        background: #e9edf2 !important;
        overscroll-behavior: contain;
    }

    .spdf-editor-document .spdf-zoom-toolbar,
    .spdf-zoom-toolbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 90 !important;
        display: grid !important;
        grid-template-columns: 40px 70px 40px !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        background: rgba(255,255,255,.98) !important;
    }

    .spdf-zoom-button {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 38px !important;
        padding: 0 !important;
    }

    .spdf-zoom-value {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        height: 38px !important;
        padding: 0 6px !important;
    }

    .spdf-zoom-divider {
        display: none !important;
    }

    .spdf-zoom-option {
        grid-column: span 3 !important;
        width: min(280px, 100%) !important;
        min-width: 0 !important;
        max-width: 280px !important;
        min-height: 38px !important;
        margin: 0 auto !important;
        padding: 0 10px !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-align: center !important;
    }

    .spdf-editor-pages {
        width: 100% !important;
        min-width: 0 !important;
        padding: 18px 10px 40px !important;
        box-sizing: border-box !important;
    }

    .spdf-editor-page-shell,
    .spdf-editor-page,
    .spdf-editor-page canvas {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .spdf-editor-workspace--pro,
    .spdf-editor-workspace--pro.is-thumbnails-hidden,
    .spdf-editor-workspace--pro.is-properties-hidden,
    .spdf-editor-workspace--pro.is-thumbnails-hidden.is-properties-hidden {
        height: min(780px, calc(100dvh - 74px)) !important;
    }

    #spdf-editor-sidebar-toggle {
        max-width: 44px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        font-size: 0 !important;
    }
    #spdf-editor-sidebar-toggle::before {
        content: "☰";
        font-size: 18px;
    }

    .spdf-editor-app-title strong { font-size: 12px !important; }
    .spdf-editor-topbar__actions .spdf-editor-tool { max-width: 44px !important; font-size: 0 !important; }
    .spdf-editor-topbar__actions .spdf-editor-tool::before { font-size: 15px !important; }

    .spdf-editor-tool--primary-card { flex-basis: 76px !important; width:76px !important; min-width:76px !important; }
    .spdf-annotation-grid .spdf-editor-tool { flex-basis: 62px !important; width:62px !important; min-width:62px !important; }
}

/* ==========================================================
   Simpleia PDF Tools v3.3.4 — ajuste estable de zoom móvil
   Mantiene el layout responsive de v3.3.3 y corrige únicamente
   la barra de zoom para que nunca desborde horizontalmente.
   ========================================================== */
@media (max-width: 1024px) {
    .spdf-editor-document {
        overflow-x: hidden !important;
    }

    .spdf-editor-document .spdf-zoom-toolbar,
    .spdf-zoom-toolbar {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 8px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .spdf-zoom-button {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 38px !important;
        padding: 0 !important;
    }

    .spdf-zoom-value {
        flex: 0 0 68px !important;
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
        height: 38px !important;
        padding: 0 6px !important;
    }

    /* Fuerza el salto de línea después de - / 100% / + */
    .spdf-zoom-divider {
        display: block !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    .spdf-zoom-option {
        flex: 1 1 calc(50% - 6px) !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: calc(50% - 3px) !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        text-align: center !important;
    }
}

@media (max-width: 420px) {
    .spdf-editor-document .spdf-zoom-toolbar,
    .spdf-zoom-toolbar {
        gap: 5px !important;
        padding: 7px 6px !important;
    }

    .spdf-zoom-option {
        font-size: 10px !important;
        padding: 0 5px !important;
    }
}
