.pdf-shortcode-library-single,
.pdf-shortcode-library-grid-wrap,
.pdf-shortcode-library-list-wrap {
    margin: 1.5em 0;
}

.pdf-shortcode-library-single-title,
.pdf-shortcode-library-grid-title {
    margin: 0 0 0.8em;
}

.pdf-shortcode-library-single-viewer {
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.pdf-shortcode-library-grid {
    grid-template-columns: repeat(var(--pdfsl-grid-columns, 3), minmax(0, 1fr));
    display: grid;
    gap: 18px;
    align-items: start;
}

.pdf-shortcode-library-card-front {
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: auto;
}

.pdf-shortcode-library-card-preview {
    background: #f7f7f7;
    border-bottom: 1px solid #e3e3e3;
    padding: 0;
    display: flex;
}

.pdf-shortcode-library-card-content {
    padding: 10px 12px 12px;
}

.pdf-shortcode-library-card-content h4 {
    margin: 0 0 10px;
    line-height: 1.35;
    font-size: 16px;
}

.pdf-shortcode-library-card-number {
    font-size: 0.85em;
    opacity: 0.75;
    margin-bottom: 6px;
}

.pdf-shortcode-library-button {
    display: inline-block;
    text-decoration: none;
    border: 1px solid #111;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    cursor: pointer;
    line-height: 1.2;
}

.pdf-shortcode-library-button-small {
    padding: 7px 10px;
    font-size: 14px;
}

.pdf-shortcode-library-button-full {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    border-radius: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
}


.pdf-shortcode-library-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.pdf-shortcode-library-action-row .pdf-shortcode-library-button-action {
    flex: 1 1 110px;
    text-align: center;
    box-sizing: border-box;
}

.pdf-shortcode-library-single-actions {
    margin-top: 12px;
}

.pdf-shortcode-library-debug {
    padding: 12px 14px;
    border: 1px dashed #c4c4c4;
    border-radius: 10px;
    background: #fafafa;
    font-size: 14px;
}

.pdf-shortcode-library-front-form-wrap {
    margin: 1.5em 0;
    padding: 18px;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    background: #fff;
}

.pdf-shortcode-library-front-form-title {
    margin: 0 0 14px;
}

.pdf-shortcode-library-front-form label,
.pdf-shortcode-library-inline-edit-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.pdf-shortcode-library-front-form input[type="text"],
.pdf-shortcode-library-front-form input[type="number"],
.pdf-shortcode-library-front-form input[type="file"],
.pdf-shortcode-library-inline-edit-form input[type="text"],
.pdf-shortcode-library-inline-edit-form input[type="number"],
.pdf-shortcode-library-inline-edit-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pdf-shortcode-library-front-form small,
.pdf-shortcode-library-inline-edit-form small {
    display: block;
    margin-top: 6px;
    opacity: 0.75;
}

.pdf-shortcode-library-current-file a {
    margin-left: 6px;
}

.pdf-shortcode-library-remove-file {
    display: block;
    margin-top: 6px;
    font-weight: 400;
}

.pdf-shortcode-library-front-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.pdf-shortcode-library-button-secondary {
    border-color: #bdbdbd;
}

.pdf-shortcode-library-notice {
    margin: 1em 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #d8d8d8;
}

.pdf-shortcode-library-notice-success {
    background: #f4fbf4;
    border-color: #b8d7b8;
}

.pdf-shortcode-library-notice-error {
    background: #fff5f5;
    border-color: #e0b8b8;
}

.pdf-shortcode-library-list {
    border-top: 1px solid #e2e2e2;
}

.pdf-shortcode-library-list-item {
    border-bottom: 1px solid #e2e2e2;
    padding: 14px 0;
}

.pdf-shortcode-library-list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pdf-shortcode-library-list-main {
    min-width: 0;
    flex: 1 1 auto;
}

.pdf-shortcode-library-list-title {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
}

.pdf-shortcode-library-list-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pdf-shortcode-library-list-shortcode-text {
    display: inline-block;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    background: #fafafa;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    cursor: text;
    user-select: all;
    -webkit-user-select: all;
    box-sizing: border-box;
}

.pdf-shortcode-library-list-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
}

.pdf-shortcode-library-edit-details {
    display: block;
}

.pdf-shortcode-library-edit-details summary {
    list-style: none;
}

.pdf-shortcode-library-edit-details summary::-webkit-details-marker {
    display: none;
}

.pdf-shortcode-library-inline-delete-form {
    margin: 0;
}

.pdf-shortcode-library-inline-edit-wrap {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    background: #fafafa;
    min-width: min(640px, 90vw);
}

.pdf-shortcode-library-inline-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pdfsl-viewer {
    width: 100%;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f3f3;
}

.pdfsl-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #ececec;
    border-bottom: 1px solid #d7d7d7;
    flex-wrap: wrap;
}

.pdfsl-tool-button {
    border: 1px solid #bdbdbd;
    background: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    line-height: 1.2;
    cursor: pointer;
}

.pdfsl-tool-button[disabled] {
    opacity: 0.45;
    cursor: default;
}

.pdfsl-tool-separator {
    width: 1px;
    height: 20px;
    background: #cfcfcf;
    margin: 0 2px;
}

.pdfsl-page-display,
.pdfsl-zoom-display {
    min-width: 52px;
    text-align: center;
    font-size: 14px;
}

.pdfsl-canvas-shell {
    position: relative;
    background: #e9e9e9;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
    overflow: auto;
}

.pdfsl-canvas-shell-single {
    min-height: 420px;
}

.pdfsl-canvas-shell-grid {
    min-height: 160px;
    padding: 0;
    overflow: hidden;
    align-items: center;
    background: #f7f7f7;
}

.pdfsl-canvas {
    display: block;
    max-width: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    background: #fff;
}

.pdfsl-loading,
.pdfsl-error {
    font-size: 14px;
    padding: 12px;
}

.pdfsl-error {
    color: #9b1c1c;
}

@media (max-width: 782px) {
    .pdf-shortcode-library-list-row {
        flex-direction: column;
    }

    .pdf-shortcode-library-list-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .pdf-shortcode-library-inline-edit-wrap {
        min-width: 0;
    }

    .pdf-shortcode-library-inline-edit-grid {
        grid-template-columns: 1fr;
    }
}

.pdfsl-canvas-shell.pdfsl-has-page {
    min-height: 0 !important;
    height: auto !important;
}

.pdfsl-canvas-shell-single.pdfsl-has-page,
.pdfsl-canvas-shell-grid.pdfsl-has-page {
    min-height: 0 !important;
}


.pdfsl-viewer-frame {
    background: #f1f1f1;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    overflow: hidden;
}

.pdfsl-iframe {
    display: block;
    width: 100%;
    background: #fff;
}

.pdf-shortcode-library-card-preview .pdfsl-viewer-frame {
    border-radius: 8px;
}

.pdf-shortcode-library-grid-manager-wrap {
    margin: 1.5em 0;
}

.pdf-shortcode-library-selector {
    margin: 14px 0 16px;
}

.pdf-shortcode-library-selector > strong {
    display: block;
    margin-bottom: 10px;
}

.pdf-shortcode-library-checkbox-grid-front {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 14px;
    margin-top: 10px;
}

.pdf-shortcode-library-checkbox-grid-front label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    margin: 0;
}

.pdf-shortcode-library-grid-manager-wrap .pdf-shortcode-library-debug {
    margin-top: 10px;
}


.pdf-shortcode-library-inline-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 4px 0 14px;
}

.pdf-shortcode-library-inline-checks label,
.pdf-shortcode-library-inline-check-single label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.pdf-shortcode-library-inline-check-single {
    margin: 0 0 14px;
}

.pdf-shortcode-library-checkbox-list-front {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 40em;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 10px;
    padding: 6px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    background: #fafafa;
}

.pdf-shortcode-library-checkbox-list-front label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
}

.pdf-shortcode-library-checkbox-list-front input[type="checkbox"] {
    margin-top: 2px;
}

.pdf-shortcode-library-card-preview .pdfsl-viewer {
    border: 0;
    border-radius: 0;
    background: #f7f7f7;
}

.pdf-shortcode-library-card-preview .pdfsl-toolbar {
    border-radius: 0;
}

@media (max-width: 640px) {
    .pdf-shortcode-library-grid {
        grid-template-columns: repeat(var(--pdfsl-grid-mobile-columns, 1), minmax(0, 1fr));
    }
}


.pdf-shortcode-library-grid-carousel-wrap {
    position: relative;
}

.pdf-shortcode-library-carousel-controls {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.pdf-shortcode-library-carousel-button {
    min-width: 42px;
    font-size: 20px;
    line-height: 1;
}

@media (min-width: 641px) {
    .pdf-shortcode-library-grid-carousel-desktop {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pdf-shortcode-library-grid-carousel-desktop::-webkit-scrollbar {
        display: none;
    }

    .pdf-shortcode-library-grid-carousel-desktop > .pdf-shortcode-library-card-front {
        flex: 0 0 var(--pdfsl-carousel-item-width, 100%);
        scroll-snap-align: start;
    }

    .pdf-shortcode-library-carousel-enabled-desktop .pdf-shortcode-library-carousel-controls {
        display: flex;
    }
}

@media (max-width: 640px) {
    .pdf-shortcode-library-grid-carousel-mobile {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        grid-template-columns: none;
    }

    .pdf-shortcode-library-grid-carousel-mobile::-webkit-scrollbar {
        display: none;
    }

    .pdf-shortcode-library-grid-carousel-mobile > .pdf-shortcode-library-card-front {
        flex: 0 0 var(--pdfsl-carousel-mobile-item-width, 100%);
        scroll-snap-align: start;
    }

    .pdf-shortcode-library-carousel-enabled-mobile .pdf-shortcode-library-carousel-controls {
        display: flex;
    }
}

.pdf-shortcode-library-grid-list-wrap {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e2e2e2;
}

.pdf-shortcode-library-grid-list-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.35;
}

.pdf-shortcode-library-grid-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-shortcode-library-grid-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eeeeee;
}

.pdf-shortcode-library-grid-list-main {
    min-width: 0;
    flex: 1 1 auto;
}

.pdf-shortcode-library-grid-list-link {
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
}

.pdf-shortcode-library-grid-list-item .pdf-shortcode-library-action-row {
    margin-top: 0;
    justify-content: flex-end;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .pdf-shortcode-library-grid-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .pdf-shortcode-library-grid-list-item .pdf-shortcode-library-action-row {
        width: 100%;
        justify-content: flex-start;
    }
}

.pdf-shortcode-library-grid-list-wrap-mobile {
    display: none;
}

.pdf-shortcode-library-grid-accordion-list {
    border: 1px solid #d8dde5;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.pdf-shortcode-library-grid-accordion-item {
    border-bottom: 1px solid #d8dde5;
}

.pdf-shortcode-library-grid-accordion-item:last-child {
    border-bottom: 0;
}

.pdf-shortcode-library-grid-accordion-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
}

.pdf-shortcode-library-grid-accordion-summary::-webkit-details-marker {
    display: none;
}

.pdf-shortcode-library-grid-accordion-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.pdf-shortcode-library-grid-accordion-icon::before,
.pdf-shortcode-library-grid-accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 3px;
    border-radius: 3px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.pdf-shortcode-library-grid-accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.pdf-shortcode-library-grid-accordion-item[open] .pdf-shortcode-library-grid-accordion-icon::after {
    display: none;
}

.pdf-shortcode-library-grid-accordion-title {
    min-width: 0;
    line-height: 1.35;
}

.pdf-shortcode-library-grid-accordion-content {
    padding: 0 14px 14px 42px;
}

.pdf-shortcode-library-grid-accordion-content .pdf-shortcode-library-action-row {
    justify-content: flex-start;
}

@media (min-width: 641px) {
    .pdf-shortcode-library-grid-list-wrap-mobile {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .pdf-shortcode-library-grid-list-wrap-desktop {
        display: none !important;
    }

    .pdf-shortcode-library-grid-list-wrap-mobile {
        display: block;
    }
}

/* Safari/Apple fallback: Safari can be unreliable with PDF.js canvas rendering, so it uses the browser native PDF viewer. */
.pdfsl-apple-fallback {
    padding: 14px;
    background: #f8f8f8;
}

.pdfsl-use-apple-fallback .pdfsl-toolbar,
.pdfsl-use-apple-fallback .pdfsl-canvas-shell,
.pdfsl-use-apple-fallback .pdfsl-loading,
.pdfsl-use-apple-fallback .pdfsl-error {
    display: none !important;
}

.pdfsl-use-apple-fallback .pdfsl-apple-fallback {
    display: block;
}

.pdfsl-native-pdf-viewer {
    width: 100%;
    min-height: 160px;
    margin-bottom: 12px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.pdfsl-native-pdf-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 160px;
    border: 0;
    background: #ffffff;
}

.pdfsl-native-pdf-viewer-grid {
    margin-bottom: 10px;
}

.pdfsl-apple-fallback-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background: #ffffff;
}

.pdfsl-apple-fallback-preview {
    flex: 0 0 76px;
    max-width: 76px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f2f2;
}

.pdfsl-apple-fallback-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.pdfsl-apple-fallback-content {
    min-width: 0;
    flex: 1 1 auto;
}

.pdfsl-apple-fallback-title {
    margin: 0 0 6px;
    font-weight: 700;
    line-height: 1.35;
}

.pdfsl-apple-fallback-text {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.82;
}

.pdfsl-apple-fallback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pdfsl-apple-fallback-grid {
    min-height: 160px;
}

.pdfsl-apple-fallback-grid .pdfsl-apple-fallback-inner {
    height: 100%;
    min-height: 132px;
    align-items: center;
}

@media (max-width: 640px) {
    .pdfsl-apple-fallback {
        padding: 10px;
    }

    .pdfsl-apple-fallback-inner {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .pdfsl-apple-fallback-preview {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .pdfsl-apple-fallback-actions .pdf-shortcode-library-button {
        flex: 1 1 140px;
        text-align: center;
    }
}


/* Scroll omejitev dolgih seznamov: privzeto prikaže največ 8 elementov in nato doda drsnik. */
.pdf-shortcode-library-scroll-limited {
    max-height: var(--pdfsl-scroll-max-height, 480px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

.pdf-shortcode-library-copy-manager-wrap {
    margin: 24px 0;
}

.pdf-shortcode-library-copy-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.pdf-shortcode-library-copy-card {
    margin: 0;
}

.pdf-shortcode-library-copy-card .pdf-shortcode-library-selector {
    margin-top: 14px;
}

@media (max-width: 900px) {
    .pdf-shortcode-library-copy-columns {
        grid-template-columns: 1fr;
    }
}

.pdf-shortcode-library-image-viewer {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f7f7f7;
    box-sizing: border-box;
}

.pdf-shortcode-library-image-viewer a {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pdf-shortcode-library-image-viewer img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.pdf-shortcode-library-image-viewer-single,
.pdf-shortcode-library-image-viewer-single a,
.pdf-shortcode-library-image-viewer-single img {
    max-height: var(--pdfsl-image-height, 900px);
}

.pdf-shortcode-library-image-viewer-grid,
.pdf-shortcode-library-image-viewer-grid a {
    height: var(--pdfsl-image-height, 260px);
}

.pdf-shortcode-library-image-viewer-grid img {
    max-height: 100%;
}

.pdf-shortcode-library-primary-file-note {
    padding: 10px 12px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    background: #fafafa;
}
