.drone-documentation-gallery {
    min-width: 0;
    max-width: 100%;
    margin-top: 16px;
    padding: 20px;
    border: 1px solid #e1e8ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(25, 54, 79, .06);
}

.drone-documentation-gallery__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.drone-documentation-gallery__header h2 {
    margin: 4px 0 2px;
    color: #203b59;
    font-size: 18px;
    font-weight: 800;
}

.drone-documentation-gallery__header p {
    margin: 0;
    color: #74879a;
    font-size: 11px;
}

.drone-documentation-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.drone-documentation-filters button {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #d8e3ec;
    border-radius: 999px;
    background: #fff;
    color: #526a80;
    font-size: 11px;
    font-weight: 700;
}

.drone-documentation-filters button[aria-pressed="true"] {
    border-color: #1769e8;
    background: #1769e8;
    color: #fff;
}

.drone-documentation-status {
    margin: 0 0 12px;
    color: #74879a;
    font-size: 11px;
}

.drone-documentation-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-rows: repeat(2, max-content);
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 220px);
    grid-auto-rows: max-content;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-color: #aabaca #edf2f6;
    scrollbar-width: thin;
}

.drone-documentation-photo {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dce5ed;
    border-radius: 9px;
    background: #f4f7fa;
    color: #34495e;
    scroll-snap-align: start;
}

.drone-documentation-photo.is-selected {
    border-color: #1769e8;
    box-shadow: 0 0 0 2px rgba(23, 105, 232, .16);
}

.drone-documentation-photo__preview {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.drone-documentation-photo__preview:focus-visible,
.drone-documentation-photo__actions button:focus-visible {
    outline: 2px solid #1769e8;
    outline-offset: -2px;
}

.drone-documentation-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #e8eef3;
}

.drone-documentation-photo__caption {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
}

.drone-documentation-photo__caption strong {
    color: #1769a0;
    font-size: 10px;
}

.drone-documentation-photo__caption span {
    overflow: hidden;
    color: #60758a;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drone-documentation-photo__caption small {
    overflow: hidden;
    color: #8796a4;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drone-documentation-photo__actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 9px 9px;
}

.drone-documentation-photo__actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid #d5e0e9;
    border-radius: 5px;
    background: #fff;
    color: #526a80;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.drone-documentation-photo__actions button svg {
    width: 14px;
    height: 14px;
}

.drone-documentation-photo__actions button:last-child {
    color: #a3433a;
}

.drone-documentation-photo__actions button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.drone-documentation-modal {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: grid;
    place-items: center;
    padding: 20px;
}

.drone-documentation-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(14, 31, 48, .66);
}

.drone-documentation-modal__panel {
    position: relative;
    width: min(480px, 100%);
    max-height: min(90dvh, 760px);
    padding: 24px;
    overflow-y: auto;
    border: 1px solid #dbe5ed;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(13, 31, 51, .25);
}

.drone-documentation-modal__panel h2 {
    margin: 6px 32px 18px 0;
    color: #283f56;
    font-size: 18px;
    font-weight: 800;
}

.drone-documentation-modal__close {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #f0f4f7;
    color: #526a80;
    cursor: pointer;
}

#drone-documentation-upload-form {
    display: grid;
    gap: 12px;
}

#drone-documentation-upload-form label,
#drone-documentation-edit-form label {
    display: grid;
    gap: 6px;
    color: #4a6075;
    font-size: 11px;
    font-weight: 700;
}

#drone-documentation-upload-form input,
#drone-documentation-upload-form select,
#drone-documentation-edit-form input,
#drone-documentation-edit-form select {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #d6e1e9;
    border-radius: 6px;
    color: #2f465c;
    font-size: 12px;
}

#drone-documentation-upload-form input[type="file"] {
    padding: 7px;
}

.drone-documentation-upload-message {
    margin: 0;
    padding: 9px 10px;
    border-radius: 6px;
    background: #fff0ee;
    color: #a44236;
    font-size: 11px;
}

.drone-documentation-upload-message.is-success {
    background: #eaf8f0;
    color: #18734d;
}

#cesiumContainer.is-documentation-image > .pnlm-ui,
#cesiumContainer.is-documentation-image > .pnlm-render-container {
    visibility: hidden;
    pointer-events: none;
}

#cesiumContainer .drone-documentation-viewer-image {
    position: absolute;
    z-index: 10;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f4f7fa;
    transform-origin: center;
    touch-action: none;
    user-select: none;
}

#cesiumContainer .drone-documentation-viewer-caption {
    position: absolute;
    z-index: 21;
    right: 16px;
    bottom: 16px;
    left: 16px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
    white-space: nowrap;
}

#cesiumContainer.panorama-viewer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f7fa;
}

.drone-panorama-empty-state {
    padding: 20px;
    color: #74879a;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 700px) {
    .drone-documentation-gallery {
        padding: 14px;
    }

    .drone-documentation-gallery__header {
        align-items: stretch;
        flex-direction: column;
    }

    .drone-documentation-gallery__header > button {
        width: 100%;
    }

    .drone-documentation-grid {
        grid-auto-columns: minmax(145px, 165px);
        gap: 8px;
    }

    .drone-documentation-modal {
        padding: 12px;
    }

    .drone-documentation-modal__panel {
        padding: 20px 16px;
    }
}
