/* ADATASK_DEPT_FILES_MOBILE_V3310E */

/*
 * Scope is deliberately limited to the department files page.
 * Desktop behavior remains unchanged.
 */

.dept-share-page,
.dept-share-page *,
.dept-share-page *::before,
.dept-share-page *::after {
    box-sizing: border-box;
}

.dept-share-page {
    min-width: 0;
    max-width: 100%;
}

.dept-share-page .dept-share-layout,
.dept-share-page .dept-share-folders,
.dept-share-page .dept-share-files,
.dept-share-page .share-file-list,
.dept-share-page .share-file-card,
.dept-share-page .share-file-info,
.dept-share-page .share-file-info > div {
    min-width: 0;
    max-width: 100%;
}

.dept-share-page .share-file-info b,
.dept-share-page .share-file-info span,
.dept-share-page .share-folder-row b,
.dept-share-page .share-folder-row small {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dept-share-page .share-file-info > div {
    overflow: hidden;
}

.dept-share-page .share-file-info > div > b {
    white-space: normal;
    line-height: 1.65;
}

.dept-share-page .share-file-info > div > span {
    white-space: normal;
    line-height: 1.75;
}

.dept-share-page .share-file-actions {
    min-width: 0;
}

.dept-share-page .share-file-actions > button,
.dept-share-page .share-file-actions > a,
.dept-share-page .share-copy-link-v3277a,
.dept-share-page .share-download,
.dept-share-page .share-delete-btn,
.dept-share-page .share-file-share-btn,
.dept-share-page .share-view-btn {
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center;
}

.dept-share-page .share-thumb,
.dept-share-page .share-thumb img {
    max-width: 100%;
}

.dept-share-page .share-image-viewer img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.dept-share-page .share-image-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 900px) {
    .dept-share-page {
        overflow-x: hidden;
    }

    .dept-share-page .dept-share-hero {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .dept-share-page .dept-share-hero > div,
    .dept-share-page .dept-share-hero-actions {
        width: 100% !important;
        min-width: 0 !important;
    }

    .dept-share-page .dept-share-hero-actions {
        display: grid !important;
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        ) !important;
        gap: 8px !important;
    }

    .dept-share-page .dept-share-hero-actions > * {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px;
        white-space: normal !important;
    }

    .dept-share-page .dept-share-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
        width: 100% !important;
    }

    .dept-share-page .dept-share-folders,
    .dept-share-page .dept-share-files {
        width: 100% !important;
    }

    .dept-share-page .dept-share-folders {
        max-height: 330px;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .dept-share-page .share-folder-node {
        width: 100%;
        min-width: 0;
    }

    .dept-share-page .share-folder-row {
        display: grid !important;
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .dept-share-page .share-folder-row b {
        min-width: 0;
        white-space: normal !important;
    }

    .dept-share-page .share-folder-row small {
        max-width: 100%;
        white-space: normal !important;
        text-align: left;
    }

    .dept-share-page .share-file-head {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .dept-share-page .share-file-head > div {
        width: 100%;
        min-width: 0;
    }

    .dept-share-page .share-upload {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        min-height: 46px;
        text-align: center;
    }

    .dept-share-page .share-file-card {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .dept-share-page .share-file-info {
        display: grid !important;
        grid-template-columns:
            auto
            minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .dept-share-page .share-thumb,
    .dept-share-page .share-file-generic {
        flex: none;
    }

    .dept-share-page .share-file-actions {
        display: grid !important;
        grid-template-columns: repeat(
            auto-fit,
            minmax(110px, 1fr)
        ) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .dept-share-page .share-file-actions > button,
    .dept-share-page .share-file-actions > a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 42px;
        margin: 0 !important;
    }

    .dept-share-page .share-perm-table {
        display: grid;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }

    .dept-share-page .share-perm-row {
        display: grid !important;
        grid-template-columns:
            minmax(130px, 1fr)
            repeat(3, minmax(90px, auto)) !important;
        align-items: center !important;
        gap: 7px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .dept-share-page .share-perm-row > b {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .dept-share-page .share-perm-row > button {
        min-width: 0 !important;
        min-height: 40px;
        white-space: normal !important;
    }

    .dept-share-page .share-image-viewer {
        max-width: 100vw !important;
        padding: 12px !important;
    }

    .dept-share-page .share-image-viewer-actions > * {
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .dept-share-page {
        margin-inline: -4px;
    }

    .dept-share-page .dept-share-hero {
        padding: 14px !important;
        border-radius: 16px !important;
    }

    .dept-share-page .dept-share-hero-actions {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .dept-share-page .dept-share-summary-row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .dept-share-page .dept-share-folders,
    .dept-share-page .dept-share-files {
        padding: 10px !important;
        border-radius: 15px !important;
    }

    .dept-share-page .dept-share-folders {
        max-height: 280px;
    }

    .dept-share-page .share-folder-row {
        grid-template-columns:
            auto
            minmax(0, 1fr) !important;
    }

    .dept-share-page .share-folder-row small {
        grid-column: 1 / -1;
        text-align: right;
    }

    .dept-share-page .share-file-info {
        align-items: flex-start !important;
    }

    .dept-share-page .share-thumb,
    .dept-share-page .share-thumb img,
    .dept-share-page .share-file-generic {
        width: 58px !important;
        height: 58px !important;
    }

    .dept-share-page .share-file-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

    .dept-share-page .share-file-actions > button,
    .dept-share-page .share-file-actions > a {
        padding: 8px 6px !important;
        font-size: 11px !important;
    }

    .dept-share-page .share-perm-row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
        padding: 10px !important;
        border: 1px solid #e2e8f0;
        border-radius: 13px;
        background: #fff;
    }

    .dept-share-page .share-perm-row > b {
        grid-column: 1 / -1;
        padding-bottom: 5px;
    }

    .dept-share-page .share-perm-row > button {
        width: 100%;
        min-height: 44px;
    }

    .dept-share-page .share-perm-row > button:last-child {
        grid-column: 1 / -1;
    }

    .dept-share-page .share-image-viewer {
        padding:
            max(10px, env(safe-area-inset-top))
            8px
            max(10px, env(safe-area-inset-bottom)) !important;
    }

    .dept-share-page .share-image-viewer-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .dept-share-page .share-image-viewer-actions > * {
        width: 100% !important;
    }
}

/* /ADATASK_DEPT_FILES_MOBILE_V3310E */
