@media (max-width: 1100px) {
    :root {
        --page-padding: 20px;
    }

    .app-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    :root {
        --page-padding: 14px;
    }

    .app-header {
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .app-header-inner {
        gap: 12px;
    }

    .app-header-brand {
        min-width: 0;
    }

    .app-header-subtitle {
        font-size: 12px;
    }

    .app-header-user {
        flex-shrink: 0;
        gap: 10px;
    }

    .app-header-username {
        font-size: 13px;
    }

    .app-header-action {
        padding: 6px 10px;
    }

    .app-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .quick-panel {
        display: contents;
    }

    .quick-add-card {
        order: -1;
    }

    .files-panel {
        padding: 20px;
    }

    .folder-bar-actions {
        gap: 8px;
    }

    .folder-chip-select {
        padding: 6px 10px;
    }

    .file-item {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .file-item-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .file-item-actions {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .modal-backdrop {
        padding: 16px;
    }

    .modal {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
    }

    .modal > form {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .modal-footer {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .login-screen {
        padding: 16px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .pin-inputs {
        gap: 8px;
    }

    .pin-input {
        width: 48px;
        height: 56px;
        font-size: 20px;
    }
}
