        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* Visible focus indicator for keyboard navigation (accessibility) */
        :focus-visible {
            outline: 3px solid #667eea;
            outline-offset: 2px;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            min-height: 100dvh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            padding-top: max(20px, env(safe-area-inset-top));
            padding-bottom: max(20px, env(safe-area-inset-bottom));
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }

        .container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            max-width: 1200px;
            width: 100%;
            overflow: hidden;
        }

        .header {
            background: white;
            color: #333;
            padding: 30px;
            padding-bottom: 0;
            text-align: center;
            border-bottom: 2px solid #e0e0e0;
        }

        .header img {
            max-height: 80px;
            max-width: 100%;
            width: auto;
            height: auto;
            margin-bottom: 10px;
        }

        .header p {
            opacity: 0.8;
            font-size: 1.1em;
            color: #555;
            margin-bottom: 0;
        }

        .content {
            padding: 30px;
        }

        .auth-container {
            max-width: 400px;
            margin: 0 auto;
            display: none;
        }

        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
            border-bottom: 2px solid #e0e0e0;
        }

        .tab {
            padding: 12px 24px;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1em;
            color: #666;
            transition: all 0.3s;
            border-bottom: 3px solid transparent;
        }

        .tab.active {
            color: #667eea;
            border-bottom-color: #667eea;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* ====== Service Navigation Tabs ====== */
        .service-tabs {
            display: flex;
            justify-content: center;
            gap: 0;
            margin-top: 18px;
            border-bottom: none;
        }

        .service-tab {
            padding: 10px 28px;
            background: none;
            border: 2px solid #e0e0e0;
            border-bottom: none;
            cursor: pointer;
            font-size: 0.95em;
            font-weight: 600;
            color: #888;
            transition: all 0.25s ease;
            border-radius: 10px 10px 0 0;
            margin: 0 -1px;
            position: relative;
            bottom: -1px;
            letter-spacing: 0.3px;
        }

        .service-tab:hover {
            color: #667eea;
            background: rgba(102, 126, 234, 0.05);
        }

        .service-tab.active {
            color: #667eea;
            background: white;
            border-color: #667eea;
            border-bottom-color: white;
            z-index: 1;
        }

        /* Service Panels */
        .service-panel {
            display: none;
        }

        .service-panel.active {
            display: block;
        }

        /* Coming Soon */
        .coming-soon {
            text-align: center;
            padding: 80px 20px;
            color: #888;
        }

        .coming-soon-icon {
            font-size: 3.5em;
            margin-bottom: 16px;
            opacity: 0.7;
        }

        .coming-soon h2 {
            font-size: 1.8em;
            color: #667eea;
            margin: 0 0 12px 0;
            font-weight: 700;
        }

        .coming-soon p {
            font-size: 1.05em;
            color: #999;
            max-width: 400px;
            margin: 0 auto;
            line-height: 1.5;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #333;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 1em;
            transition: border-color 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
        }

        .btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-secondary {
            background: #6c757d;
            margin-top: 10px;
        }

        .btn-danger {
            background: #dc3545;
            padding: 8px 16px;
            font-size: 0.9em;
            width: auto;
        }

        .btn-warning {
            background: #ffc107;
            color: #212529;
            padding: 8px 16px;
            font-size: 0.9em;
            width: auto;
        }

        .alert {
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 20px;
            font-size: 0.95em;
        }

        .alert-success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .alert-info {
            background: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }

        .alert-warning {
            background: #fff3cd;
            color: #856404;
            border: 1px solid #ffeeba;
        }

        .main-app {
            display: none;
        }

        .main-app.active {
            display: block;
        }

        .user-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 12px;
        }

        .user-info span {
            font-weight: 600;
            color: #667eea;
        }

        .upload-area {
            border: 3px dashed #667eea;
            border-radius: 12px;
            padding: 40px;
            text-align: center;
            margin-bottom: 30px;
            cursor: pointer;
            transition: all 0.3s;
            background: #f8f9fa;
        }

        .upload-area:hover {
            background: #e9ecef;
            border-color: #764ba2;
        }

        .upload-area.dragging {
            background: #e7e9fc;
            border-color: #667eea;
        }

        .upload-area.uploading {
            cursor: default;
            border-style: solid;
            background: #e7e9fc;
        }

        .upload-area input[type="file"] {
            display: none;
        }

        .upload-icon {
            font-size: 3em;
            margin-bottom: 15px;
            color: #667eea;
        }

        .upload-text {
            font-size: 1.1em;
            color: #666;
        }

        .upload-text small {
            display: block;
            margin-top: 8px;
            color: #888;
        }

        /* Enhanced Progress Section */
        .upload-progress-section {
            display: none;
            margin-bottom: 30px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 12px;
            border: 1px solid #e0e0e0;
        }

        .upload-progress-section.active {
            display: block;
        }

        .upload-file-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .upload-file-name {
            font-weight: 600;
            color: #333;
            word-break: break-all;
        }

        .upload-file-size {
            color: #666;
            font-size: 0.9em;
            white-space: nowrap;
            margin-left: 10px;
        }

        .progress-bar {
            width: 100%;
            height: 30px;
            background: #e9ecef;
            border-radius: 15px;
            overflow: hidden;
            margin-bottom: 15px;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            transition: width 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 0.9em;
            min-width: 50px;
        }

        .progress-fill.paused {
            background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
        }

        .progress-fill.error {
            background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
        }

        .upload-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 15px;
            margin-bottom: 15px;
        }

        .upload-stat {
            text-align: center;
            padding: 10px;
            background: white;
            border-radius: 8px;
            border: 1px solid #e0e0e0;
        }

        .upload-stat-value {
            font-weight: 700;
            color: #667eea;
            font-size: 1.1em;
        }

        .upload-stat-label {
            font-size: 0.8em;
            color: #666;
            margin-top: 3px;
        }

        .upload-controls {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .upload-controls button {
            padding: 10px 20px;
            font-size: 0.95em;
        }

        .upload-status-message {
            text-align: center;
            padding: 10px;
            margin-top: 10px;
            border-radius: 8px;
            font-size: 0.9em;
        }

        .upload-status-message.info {
            background: #d1ecf1;
            color: #0c5460;
        }

        .upload-status-message.warning {
            background: #fff3cd;
            color: #856404;
        }

        .upload-status-message.error {
            background: #f8d7da;
            color: #721c24;
        }

        .upload-status-message.success {
            background: #d4edda;
            color: #155724;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 12px;
            text-align: center;
        }

        .stat-value {
            font-size: 2em;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 0.9em;
            opacity: 0.9;
        }

        .stat-shared-info {
            font-size: 0.7em;
            font-weight: 400;
            opacity: 0.7;
            margin-top: -2px;
            margin-bottom: 2px;
        }

        .files-section {
            margin-top: 30px;
        }

        .files-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            gap: 15px;
        }

        .files-header h2 {
            margin: 0;
            color: #333;
            white-space: nowrap;
        }

        .file-search-container {
            position: relative;
            max-width: 300px;
            width: 100%;
        }

        .file-search-input {
            width: 100%;
            padding: 10px 35px 10px 14px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 0.95em;
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
            background: #fff;
            box-sizing: border-box;
        }

        .file-search-input:focus {
            border-color: #4285f4;
            box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
        }

        .file-search-clear {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            font-size: 1.3em;
            color: #999;
            cursor: pointer;
            padding: 2px 6px;
            line-height: 1;
            border-radius: 50%;
        }

        .file-search-clear:hover {
            color: #333;
            background: #eee;
        }

        @media (max-width: 600px) {
            .container {
                border-radius: 12px;
            }
            .files-header {
                flex-direction: column;
                align-items: stretch;
            }
            .file-search-container {
                max-width: 100%;
            }
        }

        .file-list {
            border: 1px solid #e0e0e0;
            border-radius: 12px;
            overflow: hidden;
        }

        .file-item {
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background 0.2s;
        }

        .file-item:last-child {
            border-bottom: none;
        }

        .file-item:hover {
            background: #f8f9fa;
        }

        .file-info {
            flex: 1;
        }

        .file-name {
            font-weight: 600;
            color: #333;
            margin-bottom: 5px;
        }

        .file-meta {
            font-size: 0.9em;
            color: #666;
        }

        .file-actions {
            display: flex;
            gap: 10px;
        }

        /* Grid view for files */
        .file-list.grid-view {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 15px;
            padding: 15px;
            border: none;
        }

        .file-list.grid-view .file-item {
            flex-direction: column;
            align-items: flex-start;
            border-bottom: none;
            border: 1px solid #e0e0e0;
            border-radius: 12px;
            padding: 15px;
        }

        .file-list.grid-view .file-item:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .file-list.grid-view .file-name {
            font-size: 0.95em;
            word-break: break-all;
        }

        .file-list.grid-view .file-actions {
            width: 100%;
            flex-wrap: wrap;
            margin-top: 10px;
            gap: 6px;
        }

        .file-list.grid-view .file-actions .btn {
            font-size: 0.8em;
            padding: 6px 10px !important;
        }

        /* Icon-style file action buttons */
        .btn-icon {
            width: 36px !important;
            height: 36px;
            padding: 0 !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.15em;
            border-radius: 8px;
            line-height: 1;
        }

        .btn-icon img {
            width: 20px;
            height: 20px;
        }

        .smlr-icon-btn {
            width: 36px;
            height: 36px;
            cursor: pointer;
            vertical-align: middle;
            border-radius: 8px;
            transition: opacity 0.2s;
        }

        .smlr-icon-btn:hover {
            opacity: 0.75;
        }

        .file-list.grid-view .file-actions .smlr-icon-btn {
            width: 32px;
            height: 32px;
        }

        /* ---- Bulk selection ---- */
        .files-header { align-items: center; }
        .files-header-right {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            justify-content: flex-end;
        }
        .btn-select-mode {
            padding: 7px 16px;
            font-size: 0.88em;
            width: auto;
            background: #6c757d;
            flex-shrink: 0;
        }
        .bulk-action-bar {
            align-items: center;
            gap: 12px;
            padding: 10px 20px;
            background: #f0f4ff;
            border-bottom: 1px solid #c8d4f5;
            flex-wrap: wrap;
        }
        .bulk-action-bar #bulkCount {
            font-weight: 600;
            color: #4a5568;
            min-width: 90px;
        }
        .bulk-actions { display: flex; gap: 8px; flex: 1; }
        .btn-bulk-download, .btn-bulk-delete, .btn-select-all, .btn-bulk-cancel {
            padding: 7px 14px;
            font-size: 0.85em;
            width: auto;
        }
        .btn-bulk-download { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
        .btn-select-all    { background: #6c757d; }
        .btn-bulk-cancel   { background: #6c757d; }
        .file-checkbox-wrap {
            display: flex;
            align-items: center;
            padding-right: 14px;
            flex-shrink: 0;
        }
        .file-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: #667eea;
        }
        .file-item.is-selected        { background: #eef2ff; }
        .file-item.is-selected:hover  { background: #e4eaff; }
        .selection-mode .file-item    { cursor: pointer; user-select: none; }

        /* ---- Folder items ---- */
        .folder-item {
            padding: 14px 20px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            transition: background 0.2s;
            background: #fafbff;
        }
        .folder-item:last-child { border-bottom: none; }
        .folder-item:hover { background: #eef2ff; cursor: pointer; }
        .folder-item.is-selected { background: #e4eaff; }
        .folder-item.is-selected:hover { background: #dce5ff; }
        .selection-mode .folder-item { user-select: none; }
        .folder-item-icon { font-size: 1.5em; margin-right: 14px; flex-shrink: 0; }
        .folder-item-info { flex: 1; min-width: 0; }
        .folder-item-name {
            font-weight: 700;
            color: #4a4a8a;
            margin-bottom: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .folder-item-meta { font-size: 0.85em; color: #888; }
        .folder-item-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: 12px; }
        .folder-divider {
            padding: 6px 20px 4px;
            font-size: 0.72em;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: #aaa;
            background: #f4f4fb;
            border-bottom: 1px solid #e9ecef;
        }

        /* Folder view breadcrumb/header */
        .folder-view-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 20px;
            background: #f0f4ff;
            border-bottom: 1px solid #c8d4f5;
            flex-wrap: wrap;
        }
        .folder-view-breadcrumb {
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 1;
            font-size: 0.95em;
            color: #444;
            font-weight: 500;
            min-width: 0;
        }
        .folder-view-breadcrumb .bc-root {
            color: #667eea;
            cursor: pointer;
            background: none;
            border: none;
            font-size: inherit;
            font-weight: 600;
            padding: 0;
            text-decoration: underline;
        }
        .folder-view-breadcrumb .bc-root:hover { color: #4a5fd6; }
        .folder-view-breadcrumb .bc-sep { color: #bbb; }
        .folder-view-breadcrumb .bc-name {
            color: #333;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .folder-view-actions { display: flex; gap: 8px; flex-wrap: wrap; }
        .btn-folder-dl { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 7px 13px; font-size: 0.82em; width: auto; }
        .btn-folder-upload { background: linear-gradient(135deg, #43b89c 0%, #2e8b72 100%); padding: 7px 13px; font-size: 0.82em; width: auto; }
        .btn-folder-share { background: linear-gradient(135deg, #667eea 0%, #5a4fcf 100%); padding: 7px 13px; font-size: 0.82em; width: auto; }
        .btn-folder-rename { background: #6c757d; padding: 7px 13px; font-size: 0.82em; width: auto; }
        .btn-folder-disintegrate { background: #856404; padding: 7px 13px; font-size: 0.82em; width: auto; }
        .btn-folder-disintegrate:hover { background: #6d5202; }
        .btn-folder-delete { padding: 7px 13px; font-size: 0.82em; width: auto; }
        .btn-remove-from-folder { background: #6c757d; padding: 6px 11px; font-size: 0.8em; width: auto; }

        /* Create Folder / Add to Folder buttons in bulk bar */
        .btn-create-folder {
            background: linear-gradient(135deg, #43b89c 0%, #2e8b72 100%);
            padding: 7px 14px;
            font-size: 0.85em;
            width: auto;
        }
        .btn-create-folder:hover { opacity: 0.88; }

        /* Add to Folder dropdown */
        .add-to-folder-wrap {
            position: relative;
            display: none;
        }
        .btn-add-to-folder {
            background: linear-gradient(135deg, #5a8dee 0%, #3a6fd8 100%);
            padding: 7px 14px;
            font-size: 0.85em;
            width: auto;
        }
        .btn-add-to-folder:hover { opacity: 0.88; }
        .folder-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            background: #fff;
            border: 1px solid #dde3f0;
            border-radius: 10px;
            box-shadow: 0 6px 24px rgba(0,0,0,0.13);
            min-width: 200px;
            max-width: 280px;
            z-index: 999;
            overflow: hidden;
            display: none;
        }
        .folder-dropdown.open { display: block; }
        .folder-dropdown-item {
            padding: 10px 16px;
            cursor: pointer;
            font-size: 0.9em;
            color: #333;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s;
        }
        .folder-dropdown-item:hover { background: #f0f4ff; }
        .folder-dropdown-item + .folder-dropdown-item { border-top: 1px solid #f0f0f0; }

        /* Timeline group headers */
        .timeline-group-header {
            padding: 8px 20px 6px;
            font-size: 0.75em;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: #999;
            background: #f8f9fa;
            border-top: 1px solid #e9ecef;
            border-bottom: 1px solid #e9ecef;
        }
        .timeline-group-header:first-child {
            border-top: none;
        }

        .file-list.grid-view .file-actions .btn-icon {
            width: 32px !important;
            height: 32px;
            font-size: 1em;
        }

        .file-list.grid-view .file-actions .btn-icon img {
            width: 16px;
            height: 16px;
        }

        /* ---- Grid view: file cards fill height properly ---- */
        .file-list.grid-view .file-item {
            justify-content: space-between;
            min-height: 130px;
            position: relative;
            overflow: hidden;
        }
        .file-list.grid-view .file-info,
        .file-list.grid-view .file-actions,
        .file-list.grid-view .file-checkbox-wrap {
            position: relative;
            z-index: 1;
        }
        /* Watermark pseudo-element */
        .file-list.grid-view .file-item::before {
            content: attr(data-watermark);
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 80px;
            line-height: 1;
            opacity: 0.07;
            pointer-events: none;
            z-index: 0;
            user-select: none;
        }
        .file-list.grid-view .file-info {
            flex: 1;
            width: 100%;
            min-width: 0;
        }
        .file-list.grid-view .file-name {
            font-size: 1em;
            font-weight: 600;
            margin-bottom: 4px;
        }
        .file-list.grid-view .file-meta {
            font-size: 0.82em;
            color: #888;
        }

        /* ---- Grid view: folder cards ---- */
        .file-list.grid-view .folder-item {
            flex-direction: column;
            align-items: flex-start;
            border-bottom: none;
            border: 1px solid #c8d4f5;
            border-radius: 12px;
            padding: 15px;
            background: #f5f7ff;
            cursor: pointer;
            justify-content: space-between;
            min-height: 110px;
        }
        .file-list.grid-view .folder-item:last-child { border-bottom: none; }
        .file-list.grid-view .folder-item:hover { box-shadow: 0 4px 12px rgba(102,126,234,0.15); background: #eef1ff; }
        .file-list.grid-view .folder-item-icon {
            font-size: 2em;
            margin-right: 0;
            margin-bottom: 6px;
            line-height: 1;
        }
        .file-list.grid-view .folder-item-info {
            flex: 1;
            width: 100%;
            min-width: 0;
            margin-bottom: 10px;
        }
        .file-list.grid-view .folder-item-name {
            white-space: normal;
            overflow: visible;
            text-overflow: unset;
            word-break: break-word;
            font-size: 1em;
        }
        .file-list.grid-view .folder-item-meta {
            font-size: 0.8em;
            margin-top: 2px;
            white-space: normal;
        }
        .file-list.grid-view .folder-item-actions {
            width: 100%;
            margin-left: 0;
            flex-wrap: wrap;
            gap: 6px;
        }
        .file-list.grid-view .folder-item-actions .btn {
            font-size: 0.78em;
            padding: 5px 9px !important;
        }

        /* Folder view header and timeline headers span all grid columns */
        .file-list.grid-view .folder-view-header,
        .file-list.grid-view .timeline-group-header {
            grid-column: 1 / -1;
        }

        /* Settings modal styles */
        .settings-section {
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
        }

        .settings-section:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .settings-section h4 {
            margin: 0 0 15px 0;
            color: #333;
            font-size: 1em;
        }

        .settings-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            min-height: 44px;
        }

        .settings-row label {
            flex: 1;
            color: #555;
            font-size: 0.95em;
        }

        .settings-row .settings-desc {
            font-size: 0.8em;
            color: #999;
            display: block;
            margin-top: 2px;
        }

        .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
            margin-left: 15px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background: #ccc;
            border-radius: 24px;
            transition: 0.3s;
        }

        .toggle-slider::before {
            content: "";
            position: absolute;
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background: white;
            border-radius: 50%;
            transition: 0.3s;
        }

        .toggle-switch input:checked + .toggle-slider {
            background: #667eea;
        }

        .toggle-switch input:checked + .toggle-slider::before {
            transform: translateX(20px);
        }

        .settings-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 0.95em;
            margin-top: 6px;
            transition: border-color 0.2s;
        }

        .settings-input:focus {
            outline: none;
            border-color: #667eea;
        }

        .settings-form-group {
            margin-bottom: 12px;
        }

        .settings-alert {
            padding: 10px 14px;
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 0.88em;
            display: none;
        }
        .settings-alert-error   { background: #fde8e8; color: #7f1d1d; border: 1px solid #fca5a5; }
        .settings-alert-success { background: #d1fae5; color: #064e3b; border: 1px solid #6ee7b7; }

        .password-strength { height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; }
        .password-strength-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; width: 0%; }
        .strength-label { font-size: 0.78em; margin-top: 4px; color: #888; min-height: 1.2em; }

        .input-wrapper { position: relative; }
        .toggle-pw {
            position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
            background: none; border: none; cursor: pointer; color: #888;
            font-size: 0.82em; padding: 4px 6px; min-width: 40px; min-height: 36px;
            display: flex; align-items: center; justify-content: flex-end;
        }
        .toggle-pw:hover { color: #444; }

        .profile-pic-section {
            display: flex;
            align-items: center;
            gap: 20px;
            margin-bottom: 15px;
        }

        .profile-pic-preview {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
            font-size: 2em;
            color: #999;
        }

        .profile-pic-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-pic-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .profile-pic-actions button {
            padding: 6px 14px;
            font-size: 0.85em;
            border-radius: 6px;
            cursor: pointer;
            border: 1px solid #ddd;
            background: white;
            transition: all 0.2s;
        }

        .profile-pic-actions button:hover {
            border-color: #667eea;
            color: #667eea;
        }

        .profile-pic-actions .btn-remove {
            color: #dc3545;
            border-color: #dc3545;
        }

        .profile-pic-actions .btn-remove:hover {
            background: #dc3545;
            color: white;
        }

        .header-profile-pic {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            vertical-align: middle;
            margin-right: 8px;
            font-size: 0.9em;
        }

        .header-profile-pic img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .settings-form-group label {
            display: block;
            font-size: 0.9em;
            color: #555;
            margin-bottom: 4px;
        }

        .view-toggle {
            display: flex;
            gap: 0;
            margin-left: 15px;
        }

        .view-toggle button {
            padding: 6px 14px;
            border: 1px solid #ddd;
            background: white;
            cursor: pointer;
            font-size: 0.85em;
            color: #555;
            transition: all 0.2s;
        }

        .view-toggle button:first-child {
            border-radius: 6px 0 0 6px;
        }

        .view-toggle button:last-child {
            border-radius: 0 6px 6px 0;
            border-left: none;
        }

        .view-toggle button.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

        .empty-state-icon {
            font-size: 4em;
            margin-bottom: 20px;
            opacity: 0.3;
        }

        /* Pending uploads section */
        .pending-uploads-section {
            display: none;
            margin-bottom: 20px;
            padding: 15px;
            background: #fff3cd;
            border: 1px solid #ffc107;
            border-radius: 12px;
        }

        .pending-uploads-section.active {
            display: block;
        }

        .pending-uploads-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .pending-uploads-header h3 {
            color: #856404;
            font-size: 1em;
        }

        .pending-upload-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background: white;
            border-radius: 8px;
            margin-top: 10px;
        }

        .pending-upload-info {
            flex: 1;
        }

        .pending-upload-name {
            font-weight: 600;
            color: #333;
            font-size: 0.9em;
        }

        .pending-upload-progress {
            font-size: 0.8em;
            color: #666;
        }

        /* Upload Queue Section */
        .upload-queue-section {
            display: none;
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border: 1px solid #e0e0e0;
            border-radius: 12px;
        }

        .upload-queue-section.active {
            display: block;
        }

        .upload-queue-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .upload-queue-header h3 {
            color: #333;
            font-size: 1em;
            margin: 0;
        }

        .upload-queue-actions {
            display: flex;
            gap: 8px;
        }

        .upload-queue-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .queue-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background: white;
            border-radius: 8px;
            margin-bottom: 8px;
            border: 1px solid #e0e0e0;
        }

        .queue-item:last-child {
            margin-bottom: 0;
        }

        .queue-item.active {
            border-color: #667eea;
            background: #f0f2ff;
        }

        .queue-item.completed {
            border-color: #28a745;
            background: #d4edda;
        }

        .queue-item.error {
            border-color: #dc3545;
            background: #f8d7da;
        }

        .queue-item-info {
            flex: 1;
            min-width: 0;
        }

        .queue-item-name {
            font-weight: 600;
            color: #333;
            font-size: 0.9em;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .queue-item-status {
            font-size: 0.8em;
            color: #666;
            margin-top: 2px;
        }

        .queue-item-progress {
            width: 100px;
            height: 6px;
            background: #e9ecef;
            border-radius: 3px;
            overflow: hidden;
            margin: 0 15px;
        }

        .queue-item-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            transition: width 0.3s;
        }

        .queue-item-actions {
            display: flex;
            gap: 5px;
        }

        .queue-item-remove {
            background: none;
            border: none;
            color: #dc3545;
            cursor: pointer;
            font-size: 1.2em;
            padding: 0 5px;
            opacity: 0.7;
            transition: opacity 0.2s;
        }

        .queue-item-remove:hover {
            opacity: 1;
        }

        /* File Queue Table Styles */
        #fileQueueTable {
            background: #fff;
        }
        #fileQueueTable thead tr {
            background: #f5f5f5;
        }
        #fileQueueTable th {
            border-bottom: 2px solid #ddd;
            color: #333;
        }
        .file-queue-row {
            transition: background-color 0.2s;
        }
        .file-queue-row:hover {
            background-color: #f5f5f5;
        }
        .file-queue-row:nth-child(even) {
            background-color: #fafafa;
        }
        .file-queue-row:nth-child(even):hover {
            background-color: #f0f0f0;
        }
        .file-queue-row td {
            padding: 10px 12px;
            border-bottom: 1px solid #eee;
            vertical-align: middle;
            color: #333;
        }
        .file-queue-actions {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .file-action-btn {
            background: none;
            border: 1px solid #ddd;
            border-radius: 6px;
            padding: 6px 10px;
            cursor: pointer;
            font-size: 1.1em;
            transition: all 0.2s;
        }
        .file-action-btn:hover {
            background: #f0f0f0;
        }
        .file-action-btn.password-btn { border-color: #ffc107; }
        .file-action-btn.password-btn:hover { background: #fff3cd; }
        .file-action-btn.password-btn.has-password { background: #fff3cd; border-color: #ff9800; }
        .file-action-btn.upload-btn { border-color: #4CAF50; color: #4CAF50; }
        .file-action-btn.upload-btn:hover { background: #e8f5e9; }
        .file-action-btn.remove-btn { border-color: #f44336; color: #f44336; }
        .file-action-btn.remove-btn:hover { background: #ffebee; }
        .file-password-input {
            display: none;
            width: 120px;
            padding: 5px 8px;
            border: 1px solid #ffc107;
            border-radius: 4px;
            font-size: 0.85em;
        }
        .file-password-input.visible {
            display: inline-block;
        }
        .file-password-options {
            display: none;
            position: fixed;
            z-index: 1000;
            background: #fff;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            min-width: 280px;
        }
        .file-password-options.visible {
            display: block;
        }
        .file-password-options label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            font-size: 0.9em;
        }
        .file-password-options small {
            color: #666;
            font-size: 0.8em;
            display: block;
            margin-top: 3px;
            margin-left: 20px;
        }
        .file-password-options .password-mode-group {
            display: flex;
            gap: 12px;
            margin-bottom: 8px;
        }
        .file-password-options hr {
            border: none;
            border-top: 1px solid #eee;
            margin: 10px 0;
        }
        .file-queue-actions {
            position: relative;
        }
        .file-queue-progress {
            height: 4px;
            background: #e0e0e0;
            border-radius: 2px;
            margin-top: 5px;
            display: none;
        }
        .file-queue-progress.active {
            display: block;
        }
        .file-queue-progress-fill {
            height: 100%;
            background: #4CAF50;
            border-radius: 2px;
            transition: width 0.3s;
        }
        .file-queue-status {
            font-size: 0.8em;
            color: #666;
            margin-top: 3px;
        }
        .upload-result-item {
            padding: 12px;
            background: #fff;
            border-radius: 6px;
            margin-bottom: 10px;
            border: 1px solid #c8e6c9;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 10px;
        }
        .upload-result-item .result-content {
            flex: 1;
        }
        .upload-result-item .file-name {
            font-weight: 600;
            color: #333;
        }
        .upload-result-item .file-info {
            color: #666;
            font-size: 0.9em;
            margin: 5px 0;
        }
        .upload-result-item .token-link {
            display: inline-block;
            margin-top: 8px;
            padding: 6px 12px;
            background: #667eea;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-size: 0.9em;
        }
        .upload-result-item .token-link:hover {
            background: #5a6fd6;
        }
        .upload-result-item .result-remove-btn {
            background: transparent;
            border: none;
            color: #999;
            font-size: 1.4em;
            cursor: pointer;
            padding: 0 5px;
            line-height: 1;
            transition: color 0.2s;
        }
        .upload-result-item .result-remove-btn:hover {
            color: #f44336;
        }

        /* Guest Info Bar */
        .guest-info-bar {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px 20px;
            border-radius: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 10px;
        }
        .guest-info-bar .guest-info-text {
            display: flex;
            align-items: center;
            gap: 15px;
            flex-wrap: wrap;
        }
        .guest-info-bar .guest-badge {
            background: rgba(255,255,255,0.2);
            padding: 4px 12px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.9em;
        }
        .guest-info-bar .guest-usage {
            font-size: 0.9em;
            opacity: 0.9;
        }
        .guest-info-bar .guest-login-btn {
            background: white;
            color: #667eea;
            border: none;
            padding: 8px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9em;
            transition: all 0.2s;
        }
        .guest-info-bar .guest-login-btn:hover {
            background: #f0f0f0;
            transform: translateY(-1px);
        }
        /* Pagination Styles */
        .pagination-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: #f8f9fa;
            border-top: 1px solid #e0e0e0;
            flex-wrap: wrap;
            gap: 15px;
        }

        .pagination-info {
            color: #666;
            font-size: 0.9em;
        }

        .pagination-buttons {
            display: flex;
            gap: 5px;
            align-items: center;
        }

        .pagination-btn {
            padding: 8px 12px;
            border: 1px solid #e0e0e0;
            background: white;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.2s;
            color: #333;
        }

        .pagination-btn:hover:not(:disabled) {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .pagination-settings {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .pagination-select {
            padding: 6px 10px;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            font-size: 0.9em;
            cursor: pointer;
        }

        .pagination-select:focus {
            outline: none;
            border-color: #667eea;
        }

        .sort-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .sort-controls label {
            color: #666;
            font-size: 0.9em;
        }

        /* Token/Compression Password Styles */
        .password-section {
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 12px;
            border: 1px solid #e0e0e0;
        }

        .password-section-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .password-section-header label {
            font-weight: 600;
            color: #333;
        }

.password-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.password-input {
    flex: 1 1 auto;
    min-width: 0; /* IMPORTANT: prevents flex overflow */
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    -webkit-text-security: disc; /* mask text without type="password" to avoid autofill */
}

/* Keep button inside container */
.password-input-container button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 480px) {

    .password-input-container {
        flex-direction: row;
        gap: 8px;
    }

    .password-input-container button {
        padding: 8px 12px !important;
        font-size: 0.9em;
    }
}

        .password-input:focus {
            outline: none;
            border-color: #667eea;
        }

        .btn-token {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 8px 16px;
            font-size: 0.9em;
            width: auto;
        }

        .btn-download {
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        }

        .btn-play {
            background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
            padding: 8px 16px;
            font-size: 0.9em;
            width: auto;
        }

        .btn-play:hover {
            background: linear-gradient(135deg, #5a32a3 0%, #d63384 100%);
        }

        .btn-view {
            background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
            padding: 8px 16px;
            font-size: 0.9em;
            width: auto;
        }

        .btn-view:hover {
            background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
        }

        /* File Viewer Modal */
        .file-viewer-content {
            max-width: 900px !important;
            width: 95% !important;
            max-height: 90vh;
            max-height: 90dvh;
        }

        .file-viewer-content .modal-body {
            overflow: auto;
            max-height: calc(90vh - 130px);
            max-height: calc(90dvh - 130px);
            -webkit-overflow-scrolling: touch;
        }

        .file-viewer-content img {
            max-width: 100%;
            max-height: 70vh;
            max-height: 70dvh;
            display: block;
            margin: 10px auto;
            border-radius: 8px;
            object-fit: contain;
        }

        .file-viewer-content iframe {
            width: 100%;
            height: 70vh;
            height: 70dvh;
            border: 1px solid #eee;
            border-radius: 8px;
        }

        .file-viewer-content pre {
            background: #1e1e1e;
            color: #d4d4d4;
            padding: 20px;
            border-radius: 8px;
            overflow: auto;
            max-height: 70vh;
            max-height: 70dvh;
            font-size: 0.9em;
            line-height: 1.5;
            white-space: pre-wrap;
            word-wrap: break-word;
            -webkit-overflow-scrolling: touch;
        }

        /* Media Player Modal */
        .media-player-content {
            max-width: 800px !important;
            width: 95% !important;
        }

        .media-player-content video,
        .media-player-content audio {
            width: 100%;
            border-radius: 8px;
            margin: 15px 0;
            background: #000;
        }

        .media-player-content video {
            max-height: 60vh;
            max-height: 60dvh;
        }

        .stream-url-section {
            margin-top: 15px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
        }

        .stream-url-section .stream-url-row {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        .stream-url-section input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 0.85em;
            font-family: monospace;
        }

        /* Modal Styles */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: white;
            border-radius: 16px;
            padding: 30px;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .modal-header h3 {
            margin: 0;
            color: #333;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5em;
            cursor: pointer;
            color: #666;
        }

        .modal-close:hover {
            color: #333;
        }

        .modal-body {
            margin-bottom: 20px;
        }

        .modal-footer {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        /* Plans & Pricing Modal */
        .plans-modal {
            max-width: 820px !important;
            width: 95% !important;
        }

        .plans-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 14px;
        }

        .plan-card {
            border: 2px solid #e9ecef;
            border-radius: 12px;
            padding: 20px 16px;
            text-align: center;
            transition: border-color 0.2s, box-shadow 0.2s;
            position: relative;
        }

        .plan-card:hover {
            border-color: #4a9eff;
            box-shadow: 0 4px 16px rgba(74, 158, 255, 0.15);
        }

        .plan-card.current {
            border-color: #4a9eff;
            background: #f0f7ff;
        }

        .plan-card .plan-badge {
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            background: #4a9eff;
            color: #fff;
            font-size: 0.7em;
            font-weight: 600;
            padding: 2px 10px;
            border-radius: 10px;
            white-space: nowrap;
        }

        .plan-card h4 {
            margin: 0 0 6px 0;
            font-size: 1.05em;
            color: #333;
        }

        .plan-card .plan-price {
            font-size: 1.4em;
            font-weight: 700;
            color: #222;
            margin-bottom: 4px;
        }

        .plan-card .plan-price-sub {
            font-size: 0.7em;
            color: #888;
            font-weight: 400;
            margin-bottom: 14px;
            display: block;
        }

        .plan-card .plan-limits {
            list-style: none;
            padding: 0;
            margin: 0;
            font-size: 0.82em;
            color: #555;
            text-align: left;
        }

        .plan-card .plan-limits li {
            padding: 5px 0;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-between;
        }

        .plan-card .plan-limits li:first-child {
            border-top: none;
        }

        .plan-card .plan-limits .limit-value {
            font-weight: 600;
            color: #333;
        }

        @media (max-width: 700px) {
            .plans-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 400px) {
            .plans-grid {
                grid-template-columns: 1fr;
            }
        }

        .file-details {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
        }

        .file-details-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #e0e0e0;
        }

        .file-details-row:last-child {
            border-bottom: none;
        }

        .file-details-label {
            color: #666;
        }

        .file-details-value {
            font-weight: 600;
            color: #333;
        }

        .smlr-badge {
            display: inline-block;
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
            color: white;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.8em;
            font-weight: 600;
        }

        @media (max-width: 768px) {
            body {
                padding: 10px;
                padding-top: max(10px, env(safe-area-inset-top));
                padding-bottom: max(10px, env(safe-area-inset-bottom));
                padding-left: max(10px, env(safe-area-inset-left));
                padding-right: max(10px, env(safe-area-inset-right));
                align-items: flex-start;
            }

            .header {
                padding: 20px 15px;
            }

            .header img {
                max-height: 60px;
            }

            .header p {
                font-size: 0.95em;
            }

            .service-tab {
                padding: 8px 20px;
                font-size: 0.88em;
            }

            .coming-soon {
                padding: 60px 15px;
            }

            .coming-soon h2 {
                font-size: 1.4em;
            }

            .header h1 {
                font-size: 1.5em;
            }

            .content {
                padding: 20px 15px;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .file-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
                padding: 15px;
            }

            .file-actions {
                width: 100%;
                flex-wrap: wrap;
                gap: 8px;
            }

            .file-actions button {
                flex: 1 1 auto;
                min-width: 0;
                font-size: 0.85em;
                padding: 8px 10px !important;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .file-actions .smlr-icon-btn {
                flex: 0 0 auto;
            }

            .upload-stats {
                grid-template-columns: repeat(2, 1fr);
            }

            .upload-controls {
                flex-wrap: wrap;
            }

            .upload-file-info {
                flex-direction: column;
                align-items: flex-start;
                gap: 5px;
            }

            .upload-file-size {
                margin-left: 0;
            }

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

            .queue-item-progress {
                width: 100%;
                order: 3;
                margin: 0;
            }

            .upload-queue-header {
                flex-direction: column;
                gap: 10px;
                align-items: flex-start;
            }

            .pagination-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .pagination-settings {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
            }

            .sort-controls {
                justify-content: space-between;
            }

            .pagination-buttons {
                justify-content: center;
            }

            .pagination-info {
                text-align: center;
            }

            .user-info {
                flex-direction: column;
                gap: 10px;
                text-align: center;
            }

            /* Folder list items: stack vertically on mobile */
            .folder-item {
                flex-wrap: wrap;
                align-items: flex-start;
                gap: 10px;
            }
            .folder-item-icon {
                margin-right: 10px;
            }
            .folder-item-info {
                flex: 1 1 0;
                min-width: 0;
            }
            .folder-item-actions {
                flex-shrink: 1;
                flex-wrap: wrap;
                margin-left: 0;
                width: 100%;
                gap: 6px;
            }
            .folder-item-actions .btn {
                flex: 1 1 auto;
                font-size: 0.8em;
                padding: 7px 10px !important;
                white-space: nowrap;
                min-width: 0;
            }

            /* Folder view header: stack breadcrumb above actions */
            .folder-view-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
            .folder-view-breadcrumb {
                width: 100%;
            }
            .folder-view-actions {
                width: 100%;
            }
            .folder-view-actions .btn {
                flex: 1 1 auto;
                font-size: 0.8em;
                padding: 7px 10px !important;
                white-space: nowrap;
                min-width: 0;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 5px;
                padding-top: max(5px, env(safe-area-inset-top));
                padding-bottom: max(5px, env(safe-area-inset-bottom));
                padding-left: max(5px, env(safe-area-inset-left));
                padding-right: max(5px, env(safe-area-inset-right));
                align-items: flex-start;
            }

            .header {
                padding: 15px 10px;
            }

            .header img {
                max-height: 50px;
            }

            .header p {
                font-size: 0.85em;
            }

            .service-tab {
                padding: 7px 14px;
                font-size: 0.82em;
            }

            .coming-soon {
                padding: 50px 10px;
            }

            .coming-soon-icon {
                font-size: 2.5em;
            }

            .coming-soon h2 {
                font-size: 1.2em;
            }

            .content {
                padding: 15px 10px;
            }

            .file-item {
                padding: 12px;
            }

            .file-actions {
                gap: 6px;
            }

            .file-actions button {
                font-size: 0.8em;
                padding: 6px 8px !important;
            }

            .file-list.grid-view {
                grid-template-columns: 1fr;
            }

            .folder-item-actions .btn,
            .folder-view-actions .btn {
                font-size: 0.75em;
                padding: 6px 8px !important;
            }
        }
        /* ====== Universal Loading Indicator - Top Bar ====== */
        .loading-bar {
            position: fixed;
            top: 0;
            top: env(safe-area-inset-top, 0px);
            left: 0;
            width: 100%;
            height: 3px;
            z-index: 2000;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .loading-bar.active {
            opacity: 1;
        }

        .loading-bar-fill {
            height: 100%;
            width: 30%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 0 2px 2px 0;
            animation: loadingBarSlide 1.5s ease-in-out infinite;
        }

        @keyframes loadingBarSlide {
            0% { transform: translateX(-100%); width: 30%; }
            50% { transform: translateX(150%); width: 40%; }
            100% { transform: translateX(400%); width: 30%; }
        }

        /* ====== Universal Loading Overlay ====== */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }

        .loading-overlay.active {
            display: flex;
        }

        .loading-overlay-content {
            background: white;
            border-radius: 16px;
            padding: 40px 50px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .loading-spinner {
            width: 44px;
            height: 44px;
            border: 4px solid #e9ecef;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            animation: loadingSpin 0.8s linear infinite;
            margin: 0 auto 16px auto;
        }

        @keyframes loadingSpin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .loading-message {
            color: #333;
            font-size: 1em;
            font-weight: 500;
        }
		
@media (max-width: 768px) {

    /* Prevent the entire section from scrolling */
    #fileQueueSection {
        overflow-x: visible;
    }

    /* Only the table container should scroll */
    #fileQueueSection .fileQueueTableWrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Force table to exceed screen width */
    #fileQueueTable {
        min-width: 650px;
    }

    /* Smaller padding for mobile */
    #fileQueueTable th,
    #fileQueueTable td {
        padding: 8px 6px;
    }

    /* Smaller action buttons on mobile */
    .file-action-btn {
        padding: 5px 8px !important;
        font-size: 0.9em;
    }

    /* Adjust password panel positioning */
    .file-password-options.visible {
        position: fixed;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
        width: 280px;
        max-width: 90vw;
        z-index: 1000;
    }
	
	    /* Allow table to grow wider than screen */
    #fileQueueTable {
        width: max-content;
        min-width: 650px;
    }

    /* File Name column should expand to filename length */
    #fileQueueTable th:first-child,
    #fileQueueTable td:first-child {
        white-space: nowrap;
        width: auto;
        max-width: none;
    }
}

        /* ====== View All Plans Button ====== */
        .btn-view-plans {
            width: 100%;
            padding: 10px 8px;
            border: 1px solid #4a9eff;
            background: transparent;
            color: #4a9eff;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9em;
            font-weight: 500;
            transition: background 0.2s, color 0.2s;
            min-height: 44px;
        }
        .btn-view-plans:hover,
        .btn-view-plans:active {
            background: #4a9eff;
            color: #fff;
        }

        /* ====== Touch vs Desktop Upload Text ====== */
        .upload-cta-touch { display: none; }
        .upload-cta-desktop { display: inline; }

        @media (hover: none) and (pointer: coarse) {
            .upload-cta-touch { display: inline; }
            .upload-cta-desktop { display: none; }
        }

        /* ====== iOS / Safari Mobile Fixes ====== */

        /* Prevent iOS Safari from zooming into inputs (requires font-size >= 16px) */
        @media (max-width: 768px) {
            input,
            select,
            textarea {
                font-size: 16px !important;
            }
        }

        /* Modal: use dynamic viewport height so keyboard doesn't hide content */
        .modal {
            max-height: 80vh;
            max-height: 80dvh;
            -webkit-overflow-scrolling: touch;
        }

        .modal-overlay {
            /* Ensure overlay fills even when keyboard is open on iOS */
            height: 100%;
            height: 100dvh;
        }

        /* Smooth inertial scroll on overflow containers for older iOS */
        .upload-queue-list,
        .modal-body,
        .file-viewer-content .modal-body {
            -webkit-overflow-scrolling: touch;
        }

        /* Touch targets: ensure minimum 44px height on small buttons */
        @media (hover: none) and (pointer: coarse) {
            .modal-close {
                min-width: 44px;
                min-height: 44px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .file-search-clear {
                min-width: 44px;
                min-height: 44px;
            }

            .queue-item-remove {
                min-width: 44px;
                min-height: 44px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .smlr-icon-btn {
                width: 44px;
                height: 44px;
            }

            .btn-icon {
                width: 44px !important;
                height: 44px;
            }

            .btn-danger,
            .btn-warning,
            .btn-token,
            .btn-play,
            .btn-view {
                min-height: 44px;
                padding-top: 10px;
                padding-bottom: 10px;
            }

            .pagination-btn {
                min-width: 44px;
                min-height: 44px;
            }

            .view-toggle button {
                min-height: 44px;
                padding: 0 16px;
            }

            .tab {
                min-height: 44px;
            }

            /* Larger upload area tap target on touch devices */
            .upload-area {
                padding: 50px 30px;
            }

            /* User info bar action buttons */
            .user-info button {
                min-height: 44px;
            }
        }

        /* ====== Forgot Password ====== */
        .forgot-link {
            display: block;
            text-align: right;
            margin-top: -10px;
            margin-bottom: 18px;
            font-size: 0.88em;
            color: #667eea;
            text-decoration: none;
            cursor: pointer;
            background: none;
            border: none;
            padding: 0;
        }
        .forgot-link:hover { text-decoration: underline; }


/* ====== Dark Mode Support ====== */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    .container { background: #1e1e2e; color: #e0e0e0; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
    .header { background: #1e1e2e; color: #e0e0e0; border-bottom-color: #333; border-bottom-width: 2px; }
    .header p { color: #aaa; }
    .service-tab { color: #666; border-color: #333; }
    .service-tab:hover { color: #a78bfa; background: rgba(167, 139, 250, 0.05); }
    .service-tab.active { color: #a78bfa; background: #1e1e2e; border-color: #a78bfa; border-bottom-color: #1e1e2e; }
    .coming-soon { color: #888; }
    .coming-soon h2 { color: #a78bfa; }
    .coming-soon p { color: #666; }
    .user-info { background: #2a2a3e; color: #e0e0e0; }
    .user-info span { color: #a78bfa; }
    .upload-area { background: #2a2a3e; border-color: #a78bfa; }
    .upload-area:hover { background: #333352; border-color: #c4b5fd; }
    .upload-area.dragging { background: #333352; border-color: #a78bfa; }
    .upload-text { color: #bbb; }
    .upload-text small { color: #888; }
    .file-list { border-color: #333; }
    .file-item { border-bottom-color: #333; }
    .file-item:hover { background: #2a2a3e; }
    .file-item.is-selected { background: #2a2a4e; }
    .file-item.is-selected:hover { background: #252545; }
    .file-name { color: #e0e0e0; }
    .file-meta { color: #888; }
    .file-list.grid-view .file-item { border-color: #333; }
    .folder-item { background: #22223a; border-bottom-color: #333; }
    .folder-item:hover { background: #2a2a44; }
    .folder-item.is-selected { background: #252545; }
    .folder-item-name { color: #c4b5fd; }
    .folder-divider { background: #22223a; border-bottom-color: #333; color: #666; }
    .folder-view-header { background: #1e1e30; border-bottom-color: #333; }
    .folder-dropdown { background: #1e1e2e; border-color: #444; }
    .folder-dropdown-item { color: #e0e0e0; }
    .folder-dropdown-item:hover { background: #2a2a3e; }
    .file-list.grid-view .folder-item { background: #22223a; border-color: #3a3a5a; }
    .file-list.grid-view .folder-item:hover { background: #2a2a44; }
    .form-group label { color: #bbb; }
    .form-group input { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    .form-group input:focus { border-color: #a78bfa; }
    .btn-secondary { background: #555; color: #e0e0e0; }
    .alert-success { background: #1a3a26; color: #6ee7b7; border-color: #2d6a42; }
    .alert-error { background: #3a1a1e; color: #f87171; border-color: #7a2a2e; }
    .alert-info { background: #1a2a3a; color: #67e8f9; border-color: #1e4060; }
    .alert-warning { background: #3a2a10; color: #fbbf24; border-color: #6a4a20; }
    .modal-overlay { background: rgba(0, 0, 0, 0.8); }
    .modal { background: #1e1e2e; color: #e0e0e0; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
    .modal-header h3 { color: #e0e0e0; }
    .modal-close { color: #aaa; }
    .modal-close:hover { color: #e0e0e0; }
    .settings-section { border-bottom-color: #333; }
    .settings-section h4 { color: #e0e0e0; }
    .settings-row label { color: #bbb; }
    .settings-row .settings-desc { color: #777; }
    .settings-input { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    .settings-input:focus { border-color: #a78bfa; }
    .file-search-input { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    .file-search-input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.2); }
    .pagination-controls { background: #22223a; border-top-color: #333; }
    .pagination-info { color: #aaa; }
    .pagination-btn { background: #2a2a3e; border-color: #444; color: #e0e0e0; }
    .pagination-btn:hover:not(:disabled) { background: #a78bfa; border-color: #a78bfa; color: #fff; }
    .pagination-btn.active { background: #a78bfa; border-color: #a78bfa; color: #fff; }
    .pagination-select { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    .sort-controls label { color: #aaa; }
    .files-header h2 { color: #e0e0e0; }
    .upload-progress-section { background: #22223a; border-color: #333; }
    .upload-file-name { color: #e0e0e0; }
    .upload-file-size { color: #aaa; }
    .progress-bar { background: #333; }
    .upload-stat { background: #2a2a3e; border-color: #444; }
    .upload-stat-value { color: #a78bfa; }
    .upload-stat-label { color: #888; }
    .pending-uploads-section { background: #3a2a10; border-color: #6a4a20; }
    .pending-uploads-header h3 { color: #fbbf24; }
    .pending-upload-item { background: #2a2a3e; }
    .pending-upload-name { color: #e0e0e0; }
    .pending-upload-progress { color: #888; }
    .upload-queue-section { background: #22223a; border-color: #333; }
    .queue-item { background: #2a2a3e; border-color: #444; }
    .queue-item.active { border-color: #a78bfa; background: #22223a; }
    .queue-item.completed { border-color: #2d6a42; background: #1a3a26; }
    .queue-item.error { border-color: #7a2a2e; background: #3a1a1e; }
    .queue-item-name { color: #e0e0e0; }
    .queue-item-status { color: #888; }
    .file-details { background: #22223a; }
    .file-details-row { border-bottom-color: #333; }
    .file-details-label { color: #888; }
    .file-details-value { color: #e0e0e0; }
    .header img { filter: invert(1); }
    .password-section { background: #22223a; border-color: #333; }
    .password-section-header label { color: #e0e0e0; }
    .password-input { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    .bulk-action-bar { background: #1e1e30; border-bottom-color: #333; }
    #bulkCount { color: #bbb; }
    .timeline-group-header { background: #22223a; border-top-color: #333; border-bottom-color: #333; color: #666; }
    a { color: #a78bfa; }
    a:hover { color: #c4b5fd; }
    .forgot-link { color: #a78bfa; }
    .tab { color: #888; }
    .tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }
    .tabs { border-bottom-color: #333; }
    .view-toggle button { background: #2a2a3e; border-color: #444; color: #bbb; }
    .view-toggle button.active { background: #a78bfa; border-color: #a78bfa; color: #fff; }
    .plan-card { border-color: #333; }
    .plan-card h4 { color: #e0e0e0; }
    .plan-card .plan-price { color: #e0e0e0; }
    .plan-card .plan-limits { color: #bbb; }
    .plan-card .plan-limits li { border-top-color: #333; }
    .plan-card .plan-limits .limit-value { color: #e0e0e0; }
    .plan-card.current { border-color: #a78bfa; background: #1e1e3a; }
    .stream-url-section { background: #22223a; }
    .stream-url-section input { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    select { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    textarea { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
    .loading-overlay-content { background: #1e1e2e; }
    .loading-message { color: #e0e0e0; }
    .loading-spinner { border-color: #333; border-top-color: #a78bfa; }
    .btn-view-plans { border-color: #a78bfa; color: #a78bfa; }
    .btn-view-plans:hover { background: #a78bfa; color: #fff; }
    .guest-info-bar { background: linear-gradient(135deg, #2a1a4e 0%, #1a0f3a 100%); }
    .file-password-options { background: #1e1e2e; border-color: #444; }
    .settings-alert-error { background: #3a1a1e; color: #f87171; border-color: #7a2a2e; }
    .settings-alert-success { background: #1a3a26; color: #6ee7b7; border-color: #2d6a42; }
    .upload-status-message.info { background: #1a2a3a; color: #67e8f9; }
    .upload-status-message.warning { background: #3a2a10; color: #fbbf24; }
    .upload-status-message.error { background: #3a1a1e; color: #f87171; }
    .upload-status-message.success { background: #1a3a26; color: #6ee7b7; }
    .profile-pic-actions button { background: #2a2a3e; border-color: #444; color: #e0e0e0; }
    .profile-pic-actions button:hover { border-color: #a78bfa; color: #a78bfa; }
    .profile-pic-preview { background: #333; color: #888; }
    /* File queue table */
    #fileQueueTable { background: #1e1e2e; }
    #fileQueueTable thead tr { background: #2a2a3e; }
    #fileQueueTable th { border-bottom-color: #444; color: #e0e0e0; }
    .file-queue-row td { border-bottom-color: #333; color: #e0e0e0; }
    .file-queue-row:hover { background-color: #2a2a3e; }
    .file-queue-row:nth-child(even) { background-color: #22223a; }
    .file-queue-row:nth-child(even):hover { background-color: #252545; }
    .file-queue-status { color: #888; }
    .file-queue-progress { background: #333; }
    .file-action-btn { border-color: #555; color: #e0e0e0; }
    .file-action-btn:hover { background: #2a2a3e; }
    .file-action-btn.password-btn { border-color: #ffc107; }
    .file-action-btn.password-btn:hover { background: #3a2a10; }
    .file-action-btn.password-btn.has-password { background: #3a2a10; border-color: #ff9800; }
    .file-action-btn.upload-btn { border-color: #4CAF50; color: #4CAF50; }
    .file-action-btn.upload-btn:hover { background: #1a3a26; }
    .file-action-btn.remove-btn { border-color: #f44336; color: #f44336; }
    .file-action-btn.remove-btn:hover { background: #3a1a1e; }
    .file-password-options hr { border-top-color: #444; }
    .file-password-options small { color: #888; }
    .upload-result-item { background: #22223a; border-color: #2d6a42; }
    .upload-result-item .file-name { color: #e0e0e0; }
    .upload-result-item .file-info { color: #aaa; }
}

/* ====== Skeleton Loading ====== */
.skeleton-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-line {
    height: 12px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
}
.skeleton-line-wide { width: 70%; }
.skeleton-line-medium { width: 40%; }
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@media (prefers-color-scheme: dark) {
    .skeleton-line { background: #3a3a4e; }
}

/* ============================================================================
   SHARING STYLES
   ============================================================================ */

/* Shared badge */
.shared-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.5;
}

/* ZIP container badge */
.zip-container-badge {
    display: inline-block;
    font-size: 0.68em;
    font-weight: 600;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

/* Shared link icon (owner indicator) */
.shared-link-icon {
    margin-right: 4px;
    font-size: 0.9em;
    vertical-align: middle;
}

/* Share bulk button */
.btn-bulk-share {
    padding: 7px 14px;
    font-size: 0.85em;
    width: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.btn-bulk-share:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Share modal input area */
.share-input-wrap {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background: #fff;
    min-height: 42px;
}
.share-input-wrap:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}
.share-user-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 140px;
    font-size: 0.95em;
    padding: 4px 0;
    background: transparent;
}

/* Share tag chips */
.share-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.share-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef2ff;
    color: #4a5568;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.85em;
    font-weight: 500;
}
.share-tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 0.85em;
    padding: 0 2px;
    line-height: 1;
}
.share-tag-remove:hover { color: #dc3545; }

/* Autocomplete suggestions */
.share-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.share-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
}
.share-suggestion-item:hover {
    background: #eef2ff;
}

/* Existing shares list */
.share-existing {
    margin-top: 16px;
}
.share-existing label {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px;
    display: block;
}
.share-existing-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.share-existing-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.85em;
}
.share-existing-username {
    color: #4a5568;
    font-weight: 500;
}
.share-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 0.8em;
    padding: 0 2px;
}
.share-remove-btn:hover { color: #dc3545; }

/* Share items summary */
.share-items-summary {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 16px;
}

/* Share privilege radio section */
.share-privilege-section {
    margin-top: 16px;
    margin-bottom: 4px;
}
.share-privilege-section > label {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px;
    display: block;
}
.share-privilege-radios {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.privilege-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.privilege-radio:hover {
    background: #f0f4ff;
}
.privilege-radio input[type="radio"] {
    margin: 0;
    accent-color: #667eea;
}
.privilege-radio input[type="radio"]:checked + .privilege-label {
    font-weight: 600;
    color: #4a5ad8;
}
.privilege-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    min-width: 120px;
}
.privilege-desc {
    font-size: 0.8em;
    color: #888;
}
.share-existing-item .privilege-badge {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 4px;
}
.privilege-badge.viewer { background: #e2e8f0; color: #4a5568; }
.privilege-badge.contributor { background: #c6f6d5; color: #276749; }
.privilege-badge.collaborator { background: #bee3f8; color: #2a4365; }
.privilege-badge.owner { background: #fefcbf; color: #744210; }
.share-existing-item .privilege-select {
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    margin-left: 4px;
}

/* Dark mode adjustments for sharing */
@media (prefers-color-scheme: dark) {
    .shared-badge {
        background: linear-gradient(135deg, #5a6fd6 0%, #6a4094 100%);
    }
    .zip-container-badge {
        background: linear-gradient(135deg, #d66ecc 0%, #d94a5e 100%);
    }
    .share-input-wrap {
        background: #2a2a3e;
        border-color: #444;
    }
    .share-input-wrap:focus-within {
        border-color: #667eea;
    }
    .share-user-input {
        color: #e0e0e0;
    }
    .share-tag {
        background: #2a2a4e;
        color: #ccc;
    }
    .share-suggestions {
        background: #1e1e2e;
        border-color: #444;
    }
    .share-suggestion-item:hover {
        background: #2a2a4e;
    }
    .share-existing-item {
        background: #2a2a4e;
    }
    .share-existing-username { color: #ccc; }
    .share-items-summary {
        background: #1e1e30;
        color: #aaa;
    }
    .share-privilege-section > label { color: #aaa; }
    .privilege-radio:hover { background: #2a2a4e; }
    .privilege-label { color: #ccc; }
    .privilege-radio input[type="radio"]:checked + .privilege-label { color: #8b9cf7; }
    .privilege-desc { color: #777; }
    .privilege-badge.viewer { background: #2d3748; color: #a0aec0; }
    .privilege-badge.contributor { background: #22543d; color: #9ae6b4; }
    .privilege-badge.collaborator { background: #2a4365; color: #90cdf4; }
    .privilege-badge.owner { background: #744210; color: #fefcbf; }
    .share-existing-item .privilege-select {
        background: #2a2a3e;
        border-color: #444;
        color: #ccc;
    }
}

/* ========================================================================
   Bulk Action Bar — Mobile responsive
   ======================================================================== */
@media (max-width: 768px) {
    .bulk-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
        position: sticky;
        top: 0;
        z-index: 20;
    }
    .bulk-action-bar #bulkCount {
        text-align: center;
        min-width: unset;
        font-size: 0.85em;
    }
    .bulk-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    .bulk-actions .btn,
    .bulk-actions .btn-bulk-download,
    .bulk-actions .btn-bulk-delete,
    .bulk-actions .btn-select-all,
    .bulk-actions .btn-bulk-share,
    .bulk-actions .btn-create-folder,
    .bulk-actions .btn-add-to-folder,
    .bulk-actions .btn-remove-from-folder {
        padding: 8px 10px;
        font-size: 0.78em;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        white-space: nowrap;
        text-align: center;
    }
    .bulk-action-bar .btn-bulk-cancel {
        padding: 8px 10px;
        font-size: 0.78em;
        width: 100%;
        order: 10;
    }
    .add-to-folder-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }
    .add-to-folder-wrap .btn-add-to-folder {
        width: 100%;
    }
    .folder-dropdown {
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
        max-width: 90vw;
    }
}

@media (max-width: 400px) {
    .bulk-action-bar {
        padding: 6px 8px;
        gap: 6px;
    }
    .bulk-actions {
        gap: 4px;
    }
    .bulk-actions .btn,
    .bulk-actions .btn-bulk-download,
    .bulk-actions .btn-bulk-delete,
    .bulk-actions .btn-select-all,
    .bulk-actions .btn-bulk-share,
    .bulk-actions .btn-create-folder,
    .bulk-actions .btn-add-to-folder,
    .bulk-actions .btn-remove-from-folder {
        padding: 7px 6px;
        font-size: 0.72em;
    }
    .bulk-action-bar .btn-bulk-cancel {
        padding: 7px 6px;
        font-size: 0.72em;
    }
}
