/* Shared styles for delete confirmation modal and action buttons across bookmark pages */

:root {
    --primary-color: #4facfe;
    --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-red: #ef4444;
    --theme-bg-color: #f8fafc;
    --theme-bg-gradient: linear-gradient(to bottom, #e3f2fd 0%, #f3e5f5 100%);
    --theme-bg-pattern: linear-gradient(rgba(79, 172, 254, 0.12) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(79, 172, 254, 0.12) 1px, transparent 1px);
    --theme-bg-size: 30px 30px;
}

body[data-theme="blue"] {
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --theme-bg-color: #f0f9ff;
    --theme-bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --theme-bg-pattern: linear-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(59, 130, 246, 0.12) 1px, transparent 1px);
}

body[data-theme="red"] {
    --primary-color: #ef4444;
    --primary-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --theme-bg-color: #fff5f5;
    --theme-bg-gradient: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
    --theme-bg-pattern: linear-gradient(rgba(239, 68, 68, 0.15) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(239, 68, 68, 0.15) 1px, transparent 1px);
}

body[data-theme="green"] {
    --primary-color: #22c55e;
    --primary-gradient: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    --theme-bg-color: #f0fdf4;
    --theme-bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    --theme-bg-pattern: linear-gradient(rgba(34, 197, 94, 0.12) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(34, 197, 94, 0.12) 1px, transparent 1px);
}







/* Custom category icon (uploaded image) inside folder/card icons */
.category-icon-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.category-folder-icon .category-icon-img,
.folder-icon .category-icon-img {
    max-width: 48px;
    max-height: 48px;
}

.dropdown-folder-icon .category-icon-img {
    max-width: 20px;
    max-height: 20px;
}

.reorder-item-icon .category-icon-img {
    max-width: 20px;
    max-height: 20px;
}

.delete-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    align-items: center;
    justify-content: center;
}

.delete-confirm-modal.active {
    display: flex;
}

/* Import (and other) modals – overlay so they don’t appear in page flow (e.g. on search page) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* Sidebar Modals (Edit Bookmark & Edit Group) */
#editBookmarkModal.modal,
#editCategoryModal.modal {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease, visibility 0s linear 0.3s, backdrop-filter 0.3s ease;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0 !important;
}

#editBookmarkModal.modal.active,
#editCategoryModal.modal.active {
    visibility: visible;
    pointer-events: auto;
    background: transparent;
    backdrop-filter: none;
    transition: none;
}

#editBookmarkModal .modal-content,
#editCategoryModal .modal-content {
    margin: 0 !important;
    height: 100vh !important;
    max-height: none !important;
    width: 600px;
    max-width: 90vw;
    border-radius: 24px 0 0 24px;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.2);
    background: #fff;
    overflow: hidden !important;
    border: none !important;
}

#editBookmarkModal.modal.active .modal-content,
#editCategoryModal.modal.active .modal-content {
    transform: translateX(0);
}

#editBookmarkModal .modal-header,
#editCategoryModal .modal-header,
#editCategoryModal .edit-category-modal-top {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    z-index: 20;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin: 0 !important;
}

#editBookmarkModal #editBookmarkForm,
#editCategoryModal .edit-category-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

#editBookmarkModal .edit-bookmark-modal-body,
#editCategoryModal .edit-category-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

#editBookmarkModal .edit-bookmark-modal-footer,
#editCategoryModal .edit-category-modal-footer,
#editBookmarkModal .form-actions {
    flex-shrink: 0;
    background: #f8fafc;
    padding: 20px 32px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

#editBookmarkModal .edit-bookmark-modal-footer .footer-actions,
#editCategoryModal .edit-category-modal-footer .footer-actions {
    display: flex;
    gap: 12px;
}

#editBookmarkModal .form-group,
#editCategoryModal .form-group,
#editCategoryModal .edit-category-section {
    padding: 0 32px;
    margin-bottom: 24px;
}

#editBookmarkModal .form-group:first-child,
#editCategoryModal .form-group:first-child {
    padding-top: 32px;
}

#editBookmarkModal .form-actions,
#editCategoryModal .edit-category-move-actions,
#editCategoryModal .edit-category-danger-actions {
    margin-top: auto;
    padding: 24px 32px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Specific button styles for sidebar footer */
#editCategoryModal .edit-category-danger-actions {
    background: #fff1f2;
    border-top-color: #fecaca;
    padding-top: 16px;
    padding-bottom: 16px;
}

#editBookmarkModal .modal-header h2,
#editCategoryModal .edit-category-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.025em;
}

#editBookmarkModal .edit-bookmark-modal-actions {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 12px;
}

#editBookmarkModal .edit-bookmark-modal-actions .edit-bookmark-modal-tile,
#editBookmarkModal .edit-bookmark-modal-actions .bookmark-action-btn,
#editBookmarkModal .edit-bookmark-modal-actions .share-btn,
#editBookmarkModal .edit-bookmark-modal-actions .team-btn,
#editBookmarkModal .edit-bookmark-modal-actions .public-profile-btn,
#editCategoryModal .edit-category-actions-grid .edit-category-action-tile {
    position: static !important;
    top: auto !important;
    right: auto !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    width: 40px;
    height: 40px;
}

#editCategoryModal .edit-category-actions-grid .edit-category-action-tile {
    width: auto;
    height: auto;
    padding: 10px 16px;
    gap: 8px;
    font-size: 14px;
    color: #475569;
}

#editBookmarkModal .edit-bookmark-modal-actions .edit-bookmark-modal-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#editBookmarkModal .edit-bookmark-modal-favorite.is-favorite {
    background: #fffbeb !important;
    border-color: #fbbc05 !important;
    color: #fbbc05 !important;
}

#editBookmarkModal .edit-bookmark-modal-share.is-active,
#editBookmarkModal .edit-bookmark-modal-team.is-active,
#editBookmarkModal .edit-bookmark-modal-public.is-active {
    background: #f0fdf4 !important;
    border-color: #22c55e !important;
    color: #22c55e !important;
}

#editBookmarkModal .form-group label,
#editCategoryModal .form-group label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

#editBookmarkModal .form-group input:not([type="checkbox"]),
#editBookmarkModal .form-group textarea,
#editBookmarkModal .form-group select,
#editCategoryModal .form-group input:not([type="checkbox"]),
#editCategoryModal .form-group select {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
    transition: all 0.2s;
    background: #fff;
    color: #1e293b;
}

#editBookmarkModal .form-group input:not([type="checkbox"]):focus,
#editCategoryModal .form-group input:not([type="checkbox"]):focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1);
    outline: none;
}

.edit-bookmark-preview-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 200px;
}

.edit-bookmark-sidebar-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: block;
}

.edit-bookmark-sidebar-preview-youtube {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: block;
}

.edit-bookmark-preview-container .preview-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    backdrop-filter: blur(2px);
    border-radius: 16px;
}

.edit-bookmark-preview-container .preview-loader .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: sidebarPreviewSpin 0.8s linear infinite;
}

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

.edit-bookmark-preview-container.loading .preview-loader {
    display: flex;
}

/* Polished Shortcut Tree */
#editBookmarkModal .bookmark-shortcuts-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    background: #f8fafc;
}

#editBookmarkModal .bookmark-shortcut-item {
    margin-bottom: 6px;
    list-style: none;
}

#editBookmarkModal .bookmark-shortcut-checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    border: 1px solid #f1f5f9;
}

#editBookmarkModal .bookmark-shortcut-checkbox:hover {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#editBookmarkModal .bookmark-shortcut-checkbox-input {
    width: 18px;
    height: 18px;
    margin: 0 0 0 auto !important;
    flex-shrink: 0;
    cursor: pointer;
    order: 3;
}

#editBookmarkModal .bookmark-shortcut-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    order: 1;
}

#editBookmarkModal .bookmark-shortcut-name {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    flex: 1;
    order: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#editBookmarkModal .bookmark-shortcut-checkbox-input:checked ~ .bookmark-shortcut-name {
    color: #1a202c;
    font-weight: 600;
}

/* Category Card Tags */
.category-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
}


.category-card-tag {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.category-card-tag:hover {
    background: var(--primary-color);
    color: white;
}
/* All bookmarks header visibility */
.category-list-header {
    display: none;
}


/* Keyboard shortcuts popover (?) */
.hidden-by-lock {
    display: none !important;
}

.keyboard-shortcuts-popover-wrap {

    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.keyboard-shortcuts-popover-wrap.active {
    display: flex;
}

.keyboard-shortcuts-popover-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.keyboard-shortcuts-popover {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 380px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.keyboard-shortcuts-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.keyboard-shortcuts-popover-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.keyboard-shortcuts-popover-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}

.keyboard-shortcuts-popover-close:hover {
    color: #333;
    background: #f0f0f0;
}

.keyboard-shortcuts-popover-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
}

.keyboard-shortcuts-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.keyboard-shortcuts-row:last-child {
    border-bottom: none;
}

.keyboard-shortcuts-row kbd {
    display: inline-block;
    min-width: 28px;
    padding: 4px 8px;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    text-align: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 0 #ddd;
}

.keyboard-shortcuts-row span {
    flex: 1;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Share Link modal: input uses full width so URL isn’t truncated */
#shareModal .modal-content {
    max-width: 560px;
}

#shareModal #shareUrlInput {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f5f5f5;
    font-family: ui-monospace, monospace;
    overflow-x: auto;
}

#shareModal .form-group {
    margin-bottom: 16px;
}

/* Bookmark link picker (multiple URLs) */
.bookmark-link-picker-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2200;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bookmark-link-picker-overlay.active {
    display: flex;
    pointer-events: auto;
}

.bookmark-link-picker-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.bookmark-link-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bookmark-link-picker-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    flex: 1;
}

.bookmark-link-picker-back {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    margin-right: 12px;
}

.bookmark-link-picker-back:hover {
    background: #f5f5f5;
    border-color: #999;
}

.bookmark-link-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.bookmark-link-picker-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    transition: background 0.15s, border-color 0.15s;
}

.bookmark-link-picker-item:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.bookmark-link-picker-cancel {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #eee;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.bookmark-link-picker-cancel:hover {
    background: #e0e0e0;
}

.bookmark-url-label {
    opacity: 0.9;
}

.delete-confirm-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.delete-confirm-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #333;
}

.delete-confirm-content p {
    margin: 0 0 24px 0;
    color: #666;
    line-height: 1.5;
}

.delete-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.delete-confirm-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.delete-confirm-actions .btn-cancel {
    background: #f5f5f5;
    color: #333;
}

.delete-confirm-actions .btn-cancel:hover {
    background: #e0e0e0;
}

.delete-confirm-actions .btn-delete {
    background: #ea4335;
    color: white;
}

.delete-confirm-actions .btn-delete:hover {
    background: #d33b2c;
}

.delete-confirm-actions .btn-warning {
    background: #f59e0b;
    color: white;
}

.delete-confirm-actions .btn-warning:hover {
    background: #d97706;
}

/* Fallback for views using old class names */
.delete-confirm-actions .cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.delete-confirm-actions .confirm-btn {
    background: #ea4335;
    color: white;
}

/* Bookmark card action buttons (edit, delete, refresh) - ensure they render as buttons */
.bookmark-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bookmark-action-btn svg {
    width: 18px;
    height: 18px;
}

.bookmark-action-btn.edit-btn {
    background: var(--primary-color);
    color: white;
}

.bookmark-action-btn.delete-btn {
    background: #ea4335;
    color: white;
}

.bookmark-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Add Group Card in Grid View */
.category-card.add-group-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 3px dotted rgba(71, 85, 105, 0.4);
    box-shadow: none;
    cursor: pointer;
    min-height: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card.add-group-card:hover {
    background: rgba(71, 85, 105, 0.05);
    border-color: rgba(71, 85, 105, 0.8);
    transform: translateY(-5px);
}

.add-group-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: none; /* Make clicking area cover the whole card seamlessly */
}

.add-group-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(71, 85, 105, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card.add-group-card:hover .add-group-icon-circle {
    background: rgba(71, 85, 105, 0.2);
    transform: scale(1.1);
}

.add-group-plus {
    width: 32px;
    height: 32px;
    color: #475569;
}

.add-group-text {
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    text-shadow: none;
}

/* Add Bookmark Card */
.bookmark-card.add-bookmark-card,
.bookmark-item.add-bookmark-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 3px dotted rgba(71, 85, 105, 0.4);
    box-shadow: none;
    cursor: pointer;
    min-height: 200px; /* same as group card but can adjust if needed */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px; /* standard card radius */
}

.bookmark-card.add-bookmark-card:hover,
.bookmark-item.add-bookmark-card:hover {
    background: rgba(71, 85, 105, 0.05);
    border-color: rgba(71, 85, 105, 0.8);
    transform: translateY(-5px);
}

.add-bookmark-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: none;
}

.add-bookmark-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(71, 85, 105, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bookmark-card.add-bookmark-card:hover .add-bookmark-icon-circle,
.bookmark-item.add-bookmark-card:hover .add-bookmark-icon-circle {
    background: rgba(71, 85, 105, 0.2);
    transform: scale(1.1);
}

.add-bookmark-plus {
    width: 32px;
    height: 32px;
    color: #475569;
}

.add-bookmark-text {
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    text-shadow: none;
}

/* Groups Bubble View Styles */
.groups-bubble-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 0;
}

.group-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    white-space: nowrap;
}

.group-bubble:hover {
    background: #f0f4ff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
    color: var(--primary-color);
}

.group-bubble .bubble-icon {
    font-size: 18px;
    line-height: 1;
}

.group-bubble .bubble-name {
    white-space: nowrap;
}

/* Groups Dropdown Menu Styles */
.groups-dropdown-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    position: relative;
    z-index: 1000;
}

/* When dropdown is open, raise the section so the list appears above the bookmarks grid (left/right layout) */
.groups-section:has(.groups-dropdown-container.active),
.results-section:has(.groups-dropdown-container.active) {
    position: relative;
    z-index: 1100;
}

.groups-dropdown-container.active {
    z-index: 1;
}

/* When in dropdown mode, make parent section background transparent */
.groups-section.dropdown-mode,
.results-section.dropdown-mode {
    background: transparent !important;
    box-shadow: none !important;
    padding-top: 0 !important;
}

.groups-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.groups-dropdown-trigger:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    background: #f8f9fa;
}

.groups-dropdown-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1);
}

.groups-dropdown-trigger .trigger-icon {
    font-size: 20px;
}

.groups-dropdown-trigger .trigger-text {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.groups-dropdown-trigger .arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    color: #666;
}

.groups-dropdown-trigger.active .arrow-icon {
    transform: rotate(180deg);
}

.groups-dropdown-container {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

.groups-dropdown-container.active {
    display: block;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.groups-dropdown-list {
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px 0;
}

.groups-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #444;
    transition: all 0.15s ease;
    cursor: pointer;
}

.groups-dropdown-item:hover {
    background: #f1f5f9;
    color: #000;
    padding-left: 24px;
}

.groups-dropdown-item .dropdown-folder-icon {
    font-size: 20px;
    margin-right: 14px;
}

.groups-dropdown-item .dropdown-group-name {
    font-weight: 500;
    font-size: 15px;
    flex: 1;
}

.groups-dropdown-item .dropdown-item-count {
    font-size: 12px;
    color: #888;
    background: #f1f3f4;
    padding: 2px 10px;
    border-radius: 10px;
}

/* Mobile: keep Select Group dropdown list below sticky controls (back + add) when scrolling */
@media (max-width: 768px) {
    .groups-dropdown-container.active {
        position: fixed;
        top: 220px;
        left: 10px;
        right: 10px;
        width: auto;
        z-index: 1100;
    }
}

.settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.settings-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.settings-hint {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

/* Public page appearance – grouped blocks */
.public-profile-appearance-block {
    margin-bottom: 24px;
}

.public-profile-appearance-block:last-child {
    margin-bottom: 0;
}

.public-profile-appearance-block .settings-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.public-profile-appearance-block .settings-hint {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

.public-profile-gradient-preview {
    height: 56px;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.public-profile-color-group {
    background: var(--theme-bg);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}

.public-profile-color-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.public-profile-color-row+.public-profile-color-row {
    margin-top: 12px;
}

.public-profile-color-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    min-width: 72px;
}

.public-profile-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-profile-color-wrap input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 3px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
}

.public-profile-color-wrap input[type="color"]:hover {
    border-color: #cbd5e1;
}

.public-profile-color-wrap .settings-input-inline {
    width: 96px;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.02em;
}

.public-profile-color-wrap .settings-input-inline:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.public-profile-font-block {
    margin-top: 4px;
}

.public-profile-font-block .settings-select {
    display: block;
    width: 100%;
    max-width: 280px;
    margin-bottom: 12px;
}

.public-profile-font-preview {
    margin-top: 0;
    margin-bottom: 8px;
    padding: 18px 20px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    letter-spacing: -0.02em;
}

.public-profile-font-block .settings-hint {
    margin-bottom: 0;
}

/* Reorder panel (Manage Bookmarks) - shared on index, category, search so panel works on all pages */
#reorderPanelPortal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

#reorderPanelOverlay,
.reorder-panel-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2099;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#reorderPanelOverlay.active,
.reorder-panel-overlay.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

#reorderPanel,
.reorder-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 2100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

#reorderPanel.active,
.reorder-panel.active {
    transform: translateX(0);
}

/* When #reorderPanel is embedded inside the settings panel, override its fixed/overlay behaviour */
#settingsPanel #reorderPanel {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
    transform: none !important;
    transition: none !important;
    border-radius: 0 !important;
    flex: 1;
    overflow-y: auto;
}

.reorder-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.reorder-panel-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.reorder-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.reorder-panel-fullscreen-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #666;
}

.reorder-panel-fullscreen-btn:hover {
    background: #e0e0e0;
}

.reorder-panel-fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

.reorder-panel.reorder-panel-fullscreen .reorder-panel-fullscreen-btn .icon-expand {
    display: none !important;
}

.reorder-panel.reorder-panel-fullscreen .reorder-panel-fullscreen-btn .icon-collapse {
    display: block !important;
}

#reorderPanel.reorder-panel-fullscreen,
.reorder-panel.reorder-panel-fullscreen {
    width: 100% !important;
    max-width: 100% !important;
    transition: width 0.3s ease, max-width 0.3s ease;
}

.reorder-panel-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #666;
}

.reorder-panel-close:hover {
    background: #e0e0e0;
}

.reorder-panel-close svg {
    width: 20px;
    height: 20px;
}

.reorder-panel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.reorder-search {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    background: #fdfdfd;
}

.reorder-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.reorder-search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: #999;
    pointer-events: none;
}

.reorder-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.reorder-section {
    margin-bottom: 30px;
}

.reorder-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.reorder-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reorder-save-btn {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
}

.reorder-save-btn .btn {
    flex: 1;
}

/* Settings tabs inside reorder panel */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    padding: 0 16px;
}

.settings-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-tab:hover {
    color: var(--primary-color);
    background: #f1f3f4;
}

.settings-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

.reorder-tab-pane {
    display: none;
}

.reorder-tab-pane.active {
    display: flex;
}

.organize-tree {
    min-height: 0;
    font-size: 14px;
    /* Critical for flex children to scroll properly */
}

/* When Organize or Reorder tab is active, prevent double scrollbar by clipping overflow on the panel */
#reorderPanel:has(#reorderOrganizeTab.active),
.reorder-panel:has(#reorderOrganizeTab.active),
#reorderPanel:has(#reorderFoldersTab.active),
.reorder-panel:has(#reorderFoldersTab.active) {
    overflow: clip;
}

/* Mobile: single scroll container so scrolling down scrolls the tabs (and header) up */
@media (max-width: 768px) {

    #reorderPanel,
    .reorder-panel {
        overflow-y: auto;
        overflow-x: hidden;
    }

    #reorderPanel:has(#reorderOrganizeTab.active),
    .reorder-panel:has(#reorderOrganizeTab.active),
    #reorderPanel:has(#reorderFoldersTab.active),
    .reorder-panel:has(#reorderFoldersTab.active),
    #reorderPanel:has(#reorderTagsTab.active),
    .reorder-panel:has(#reorderTagsTab.active),
    #reorderPanel:has(#reorderDupesTab.active),
    .reorder-panel:has(#reorderDupesTab.active),
    #reorderPanel:has(#reorderBrokenTab.active),
    .reorder-panel:has(#reorderBrokenTab.active),
    #reorderPanel:has(#reorderArchiveTab.active),
    .reorder-panel:has(#reorderArchiveTab.active) {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .reorder-panel-content {
        flex: none;
        overflow-y: visible;
    }

    .reorder-tab-pane {
        height: auto !important;
        min-height: 0;
    }

    .reorder-tab-pane.active {
        display: flex;
        flex-direction: column;
        height: auto !important;
    }

    .reorder-save-btn {
        position: static;
    }

    /* Tags tab: remove inner scroll so panel scrolls and tabs move up */
    #reorderTagsTab.reorder-tab-pane,
    .reorder-panel #reorderTagsTab {
        height: auto !important;
        overflow: visible !important;
    }

    .reorder-panel .reorder-tags-tab-wrap {
        height: auto !important;
        overflow: visible !important;
    }

    .reorder-panel .tags-list-section {
        overflow-y: visible !important;
        flex: none;
    }

    /* Other tab panes with inner scroll (Organize tree, Dupes, Broken) - let panel scroll on mobile */
    .reorder-panel #organizeTree,
    .reorder-panel .organize-tree {
        overflow-y: visible !important;
        flex: none;
    }

    .reorder-panel #dupesResultsArea,
    .reorder-panel #brokenResultsArea {
        overflow-y: visible !important;
        flex: none;
    }
}

/* Tree styles for Organize tab */
.tree-node {
    margin-bottom: 2px;
}

.tree-content {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
}

.tree-content:hover {
    background: #f1f3f4;
}

.tree-content.drag-over {
    background: #e8f0fe;
    border: 1px dashed var(--primary-color);
}

.tree-content.drop-before {
    box-shadow: 0 -2px 0 var(--primary-color);
}

.tree-content.drop-after {
    box-shadow: 0 2px 0 var(--primary-color);
}

.tree-content.dragging {
    opacity: 0.5;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    color: #666;
    transition: transform 0.2s;
}

.tree-toggle.collapsed {
    transform: rotate(-90deg);
}

.tree-toggle.hidden {
    visibility: hidden;
}

.tree-icon {
    margin-right: 8px;
    font-size: 16px;
}

.tree-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.tree-count {
    font-size: 11px;
    color: #888;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.tree-children {
    padding-left: 24px;
    border-left: 1px solid #eee;
    margin-left: 9px;
}

.tree-children.collapsed {
    display: none;
}

.tree-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    border-radius: 4px;
}

.tree-delete-btn:hover {
    background: #ffebee;
    color: #d32f2f;
}

.tree-content:hover .tree-delete-btn:not(.hidden-by-lock) {
    display: flex;
}

/* Reorder item styles for Reorder tabs */
.reorder-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s;
}

.reorder-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reorder-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.reorder-item.drag-over {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.reorder-item.hidden {
    display: none;
}

.reorder-item.match {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
    background: #f0f7ff;
}

.reorder-item-name .highlight {
    background: #fff59d;
    padding: 0 1px;
    border-radius: 2px;
    color: #333;
    font-weight: 600;
}

.reorder-item-handle {
    color: #999;
    cursor: grab;
    display: flex;
    align-items: center;
}

.reorder-item-handle:active {
    cursor: grabbing;
}

.reorder-item-handle svg {
    width: 16px;
    height: 16px;
}

.reorder-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reorder-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.reorder-item-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Settings Panel and related styles */
.settings-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 2100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
}

.settings-panel.active {
    transform: translateX(0);
}

.settings-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.settings-panel-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.settings-mode-tabs {
    display: flex;
    gap: 2px;
    flex: 1;
}

.settings-mode-tab {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

.settings-mode-tab:hover {
    background: #e9ecef;
    color: #333;
}

.settings-mode-tab.active {
    background: var(--primary-color);
    color: white;
}

.settings-panel-fullscreen-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #666;
}

.settings-panel-fullscreen-btn:hover {
    background: #e0e0e0;
}

.settings-panel-fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

.settings-panel.settings-panel-fullscreen {
    width: 100% !important;
    max-width: 100% !important;
    transition: width 0.3s ease, max-width 0.3s ease;
}

.settings-panel.settings-panel-fullscreen .icon-expand {
    display: none !important;
}

.settings-panel.settings-panel-fullscreen .icon-collapse {
    display: block !important;
}

.settings-panel-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #666;
}

.settings-panel-close:hover {
    background: #e0e0e0;
}

.settings-panel-close svg {
    width: 20px;
    height: 20px;
}

.settings-panel-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.settings-panel-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2099;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.settings-panel-overlay.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

.settings-notification {
    padding: 12px 20px;
    margin: 0;
    background: #e6f4ea;
    color: #137333;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #ceead6;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-notification.error {
    background: #fce8e6;
    color: #c5221f;
    border-bottom-color: #fad2cf;
}

.settings-tab-pane {
    display: none;
    padding: 20px;
}

.settings-tab-pane.active {
    display: block;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.settings-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.settings-control:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.settings-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 120px;
    outline: none;
    transition: border-color 0.2s;
}

.settings-select:hover {
    border-color: #999;
}

.settings-select:focus {
    border-color: var(--primary-color);
}

.settings-select-custom {
    position: relative;
    min-width: 120px;
}

.settings-select-trigger {
    width: 100%;
    padding: 8px 28px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    outline: none;
    text-align: left;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.settings-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.settings-select-custom.open .settings-select-dropdown {
    display: block;
}

.settings-select-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-value {
    min-width: 50px;
    text-align: right;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.background-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.background-options::-webkit-scrollbar {
    width: 6px;
}

.background-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.background-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.background-option {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.background-option:hover {
    transform: scale(1.02);
}

.background-option.selected {
    border-color: var(--primary-color);
}

.background-option-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.background-option-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    font-size: 12px;
    text-align: center;
}

.background-option-solid {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.profile-settings-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.select-image-btn {
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s;
}

.select-image-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.profile-photo-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.profile-form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.profile-update-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.profile-update-btn:hover {
    background: #3367d6;
}

.profile-update-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}



/* Reader mode sidebar (right) */
.reader-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2098;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.reader-sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.reader-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 95vw;
    height: 100vh;
    background: #fafafa;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 2099;
    transform: translateX(100%);
    transition: transform 0.25s ease, width 0.25s ease, max-width 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reader-sidebar.active {
    transform: translateX(0);
}

.reader-sidebar.reader-sidebar-expanded {
    width: 100%;
    max-width: 100%;
}

.reader-sidebar-content {
    transition: padding 0.25s ease;
}

.reader-sidebar.reader-sidebar-expanded .reader-sidebar-header {
    padding-left: max(20px, calc((100% - 720px) / 2));
    padding-right: max(20px, calc((100% - 720px) / 2));
}

.reader-sidebar.reader-sidebar-expanded .reader-sidebar-actions {
    justify-content: flex-start;
}

.reader-sidebar.reader-sidebar-expanded .reader-sidebar-content {
    padding-left: max(20px, calc((100% - 720px) / 2));
    padding-right: max(20px, calc((100% - 720px) / 2));
}

.reader-sidebar-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.reader-sidebar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.reader-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    width: 100%;
    justify-content: flex-start;
}

.reader-sidebar-open-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.reader-sidebar-open-link:hover {
    text-decoration: underline;
}

.reader-sidebar-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.2s;
}

.reader-sidebar-close:hover {
    background: #eee;
}

.reader-sidebar-close svg {
    width: 20px;
    height: 20px;
}

.reader-sidebar-expand-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.2s;
}

.reader-sidebar-expand-btn:hover {
    background: #eee;
}

.reader-sidebar-expand-btn svg {
    width: 20px;
    height: 20px;
}

.reader-sidebar-save-offline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.reader-sidebar-save-offline-btn:hover:not(:disabled) {
    background: #eee;
    color: #1a1a1a;
}

.reader-sidebar-save-offline-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.reader-sidebar-save-offline-btn.is-saved {
    color: #0d9488;
}

.reader-sidebar-save-offline-btn .reader-save-offline-icon {
    width: 18px;
    height: 18px;
}

.reader-sidebar-mark-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.reader-sidebar-mark-read-btn:hover:not(:disabled) {
    background: #eee;
    color: #1a1a1a;
}

.reader-sidebar-mark-read-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.reader-sidebar-mark-read-btn.is-read {
    color: #0d9488;
}

.reader-sidebar-mark-read-btn .reader-mark-read-icon {
    width: 18px;
    height: 18px;
}

.reader-sidebar-archive-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.reader-sidebar-archive-btn:hover:not(:disabled) {
    background: #eee;
    color: #1a1a1a;
}

.reader-sidebar-archive-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.reader-sidebar-archive-btn .reader-archive-icon {
    width: 18px;
    height: 18px;
}

.reader-sidebar-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: #555;
    transition: background 0.2s, color 0.2s;
}

.reader-sidebar-copy-btn:hover {
    background: #eee;
    color: #1a1a1a;
}

.reader-sidebar-copy-btn svg {
    width: 18px;
    height: 18px;
}

.reader-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.reader-sidebar-loading {
    color: #666;
    font-size: 15px;
    padding: 24px 0;
}

.reader-sidebar-body {
    display: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.7;
    color: #222;
    max-width: 100%;
}

.reader-sidebar-body.active {
    display: block;
}

.reader-sidebar-body.reader-content h1,
.reader-sidebar-body.reader-content h2,
.reader-sidebar-body.reader-content h3 {
    font-family: inherit;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #1a1a1a;
}

.reader-sidebar-body.reader-content h1 {
    font-size: 1.5em;
}

.reader-sidebar-body.reader-content h2 {
    font-size: 1.25em;
}

.reader-sidebar-body.reader-content h3 {
    font-size: 1.1em;
}

.reader-sidebar-body.reader-content p {
    margin: 0 0 1em;
}

.reader-sidebar-body.reader-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.reader-sidebar-body.reader-content a:hover {
    text-decoration: underline;
}

.reader-sidebar-body.reader-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em 0;
}

.reader-sidebar-body.reader-content ul,
.reader-sidebar-body.reader-content ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.reader-sidebar-body.reader-content blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 4px solid #ddd;
    color: #555;
}

.reader-sidebar-body.reader-content pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 1em 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.45;
}

.reader-sidebar-body.reader-content code {
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #24292e;
}

.reader-sidebar-body.reader-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.reader-sidebar-error {
    color: #c62828;
    font-size: 14px;
    padding: 16px 0;
}

.bookmark-action-btn.reader-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #5f6368;
}

.bookmark-action-btn.reader-btn:hover {
    background: #fff;
    color: var(--primary-color);
}

/* Mobile View: Hide profile and logout from top bar, stack settings tabs */
@media screen and (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
    }

    .settings-tab {
        border-bottom: 1px solid #e0e0e0;
        border-left: 3px solid transparent;
        text-align: left;
        padding-left: 20px;
    }

    .settings-tab.active {
        border-left-color: var(--primary-color);
        border-bottom-color: #e0e0e0;
    }
}

.settings-section {
    margin-bottom: 30px;
}

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

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

/* General Modal form elements styling (Add Bookmark, Add Group, Edit Group, etc.) */
.modal .modal-content .form-group input[type="text"],
.modal .modal-content .form-group input[type="url"],
.modal .modal-content .form-group select,
.modal .modal-content .form-group textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
}

.modal .modal-content .form-group input:focus,
.modal .modal-content .form-group select:focus,
.modal .modal-content .form-group textarea:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.15);
}

.modal .modal-content .form-group textarea {
    min-height: 100px;
    resize: vertical;
}


/* Links (label + URL) rows in Add Bookmark – same look and height */
#addModal #addBookmarkUrlsGroup .add-bookmark-url-title,
#addModal #addBookmarkUrlsGroup .add-bookmark-url-url {
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid #c5c5c5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#addModal #addBookmarkUrlsGroup .add-bookmark-url-title:focus,
#addModal #addBookmarkUrlsGroup .add-bookmark-url-url:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

#addModal #addBookmarkUrlsGroup .add-bookmark-url-title {
    flex: 0 0 120px;
}

#addModal #addBookmarkUrlsGroup .add-bookmark-url-url {
    flex: 1;
    min-width: 0;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.teams-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.teams-list-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    transition: background 0.2s;
}

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

.team-members-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.team-members-icon-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Base Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #357ae8;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-danger {
    background: #ea4335;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #d33b2c;
}

.btn-warning {
    background: #fbbc05;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #f29900;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Hide hover icons when edit mode (hover icons toggle) is off */
body.hover-icons-disabled .favorite-star,
body.hover-icons-disabled .category-card-edit-btn,
body.hover-icons-disabled .category-card-delete-btn,
body.hover-icons-disabled .category-card .share-btn,
body.hover-icons-disabled .category-card .team-btn,
body.hover-icons-disabled .category-card .public-profile-btn,
body.hover-icons-disabled .move-bookmarks-btn,
body.hover-icons-disabled .move-group-btn,
body.hover-icons-disabled .bookmark-actions-popover-wrap,
body.hover-icons-disabled .pin-group-btn,
body.hover-icons-disabled .saved-article-card-actions,
body.hover-icons-disabled .list-preview-edit-btn,
body.hover-icons-disabled .list-preview-delete-btn {
    display: none !important;
}

body.hover-icons-disabled #editBookmarkModal .favorite-star,
body.hover-icons-disabled #editCategoryModal .favorite-star {
    display: flex !important;
}
/* List Preview Mode styles */
.groups-list-preview-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 24px 0;
    width: 100%;
}

.list-preview-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 450px;
    border-left: 8px solid #ccc;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

.list-preview-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.list-preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.list-preview-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-preview-edit-btn,
.list-preview-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.list-preview-delete-btn {
    display: none;
}

body.unlocked:not(.hover-icons-disabled) .list-preview-delete-btn {
    display: flex;
}

.list-preview-edit-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.list-preview-delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}



.list-preview-header a {
    text-decoration: none;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-preview-header a:hover .list-preview-title {
    color: var(--primary-color);
}

.list-preview-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-preview-bookmarks {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

/* Custom scrollbar */
.list-preview-bookmarks::-webkit-scrollbar {
    width: 8px;
}
.list-preview-bookmarks::-webkit-scrollbar-track {
    background: transparent;
}
.list-preview-bookmarks::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}
.list-preview-bookmarks:hover::-webkit-scrollbar-thumb {
    background: #64748b;
}

.list-preview-item {
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

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

.list-preview-item:hover {
    background-color: #f1f5f9;
}

.list-preview-item-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    margin-bottom: 3px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-preview-item-url {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-preview-item-url:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.list-preview-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

/* Themes Tab Styles */
.settings-section-title-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    margin-top: 10px;
}

.settings-section-title-bar {
    width: 4px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 4px;
}


.settings-hint-modern {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 24px;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 16px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.theme-option.active {
    background: #eff6ff;
    border-color: var(--primary-color);
}

.theme-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: white;
}

.theme-icon svg {
    width: 40px;
    height: 40px;
}

.theme-default { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); }
.theme-blue { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.theme-red { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.theme-green { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }


.theme-name {
    font-weight: 700;
    font-size: 14px;
    color: #334155;
}

/* Edit group modal — consolidated card actions */
.edit-category-modal .modal-content.edit-category-modal-content {
    max-width: 440px;
    width: calc(100% - 24px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 0 0 8px;
    border-radius: 12px;
    box-sizing: border-box;
}

.edit-category-modal-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.edit-category-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.edit-category-modal-top-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.edit-category-modal-top-actions .edit-category-cancel-btn {
    padding: 8px 14px;
    border-radius: 8px;
}

.btn-update-group {
    background: #ef4444 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-update-group:hover {
    filter: brightness(0.95);
}

.edit-category-form {
    padding: 16px 20px 4px;
}

.edit-category-section {
    margin-top: 22px;
}

.edit-category-section-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.edit-category-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.edit-category-action-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}

.edit-category-action-tile:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.edit-category-action-tile.favorite-star {
    color: #64748b;
}

.edit-category-action-tile.favorite-star.is-favorite {
    color: #ca8a04;
    background: #fffbeb;
    border-color: #fcd34d;
}

.edit-category-action-tile.share-btn.is-active,
.edit-category-action-tile.public-profile-btn.is-active,
.edit-category-action-tile.team-btn.is-active {
    background: #e0e7ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

.edit-category-move-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.edit-category-move-subgroups-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    margin: 0 0 10px;
    cursor: pointer;
}

.edit-category-move-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.edit-category-move-list .team-popover-item {
    width: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box;
}

.edit-category-move-list .team-popover-item:last-child {
    border-bottom: none;
}

.edit-category-move-list .team-popover-item.is-selected:not(:disabled) {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.edit-category-move-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.edit-category-move-pill {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
}

.edit-category-move-pill:hover {
    background: #e2e8f0 !important;
}

.edit-category-danger-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
}

.btn-archive-group {
    background: #f97316 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.btn-archive-group:hover {
    filter: brightness(0.97);
}

.btn-delete-group {
    background: #fecaca !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 600;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.btn-delete-group:hover {
    filter: brightness(0.98);
}

/* Extension page notes: first control in .bookmark-actions-popover (left of edit); same 36×36 tiles as category.css */
.bookmark-item .bookmark-actions-popover .bookmark-extension-notes-btn.bookmark-action-btn {
    position: relative;
}

.bookmark-item .bookmark-actions-popover .bookmark-extension-notes-btn.bookmark-action-btn svg {
    stroke: none;
    fill: currentColor;
    color: #374151;
}

.bookmark-extension-notes-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--primary-color, #6366f1);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.bookmark-extension-notes-sidebar {
    position: fixed;
    inset: 0;
    z-index: 100050;
    pointer-events: none;
}

.bookmark-extension-notes-sidebar:not([hidden]) {
    pointer-events: auto;
}

.bookmark-extension-notes-sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
}

.bookmark-extension-notes-sidebar-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100vw - 24px);
    max-width: 100%;
    background: #f8fafc;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    animation: bookmarkExtensionNotesSlideIn 0.22s ease-out;
}

@keyframes bookmarkExtensionNotesSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.bookmark-extension-notes-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.bookmark-extension-notes-sidebar-header-text h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.bookmark-extension-notes-sidebar-sub {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.35;
    word-break: break-word;
}

.bookmark-extension-notes-sidebar-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.bookmark-extension-notes-sidebar-close:hover {
    background: #e2e8f0;
}

.bookmark-extension-notes-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px 24px;
}

.bookmark-extension-notes-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.bookmark-extension-notes-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.bookmark-extension-notes-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.bookmark-extension-notes-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin: 0;
}

.bookmark-extension-notes-delete-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bookmark-extension-notes-delete-btn:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.bookmark-extension-notes-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bookmark-extension-notes-delete-btn svg {
    display: block;
}

.bookmark-extension-notes-card-text {
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}
