body {
    background-color: #f9fbfc;
    font-variant-ligatures: no-common-ligatures;
    text-rendering: optimizeLegibility;
}

@font-face {
    font-family: "GeistMono";
    src: url("/static/fonts/GeistMono_wght.ttf");
    font-display: swap;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
small,
input,
div {
    font-family: "IBM Plex Sans", sans-serif;
}

a {
    transition: color 0.3s ease;
}

.hidden {
    display: none;
}

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 2rem 1.5rem;
}

.app-main > .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.top-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
}

.top-navbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-logo-icon {
    width: 30px;
    height: 30px;
    background: #6366f1;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.top-navbar-logo-text {
    font-weight: 800;
    font-size: 1.1rem;
    color: #38405b;
    letter-spacing: -0.02em;
}

.top-navbar-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.top-navbar-link {
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition:
        background 0.12s ease,
        color 0.12s ease;
    white-space: nowrap;
}

.top-navbar-link:hover {
    background: #f3f4f6;
    color: #38405b;
}

.top-navbar-link.active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

.top-navbar-count {
    font-size: 0.7rem;
    background: #e5e7eb;
    color: #6b7280;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 0.15rem;
}

.top-navbar-link.active .top-navbar-count {
    background: #c7d2fe;
    color: #4f46e5;
}

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-navbar-new-btn {
    display: inline-flex;
    align-items: center;
    background: #6366f1;
    color: #fff;
    padding: 0.4rem 0.85rem;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.top-navbar-new-btn:hover {
    background: #4f46e5;
    color: #fff;
}

.top-navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.top-navbar-avatar:hover {
    opacity: 0.85;
    color: #fff;
}

.top-navbar-mobile-toggle {
    display: none;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #38405b;
    cursor: pointer;
    padding: 0.25rem;
}

/* Mobile-only section inside hamburger menu - hidden on desktop */
.top-navbar-mobile-section {
    display: none;
}

.top-navbar-mobile-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.375rem 0;
}

/* Legacy navbar classes kept for non-sidebar pages */
.navbar-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: #38405b;
    text-decoration: none;
}

.navbar-logo:hover {
    color: #38405b;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar-link:hover {
    color: #38405b;
}

.navbar-right {
    margin-left: auto;
}

/* Hide top-navbar in reading mode */
body.reading-mode .top-navbar {
    display: none;
}

/* ===== AVATAR DROPDOWN ===== */
.avatar-dropdown-container {
    position: relative;
}

.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fbbf24;
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.avatar-btn:hover {
    border-color: #f59e0b;
    background: #fde68a;
}

.avatar-initial {
    line-height: 1;
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.avatar-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #fbbf24;
    background: #fef3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-initial-large {
    color: #92400e;
    font-weight: 600;
    font-size: 1.25rem;
}

.avatar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.avatar-user-name {
    font-weight: 600;
    color: #38405b;
    font-size: 0.95rem;
}

.avatar-user-email {
    color: #6b7280;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-subscription-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
    flex-wrap: wrap;
}

.avatar-sub-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.avatar-sub-trial {
    background: #fef3c7;
    color: #92400e;
}

.avatar-sub-pro {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
}

.avatar-sub-basic {
    background: #e0e7ff;
    color: #3730a3;
}

.avatar-sub-warning {
    background: #fee2e2;
    color: #991b1b;
}

.avatar-sub-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.avatar-sub-time {
    color: #d97706;
    font-size: 0.8rem;
    font-weight: 500;
}

.avatar-upgrade-link {
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    margin-left: auto;
}

.avatar-upgrade-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.avatar-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

.avatar-dropdown-nav {
    padding: 0.5rem 0;
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.avatar-dropdown-item:hover {
    background: #f9fafb;
    color: #38405b;
}

.avatar-dropdown-item ion-icon {
    font-size: 1.15rem;
    color: #9ca3af;
}

.avatar-dropdown-item:hover ion-icon {
    color: #6b7280;
}

.avatar-dropdown-logout {
    color: #6b7280;
}

.avatar-dropdown-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.avatar-dropdown-logout:hover ion-icon {
    color: #dc2626;
}

.box.no-shadow {
    box-shadow: none;
}

.box.small {
    padding: 0.6rem 1rem 0.1rem 1rem;
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
    .top-navbar-inner {
        padding: 0 1rem;
    }

    .top-navbar-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .top-navbar-links.open {
        display: flex;
    }

    .top-navbar-link {
        width: 100%;
        padding: 0.6rem 0.75rem;
    }

    .top-navbar-mobile-toggle {
        display: flex;
        align-items: center;
    }

    .top-navbar-right {
        display: none;
    }

    .top-navbar-mobile-section {
        display: contents;
    }

    .app-main {
        padding: 1.5rem 1rem;
    }

    .avatar-dropdown {
        right: -0.5rem;
        width: 260px;
    }

    .col-2,
    .col {
        width: 100%;
    }
}

/* ===== SEARCH TOOLBAR ===== */
.search-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.token-search-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    background: #fff;
    padding: 0.5rem 0.75rem;
    flex: 1;
    min-height: 42px;
    cursor: text;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.token-search-box:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.token-search-icon {
    color: #9ca3af;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.token-search-chips {
    display: contents;
}

.token-search-input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    color: #1d1f1e;
    flex: 1;
    min-width: 120px;
    padding: 0.125rem 0;
    background: transparent;
}

.token-search-input::placeholder {
    color: #9ca3af;
}

/* Search chips */
.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    border-radius: 5px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    animation: chipIn 0.15s ease;
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.search-chip-tag {
    background: #ede9fe;
    color: #6d28d9;
}

.search-chip-title {
    background: #dbeafe;
    color: #1d4ed8;
}

.search-chip-negative {
    background: #fee2e2;
    color: #dc2626;
}

.search-chip-text {
    background: #f3f4f6;
    color: #374151;
}

.search-chip-prefix {
    font-weight: 600;
    margin-right: 0.125rem;
}

.search-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.125rem;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.1s;
}

.search-chip-remove:hover {
    opacity: 1;
}

/* Search controls */
.search-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Sort dropdown */
.sort-dropdown {
    position: relative;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d3dbe9;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition:
        border-color 0.15s,
        background 0.15s;
}

.sort-btn:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.sort-btn ion-icon {
    font-size: 1rem;
    color: #9ca3af;
}

.sort-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
    z-index: 50;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
        opacity 0.15s,
        visibility 0.15s,
        transform 0.15s;
}

.sort-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.1s;
}

.sort-option:hover {
    background: #f3f4f6;
}

.sort-option.active {
    color: #6366f1;
    font-weight: 600;
}

/* View toggle */
.view-toggle {
    display: flex;
    border: 1px solid #d3dbe9;
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    color: #9ca3af;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}

.view-toggle-btn:first-child {
    border-right: 1px solid #d3dbe9;
}

.view-toggle-btn:hover {
    background: #f9fafb;
    color: #4b5563;
}

.view-toggle-btn.active {
    background: #f3f4f6;
    color: #374151;
}

.view-toggle-btn ion-icon {
    font-size: 1.1rem;
}

/* ===== GRID VIEW ===== */
.bookmark-view-grid #bookmark-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.bookmark-view-grid .bookmark-card {
    margin-bottom: 0;
}

.bookmark-view-grid .bookmark-card-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.bookmark-view-grid .bookmark-card-select {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
}

.bookmark-view-grid .bookmark-card {
    position: relative;
}

.bookmark-view-grid .bookmark-card-favicon {
    margin-left: 1.75rem;
}

.bookmark-view-grid .bookmark-card-content {
    width: 100%;
}

.bookmark-view-grid .bookmark-card-fav {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.bookmark-view-grid .bookmark-card-title a {
    -webkit-line-clamp: 3;
}

.bookmark-view-grid .dashboard-pagination {
    grid-column: 1 / -1;
}

.fadex {
    transition:
        opacity 0.5s linear,
        height 0.5s linear;
    opacity: 1;
}

.fadex.out {
    opacity: 0;
    height: 0;
    overflow: hidden;
    padding: 0 !important;
}

.box {
    background: #fff;
    padding: 0.6rem 1rem 0.6rem 1rem;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    box-shadow: 0 3px 4px 0 #e1e9f8;
}

.box small {
    color: #c2c2c2;
    font-size: 12px;
}

.box ul {
    margin: 0px;
    padding: 0px;
    color: #cbcbcb;
}

.box li {
    list-style: none;
    margin-bottom: 0.2rem;
}

.tag {
    display: inline-block;
    white-space: nowrap;
    padding: 0.3rem;
    font-size: 0.6rem;
    font-weight: 600;
    border-radius: 3px;
    line-height: normal;
    text-transform: uppercase;
    width: fit-content;
    cursor: pointer;
    margin: 0.3rem;
}

.tag-red {
    background: #fee2e2;
    color: #991b1b;
}

.tag-blue {
    background: #e0f2fe;
    color: #075985;
}

.tag-green {
    background-color: #dcfce7;
    color: #166534;
}

.tag-green:hover {
    background-color: #d9fcdf;
    color: #1ed02a;
}

.tag-yellow {
    background: #fef3c7;
    color: #92400e;
}

.tag-purple {
    background: #f3e8ff;
    color: #6b21a8;
}

.tag-standard {
    background: #e8ecef;
    color: #6b7682;
}

.tag-standard:hover {
    background: #ccd0d2;
    color: #232a31;
}

.tag-turquoise {
    background: #def8f9;
    color: #18b9b9;
}

/* ── Tag Management Page ── */

.tag-mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.tag-mgmt-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tag-mgmt-header p {
    color: #6b7280;
    margin: 0;
    font-size: 0.875rem;
}

.tag-mgmt-search {
    position: relative;
    min-width: 240px;
}

.tag-mgmt-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
}

.tag-mgmt-search input {
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

.tag-mgmt-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.tag-mgmt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
}

.tag-mgmt-toolbar .selected-count {
    color: #6b7280;
    font-size: 0.875rem;
}

.tag-mgmt-toolbar .toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-toolbar:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-toolbar.delete {
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-toolbar.delete:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.tag-mgmt-table {
    width: 100%;
    border-collapse: collapse;
}

.tag-mgmt-table thead th {
    text-transform: uppercase;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.tag-mgmt-table tbody td {
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    vertical-align: middle;
}

.tag-mgmt-table tbody tr:hover {
    background: #f9fafb;
}

.col-checkbox {
    width: 2.5rem;
}

.col-bookmarks {
    width: 8rem;
    text-align: center;
}

.col-actions {
    width: 7rem;
    text-align: right;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 0 0.25rem;
    vertical-align: middle;
}

.sort-btn:hover {
    color: #374151;
}

/* Color badge (pill with dot) */
.color-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: default;
    position: relative;
}

.color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.color-badge-standard {
    background: #f3f4f6;
    color: #4b5563;
}
.color-badge-standard .color-dot {
    background: #9ca3af;
}

.color-badge-red {
    background: #fef2f2;
    color: #dc2626;
}
.color-badge-red .color-dot {
    background: #ef4444;
}

.color-badge-yellow {
    background: #fffbeb;
    color: #b45309;
}
.color-badge-yellow .color-dot {
    background: #f59e0b;
}

.color-badge-blue {
    background: #eff6ff;
    color: #2563eb;
}
.color-badge-blue .color-dot {
    background: #3b82f6;
}

.color-badge-green {
    background: #f0fdf4;
    color: #16a34a;
}
.color-badge-green .color-dot {
    background: #22c55e;
}

.color-badge-purple {
    background: #faf5ff;
    color: #7c3aed;
}
.color-badge-purple .color-dot {
    background: #8b5cf6;
}

.color-badge-turquoise {
    background: #f0fdfa;
    color: #0d9488;
}
.color-badge-turquoise .color-dot {
    background: #14b8a6;
}

/* Color dropdown */
.color-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.color-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 50;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0.375rem 0;
    min-width: 140px;
}

.color-dropdown.show {
    display: block;
}

.color-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: #374151;
}

.color-dropdown-item:hover {
    background: #f3f4f6;
}

.color-dropdown-item .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-standard { background: #9ca3af; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-blue { background: #3b82f6; }
.dot-green { background: #22c55e; }
.dot-purple { background: #8b5cf6; }
.dot-turquoise { background: #14b8a6; }

/* Row actions */
.row-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    font-size: 1.05rem;
    line-height: 1;
    border-radius: 0.25rem;
    transition: color 0.15s, background 0.15s;
}

.row-action-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

.row-action-btn.delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Inline edit input */
.edit-input {
    width: 100%;
    padding: 0.125rem 0.25rem;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    box-sizing: border-box;
    font-size: 0.875rem;
    outline: none;
}

.edit-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

h6 {
    color: #b3b3b3;
    font-family: IBM Plex Sans;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
}

.bookmark-title {
    margin-bottom: 0;
    padding-bottom: 0;
}

.bookmark-title a {
    color: #666666;
    text-decoration: none;
    font-size: 0.95em;
}

.bookmark-title a:hover {
    text-decoration: none;
}

.bookmark-title + small > a {
    color: #c4c4c4;
    text-decoration: none;
}

.bookmark-title + small > a:hover {
    color: #0835ea;
    text-decoration: none;
}

footer {
    margin-top: 3rem;
}

.fa-times:hover {
    color: #ce4948;
    cursor: pointer;
}

.fa-bookmark:hover {
    color: #22e22e;
    cursor: pointer;
}

.archived-active {
    color: #22e22e;
}

.fa-eye:hover {
    color: #2266e2;
    cursor: pointer;
}

.fa-eye a {
    color: red;
}

.bookmark-delete-buttons {
    background: none;
    border: none;
    color: #cbcbcb;

    &.remove-trash {
        color: #f2d9a9;
    }

    &.remove-trash:hover {
        color: #e8ac3b;
        cursor: pointer;
    }

    &.permanently-bookmark {
        color: #f7baba;
    }

    &.permanently-bookmark:hover {
        color: #ec2f2f;
        cursor: pointer;
    }
}

#tagstobeadded ion-icon {
    position: relative;
    top: 0.1rem;
    font-size: 0.8rem;
}

#tagstobeadded ion-icon:hover {
    color: rgb(234, 7, 7);
}

/* ================================
   Settings Page Layout & Navigation
   ================================ */

.settings-page {
    margin: 0 auto;
    padding: 2rem 1rem;
}

.settings-header {
    text-align: center;
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.settings-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.settings-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.settings-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
}

.settings-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.settings-nav-item:hover {
    color: #2266e2;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-nav-item-active {
    color: #2266e2;
    background: #fff;
    box-shadow: 0 2px 12px rgba(34, 102, 226, 0.15);
}

.settings-nav-item-active svg {
    color: #2266e2;
}

.settings-nav-item-disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.settings-nav-item-disabled:hover {
    color: #94a3b8;
    background: transparent;
    box-shadow: none;
}

.settings-nav-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    border-radius: 6px;
    margin-left: 0.25rem;
}

.settings-content {
    /* Content wrapper */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-page {
        padding: 1rem 0.5rem;
    }

    .settings-nav {
        gap: 0.25rem;
        padding: 0.375rem;
    }

    .settings-nav-item {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }

    .settings-nav-item span:not(.settings-nav-badge) {
        display: none;
    }

    .settings-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .settings-title {
        font-size: 1.5rem;
    }
}

.link-screenshot > img {
    object-fit: cover;
}

@media only screen and (max-width: 990px) {
    .search-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .search-controls {
        justify-content: flex-end;
    }

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

    .pagination > .step-links {
        margin: auto;
    }

    .back-button {
        margin-top: 1rem;
    }
}

.fade-me-in.htmx-added {
    opacity: 0;
}
.fade-me-in {
    opacity: 1;
    transition: opacity 1s ease-out;
}

.breadcrumbs {
    font-weight: 500;

    a,
    .root {
        text-decoration: none;
        color: #bacad2;
    }

    .delimiter {
        color: #acacad;
    }

    a:hover {
        text-decoration: underline;
        color: #38405b;
    }

    .current {
        color: #8c9da6;
    }
}

/* Collection Page Styles */
.collection-header {
    margin-bottom: 0;
}

.collection-header h3 {
    margin-bottom: 0.25rem;
}

.collection-visibility {
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.85em;
    font-weight: 600;
    color: #a6bdc8;
}

.collection-visibility ion-icon {
    position: relative;
    top: 2px;
    margin-right: 2px;
}

.collection-description {
    color: #666;
    font-size: 0.95em;
}

.collection-stats {
    color: #666;
    font-size: 0.9em;
}

.collection-stats .stat-item {
    display: inline-block;
    margin-left: 1rem;
}

.collection-stats .stat-item:first-child {
    margin-left: 0;
}

/* Collection Toolbar */
.collection-toolbar {
    padding: 0.5rem 0;
}

#collection-search-box {
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    box-shadow: 0 3px 5px 0 #e1e9f8;
    background: #fff;
    padding: 0.75rem 1rem;
}

#collection-search-box input {
    border: none;
    width: 100%;
    font-family: "GeistMono";
    color: #1d1f1e;
}

#collection-search-box input:focus {
    border: none;
    outline: none;
}

#collection-search-box input::placeholder {
    color: #939393;
}

#sort-select {
    border-color: #d3dbe9;
}

/* Minimal View Styles */
.bookmark-minimal {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.bookmark-minimal:last-child {
    border-bottom: none;
}

.bookmark-minimal .bookmark-domain {
    color: #b0b0b0;
    font-size: 0.85em;
}

/* Rich View Styles */
.bookmark-rich {
    margin-bottom: 0.75rem;
}

.bookmark-rich .bookmark-favicon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.bookmark-rich .bookmark-domain-link {
    color: #2266e2;
    text-decoration: none;
    font-size: 0.85em;
}

.bookmark-rich .bookmark-domain-link:hover {
    text-decoration: underline;
}

.bookmark-rich .bookmark-excerpt {
    color: #777;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.bookmark-rich .bookmark-meta {
    color: #999;
    font-size: 0.8em;
}

.bookmark-rich .bookmark-meta ion-icon {
    position: relative;
    top: 2px;
    margin-right: 3px;
}

/* Empty state */
.no-bookmarks {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: auto;
}

/* View mode toggle */
.btn-group .btn-check:checked + .btn-outline-dark {
    background-color: #212529;
    color: #fff;
}

/* Responsive styles for collection page */
@media screen and (max-width: 768px) {
    .collection-header .text-end {
        text-align: left !important;
        margin-top: 1rem;
    }

    .collection-stats .stat-item {
        display: block;
        margin-left: 0;
        margin-bottom: 0.25rem;
    }

    .collection-toolbar .text-md-end {
        text-align: left !important;
        margin-top: 0.5rem;
    }

    #sort-select {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .btn-group {
        margin-top: 0.5rem;
    }
}

/* ===== NEW COLLECTION HEADER (Tabbed Interface) ===== */
.collection-header-new {
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

.collection-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #38405b;
    letter-spacing: -0.02em;
}

.collection-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.badge-public {
    background: #e8f4f0;
    color: #5a9a8a;
    transition: background 0.2s ease;
}

.badge-public:hover {
    background: #d9ede5;
}

.badge-private {
    background: #f0f2f5;
    color: #8c9da6;
}

/* Badge Tooltip */
.badge-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #38405b;
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.badge-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #38405b;
}

.badge-public:hover .badge-tooltip {
    opacity: 1;
}

.badge-tooltip.copied {
    background: #5a9a8a;
}

.badge-tooltip.copied::after {
    border-top-color: #5a9a8a;
}

.meta-item {
    color: #8c9da6;
    font-size: 0.95rem;
}

.collection-description {
    color: #8c9da6;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0.75rem 0 0 0;
    max-width: 700px;
}

.collection-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.collection-actions .btn-primary {
    background: #7889a0;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}

.collection-actions .btn-primary:hover {
    background: #6a7b91;
    color: #fff;
}

.collection-actions .btn-outline {
    background: #fff;
    color: #8c9da6;
    border: 1px solid #d3dbe9;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.collection-actions .btn-outline:hover {
    border-color: #bacad2;
    color: #38405b;
}

/* ===== TAB NAVIGATION ===== */
.tab-navigation {
    border-bottom: 1px solid #e1e9f8;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.75rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #bacad2;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.tab-button.active {
    color: #5a7a8a;
    border-bottom-color: #5a7a8a;
}

.tab-button:hover {
    color: #8c9da6;
}

/* ===== TAB CONTENT ===== */
.tab-content-container {
    position: relative;
    min-height: 400px;
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.tab-pane.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ARTICLE TAB ===== */
.article-wrapper {
    padding: 2rem;
    overflow: hidden;
}

.article-container {
    max-width: 700px;
    margin: 0 auto;
}

.article-content-plain {
    line-height: 1.8;
    color: #333;
    font-size: 1.05rem;
    overflow-wrap: break-word;
}

.article-content-plain p {
    margin-bottom: 1.5rem;
}

.article-content-plain img {
    max-width: 100%;
    height: auto;
}

.ce-block__content {
    max-width: 100%;
}

.ce-paragraph {
    line-height: 1.8;
    color: #333;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.ce-header {
    font-weight: 700;
    color: #1a1a1a;
    margin: 2rem 0 1rem;
}

.citation-link {
    color: #5a7a8a;
    text-decoration: none;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 3px;
    transition: background 0.2s;
}

.citation-link:hover {
    background: #f0f5f8;
    color: #38405b;
}

/* Citation Popup */
.citation-popup {
    position: fixed;
    background: #fff;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    max-width: 350px;
    z-index: 2000;
}

.citation-popup .citation-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #38405b;
    margin-bottom: 0.5rem;
}

.citation-popup .citation-domain {
    color: #bacad2;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.citation-popup .citation-excerpt {
    color: #8c9da6;
    font-size: 0.85rem;
    margin: 0.75rem 0;
    line-height: 1.5;
}

.citation-popup .citation-full-link {
    color: #5a7a8a;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

.citation-popup .citation-full-link:hover {
    color: #38405b;
    text-decoration: underline;
}

/* No Article State */
.no-article-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.no-article-state h4 {
    color: #8c9da6;
    margin: 1rem 0;
    font-weight: 500;
}

.no-article-state .btn-primary {
    background: #7889a0;
    color: #fff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin-right: 0.5rem;
}

.no-article-state .btn-primary:hover {
    background: #6a7b91;
}

.no-article-state .btn-outline {
    background: #fff;
    color: #8c9da6;
    border: 1px solid #d3dbe9;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
}

.no-article-state .btn-outline:hover {
    border-color: #bacad2;
    color: #38405b;
}

/* ===== BOOKMARK DETAIL SUB-HEADER ===== */
.bookmark-detail-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e1e9f8;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bookmark-detail-subheader-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bookmark-detail-subheader-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bookmark-back-link {
    color: #38405b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bookmark-back-link:hover {
    color: #5a7a8a;
}

.bookmark-domain-link {
    background: #f0f5f8;
    color: #5a7a8a;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bookmark-domain-link:hover {
    background: #e1e9f8;
    color: #38405b;
}

.btn-detail-action {
    background: none;
    border: 1px solid #d3dbe9;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #8c9da6;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-detail-action:hover {
    border-color: #bacad2;
    color: #38405b;
    background: #f8f9fa;
}

.btn-detail-action.active {
    background: #e8ecef;
    border-color: #bacad2;
    color: #38405b;
}

.btn-detail-action-danger.active {
    background: #fef5f5;
    border-color: #e8a0a0;
    color: #ce4948;
}

.btn-detail-action-danger:hover {
    border-color: #e8a0a0;
    color: #ce4948;
    background: #fef5f5;
}

.detail-status-banner {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    animation: bannerFadeIn 0.2s ease;
}

.detail-status-banner-info {
    background: #e8ecef;
    color: #38405b;
    border: 1px solid #d3dbe9;
}

.detail-status-banner-danger {
    background: #fef5f5;
    color: #ce4948;
    border: 1px solid #e8a0a0;
}

@keyframes bannerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ARTICLE READING VIEW ===== */
.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    color: #8c9da6;
}

.article-meta .article-author {
    font-weight: 500;
}

.article-meta .article-reading-time {
    color: #bacad2;
}

.article-meta .article-author + .article-reading-time::before {
    content: "\00B7";
    margin-right: 0.75rem;
    color: #bacad2;
}

/* ===== MARKDOWN TAB ===== */
.markdown-pre {
    background: #f8f9fa;
    border: 1px solid #e1e9f8;
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #38405b;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-top: 0.75rem;
}

.markdown-pre code {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 0.85rem;
    background: none;
    padding: 0;
}

/* ===== SIDEBAR COLLAPSIBLE SECTIONS ===== */
.sidebar-section {
    background: #fff;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #38405b;
    user-select: none;
    transition: background 0.15s;
}

.sidebar-section-header:hover {
    background: #f8f9fa;
    border-radius: 10px;
}

.section-chevron {
    font-size: 1rem;
    color: #bacad2;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.section-chevron.collapsed {
    transform: rotate(-90deg);
}

.sidebar-section-body {
    padding: 0 1rem 1rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

.sidebar-section-body.collapsed {
    display: none;
}

.sidebar-section-body h6 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8c9da6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

/* ===== AI ASSISTANT COMPACT ===== */
.chat-messages-compact {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e1e9f8;
    border-radius: 8px;
    background: #f9fbfc;
}

.chat-messages-compact .message {
    max-width: 90%;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    clear: both;
    display: block;
}

.chat-messages-compact .message p {
    margin-bottom: 0.25em;
}

.chat-messages-compact .user-message {
    float: right;
    background: #2e3439;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-messages-compact .assistant-message {
    float: left;
    background: #e4e6eb;
    color: #333;
    border-bottom-left-radius: 4px;
}

.prompt-chips {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.prompt-chip {
    background: #fff;
    border: 1px solid #d3dbe9;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #5a7a8a;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.prompt-chip:hover {
    border-color: #5a7a8a;
    background: #f0f5f8;
    color: #38405b;
}

.assistant-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.assistant-input-row .form-control {
    font-size: 0.85rem;
    border: 1px solid #d3dbe9;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .bookmark-detail-subheader {
        flex-direction: column;
        align-items: flex-start;
    }

    .bookmark-detail-subheader-right {
        width: 100%;
        justify-content: flex-start;
    }

    .tab-navigation {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding-bottom: 0.25rem;
    }

    .tab-button {
        white-space: nowrap;
        font-size: 0.8rem;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .article-wrapper {
        padding: 1rem;
    }

    .prompt-chips {
        flex-direction: column;
    }
}

/* ===== SOURCES TAB ===== */
.sources-toolbar {
    background: #fff;
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid #d3dbe9;
    box-shadow: 0 3px 4px 0 #e1e9f8;
}

.sources-toolbar .form-control {
    border: 1px solid #d3dbe9;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    color: #38405b;
}

.sources-toolbar .form-control::placeholder {
    color: #bacad2;
}

.sources-toolbar .form-select {
    border: 1px solid #d3dbe9;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    color: #8c9da6;
}

/* Citation Number Circle (Rich View) */
.bookmark-source-card {
    position: relative;
    padding-left: 4rem;
    margin-bottom: 1rem;
}

.citation-number-circle {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: 36px;
    height: 36px;
    background: #e1e9f8;
    color: #5a7a8a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.bookmark-title-source {
    font-size: 1rem;
    color: #38405b;
    margin-bottom: 0.4rem;
}

.bookmark-title-source a {
    color: #38405b;
    text-decoration: none;
}

.bookmark-title-source a:hover {
    color: #5a7a8a;
}

.bookmark-domain-text {
    color: #bacad2;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.bookmark-excerpt-text {
    color: #8c9da6;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.bookmark-meta-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.date-text {
    color: #bacad2;
    font-size: 0.8rem;
}

.tags-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Citation Number Circle (Minimal View) */
.bookmark-source-minimal {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.bookmark-source-minimal:last-child {
    border-bottom: none;
}

.citation-number-circle-small {
    width: 28px;
    height: 28px;
    background: #e1e9f8;
    color: #5a7a8a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.bookmark-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bookmark-title-minimal {
    font-weight: 500;
    color: #38405b;
    font-size: 0.95rem;
}

.bookmark-title-minimal a {
    color: #38405b;
    text-decoration: none;
}

.bookmark-title-minimal a:hover {
    color: #5a7a8a;
}

.bookmark-domain-minimal {
    color: #bacad2;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Reading Mode */
body.reading-mode .collection-header-new,
body.reading-mode .tab-navigation,
body.reading-mode .breadcrumbs {
    display: none;
}

body.reading-mode .article-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 2rem 1rem;
}

body.reading-mode .article-container {
    max-width: 650px;
    font-size: 1.1rem;
}

body.reading-mode {
    background: #fff;
}

/* Floating Exit Button Container - hidden by default */
.reading-mode-exit-container {
    display: none;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.reading-mode-exit-btn {
    background: #fff;
    border: 1px solid #d3dbe9;
    border-radius: 6px;
    padding: 0.6rem 1.25rem;
    color: #8c9da6;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.reading-mode-exit-btn ion-icon {
    position: relative;
    top: 1px;
    margin-right: 0.35rem;
    font-size: 1.1rem;
}

.reading-mode-exit-btn:hover {
    border-color: #bacad2;
    color: #38405b;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.reading-mode-hint {
    color: #bacad2;
    font-size: 0.75rem;
}

/* Show exit container only in reading mode */
body.reading-mode .reading-mode-exit-container {
    display: flex;
}

/* Responsive styles for new collection layout */
@media screen and (max-width: 768px) {
    .collection-title {
        font-size: 1.75rem;
    }

    .collection-meta {
        gap: 0.75rem;
    }

    .tab-navigation {
        gap: 1rem;
    }

    .tab-button {
        font-size: 0.9rem;
        padding: 0.75rem 0;
    }

    .bookmark-source-card {
        padding-left: 3.25rem;
    }

    .citation-number-circle {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        left: 0.5rem;
    }

    .sources-toolbar .row > div {
        margin-bottom: 0.75rem;
    }
}

/* ===== BOOKMARK SELECTION UI ===== */
.bookmark-select-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.bookmark-select-checkbox:checked {
    background-color: #5a7a8a;
    border-color: #5a7a8a;
}

.bookmark-item.selected {
    background-color: #f8fafc;
    border-color: #5a7a8a;
}

/* Selection Action Bar (floating) */
.selection-action-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 0.75rem 1.25rem;
    z-index: 1000;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.selection-action-bar #selection-count {
    font-weight: 500;
    color: #5a7a8a;
    font-size: 0.9rem;
}

.selection-action-bar .btn ion-icon {
    position: relative;
    top: 2px;
    margin-right: 4px;
}

/* Collection Modal Overlay */
.collection-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.15s ease-out;
}

.collection-modal-content {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.collection-modal-content h5 {
    margin-bottom: 0.5rem;
    color: #38405b;
}

/* Responsive selection UI */
@media screen and (max-width: 768px) {
    .selection-action-bar {
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
        transform: none;
        bottom: 1rem;
    }

    .selection-action-bar .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem !important;
    }

    .selection-action-bar .btn-group {
        margin-top: 0;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .collection-modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* ===== AUTH PAGE STYLES ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #f9fbfc;
}

.auth-box {
    background: #fff;
    padding: 2.5rem;
    border: 1px solid #d3dbe9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(225, 233, 248, 0.5);
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-weight: 800;
    font-size: 2rem;
    color: #38405b;
    letter-spacing: -0.02em;
    margin: 0;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #38405b;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #8c9da6;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* ===== SOCIAL LOGIN BUTTONS ===== */
.social-login-section {
    margin-top: 1.5rem;
}

.social-login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.social-login-divider::before,
.social-login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e1e9f8;
}

.social-login-divider span {
    padding: 0 1rem;
    color: #bacad2;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid;
}

.btn-social-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-social-icon svg {
    width: 100%;
    height: 100%;
}

/* Google Button */
.btn-social-google {
    background: #fff;
    border-color: #d3dbe9;
    color: #38405b;
}

.btn-social-google:hover {
    background: #f8fafc;
    border-color: #bacad2;
    color: #38405b;
}

/* Microsoft Button */
.btn-social-microsoft {
    background: #fff;
    border-color: #d3dbe9;
    color: #38405b;
}

.btn-social-microsoft:hover {
    background: #f8fafc;
    border-color: #bacad2;
    color: #38405b;
}

/* Apple Button */
.btn-social-apple {
    background: #000;
    border-color: #000;
    color: #fff;
}

.btn-social-apple:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

/* ===== AUTH FORM IMPROVEMENTS ===== */
.auth-form .form-floating {
    margin-bottom: 1rem;
}

.auth-form .form-floating .form-control {
    border: 1px solid #d3dbe9;
    border-radius: 8px;
    padding: 1.625rem 0.875rem 0.625rem;
    height: auto;
    font-size: 1rem;
}

.auth-form .form-floating .form-control:focus {
    border-color: #2266e2;
    box-shadow: 0 0 0 3px rgba(34, 102, 226, 0.1);
}

.auth-form .form-floating label {
    color: #8c9da6;
}

.auth-form .btn-primary {
    background: #2266e2;
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    transition: background 0.2s ease;
}

.auth-form .btn-primary:hover {
    background: #1a54c4;
}

.auth-form .form-check-input:checked {
    background-color: #2266e2;
    border-color: #2266e2;
}

.auth-link-small {
    color: #2266e2;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-link-small:hover {
    text-decoration: underline;
    color: #1a54c4;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links p {
    color: #8c9da6;
    margin: 0;
}

.auth-links a {
    color: #2266e2;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ===== AUTH ALERT STATES ===== */
.auth-form .is-invalid {
    border-color: #ce4948;
}

.auth-form .invalid-feedback {
    color: #ce4948;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.auth-alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-alert p {
    margin: 0;
}

.auth-alert-error {
    background: #fdebea;
    color: #ce4948;
    border: 1px solid #f5c6c5;
}

.auth-alert-success {
    background: #def9e1;
    color: #1a8a2e;
    border: 1px solid #b8edc0;
}

/* ===== AUTH PAGE RESPONSIVE ===== */
@media screen and (max-width: 480px) {
    .auth-box {
        padding: 1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .auth-container {
        padding: 0;
        align-items: flex-start;
    }

    .social-login-buttons {
        gap: 0.5rem;
    }

    .btn-social {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===== SOCIAL LOGIN CONFIRMATION PAGE ===== */
.social-login-confirm {
    text-align: center;
}

.social-login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f0fe 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.social-login-icon svg {
    width: 44px;
    height: 44px;
}

.social-login-icon-apple {
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    color: #fff;
}

.social-login-icon-microsoft {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
}

/* Provider-specific buttons */
.btn-provider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-provider::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
}

.btn-provider-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-provider-icon svg {
    width: 100%;
    height: 100%;
}

/* Google button */
.btn-provider-google {
    background: #4285f4;
    color: #fff;
    box-shadow: 0 4px 14px rgba(66, 133, 244, 0.4);
}

.btn-provider-google:hover {
    background: #3367d6;
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.5);
    transform: translateY(-1px);
}

.btn-provider-google:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
}

.btn-provider-google .btn-provider-icon svg path {
    fill: #fff;
}

/* Microsoft button */
.btn-provider-microsoft {
    background: linear-gradient(135deg, #00a4ef 0%, #0078d4 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 120, 212, 0.4);
}

.btn-provider-microsoft:hover {
    background: linear-gradient(135deg, #0091d4 0%, #006cbe 100%);
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.5);
    transform: translateY(-1px);
}

.btn-provider-microsoft:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.btn-provider-microsoft .btn-provider-icon svg rect {
    fill: #fff;
}

/* Apple button */
.btn-provider-apple {
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn-provider-apple:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.btn-provider-apple:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== AUTH MESSAGE PAGES (Email Verification, etc.) ===== */
.auth-message-page {
    text-align: center;
}

.auth-message-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.auth-message-icon svg {
    width: 44px;
    height: 44px;
}

.auth-message-icon-email {
    background: linear-gradient(135deg, #e8f4fc 0%, #d1e9f6 100%);
    color: #2266e2;
    box-shadow: 0 8px 24px rgba(34, 102, 226, 0.15);
}

.auth-message-icon-confirm {
    background: linear-gradient(135deg, #e8f9ec 0%, #d1f2da 100%);
    color: #1a8a2e;
    box-shadow: 0 8px 24px rgba(26, 138, 46, 0.15);
}

.auth-message-icon-success {
    background: linear-gradient(135deg, #e8f9ec 0%, #d1f2da 100%);
    color: #1a8a2e;
    box-shadow: 0 8px 24px rgba(26, 138, 46, 0.15);
}

.auth-message-icon-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fde8e8 100%);
    color: #ce4948;
    box-shadow: 0 8px 24px rgba(206, 73, 72, 0.15);
}

.auth-message-content {
    margin: 2rem 0;
}

.auth-message-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
}

.auth-message-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-message-step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #2266e2 0%, #1a54c4 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.auth-message-step-text {
    color: #38405b;
    font-weight: 500;
}

.auth-message-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9rem;
}

.auth-message-note svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Confirm button */
.btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
    text-decoration: none;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-confirm:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.btn-confirm svg {
    width: 20px;
    height: 20px;
}

.btn-confirm-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-confirm-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #334155;
}

/* ================================
   Account Settings Page Styles
   ================================ */

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.settings-section-header svg {
    width: 24px;
    height: 24px;
    color: #64748b;
    flex-shrink: 0;
}

.settings-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.settings-section-content {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

.settings-section-content p {
    margin: 0 0 1rem 0;
}

.settings-section-content p:last-child {
    margin-bottom: 0;
}

.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #2266e2 0%, #1a54c4 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-settings:hover {
    background: linear-gradient(135deg, #1a54c4 0%, #1548a8 100%);
    box-shadow: 0 4px 12px rgba(34, 102, 226, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

/* Danger zone styling */
.settings-section-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.settings-section-danger .settings-section-header {
    border-bottom-color: #fecaca;
}

.settings-section-danger .settings-section-header svg {
    color: #dc2626;
}

.settings-section-danger .settings-section-header h3 {
    color: #991b1b;
}

.btn-settings-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-settings-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Settings form styles */
.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.settings-form-field input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #fff;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    box-sizing: border-box;
}

.settings-form-field input[type="text"]:focus {
    outline: none;
    border-color: #2266e2;
    box-shadow: 0 0 0 3px rgba(34, 102, 226, 0.1);
}

.settings-form-error {
    display: block;
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Settings alert messages */
.settings-messages {
    margin-bottom: 1rem;
}

.settings-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.settings-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.settings-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@media (max-width: 480px) {
    .settings-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Badge styles */
.badge-verified {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-unverified {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Social accounts list on account settings page */
.social-accounts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.social-account-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.social-provider-badge {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-provider-badge svg {
    width: 18px;
    height: 18px;
}

.social-provider-google svg {
    color: #4285f4;
}
.social-provider-microsoft svg {
    color: #00a4ef;
}
.social-provider-apple svg {
    color: #000;
}

.social-provider-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
}

/* ================================
   Delete Account Page Styles
   ================================ */

.delete-account-page {
    max-width: 500px;
    margin: 0 auto;
}

.delete-account-warning {
    text-align: center;
    margin-bottom: 2rem;
}

.delete-warning-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.delete-warning-icon svg {
    width: 32px;
    height: 32px;
    color: #dc2626;
}

.delete-account-warning h2 {
    font-size: 1.5rem;
    color: #991b1b;
    margin: 0 0 1rem 0;
}

.delete-account-warning p {
    color: #64748b;
    margin: 0 0 1rem 0;
}

.delete-warning-list {
    text-align: left;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem 1rem 1rem 2rem;
    margin: 1rem 0;
    list-style: disc;
}

.delete-warning-list li {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.delete-warning-list li:last-child {
    margin-bottom: 0;
}

.delete-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    margin-bottom: 1.5rem;
}

.delete-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.delete-account-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.delete-confirm-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.delete-confirm-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    margin-bottom: 1.5rem;
}

.delete-confirm-input:focus {
    outline: none;
    border-color: #dc2626;
}

.delete-actions {
    display: flex;
    gap: 1rem;
}

.btn-cancel {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-delete-confirm {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-confirm:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-delete-confirm svg {
    width: 18px;
    height: 18px;
}

/* ================================
   Email Management Page Styles
   ================================ */

.email-management {
    margin-bottom: 1.5rem;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    gap: 1rem;
}

.email-item-primary {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.email-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.email-address {
    font-weight: 500;
    color: #1e293b;
    word-break: break-all;
}

.email-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.email-actions {
    flex-shrink: 0;
}

.email-action-form {
    display: flex;
    gap: 0.5rem;
}

.btn-email-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-email-action svg {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.btn-email-action:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-email-action:hover svg {
    color: #475569;
}

.btn-email-action-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.btn-email-action-danger:hover svg {
    color: #dc2626;
}

.email-add-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.email-add-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.email-add-form {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.email-add-form .form-floating {
    flex: 1;
}

.email-add-form .btn {
    margin-top: 0;
    height: 58px;
}

/* ================================
   Social Connections Page Styles
   ================================ */

.social-connections {
    margin-bottom: 1.5rem;
}

.connections-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.connections-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.connected-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.connected-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.social-provider-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.social-provider-icon svg {
    width: 24px;
    height: 24px;
}

.social-provider-google svg {
    fill: #4285f4;
}
.social-provider-microsoft svg {
    fill: #00a4ef;
}
.social-provider-apple svg {
    fill: #000;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    overflow: hidden;
}

.provider-name {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-email {
    font-size: 0.875rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-disconnect {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-disconnect svg {
    width: 16px;
    height: 16px;
}

.btn-disconnect:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.connect-providers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-connect {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-connect svg {
    width: 20px;
    height: 20px;
}

.btn-connect:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-connect-google svg {
    fill: #4285f4;
}
.btn-connect-microsoft svg {
    fill: #00a4ef;
}
.btn-connect-apple svg {
    fill: #000;
}

/* Text muted helper */
.text-muted {
    color: #94a3b8;
}

/* ===== ONBOARDING / PRICING PAGES ===== */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #f9fbfc;
}

.onboarding-content {
    width: 100%;
    max-width: 900px;
}

/* Welcome card */
.welcome-card {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    box-shadow: 0 6px 9px 0 #e1e9f8;
    overflow: hidden;
    position: relative;
}

.welcome-card-inner {
    padding: 2.75rem 2.5rem 2.25rem;
}

@media (max-width: 540px) {
    .welcome-card-inner {
        padding: 2rem 1.5rem 1.75rem;
    }
}

.onboarding-header {
    text-align: center;
    margin-bottom: 0;
}

.welcome-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #e1e9f8;
    color: #38405b;
    margin-bottom: 1.25rem;
}

.onboarding-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #38405b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.onboarding-header p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
}

.welcome-divider {
    height: 1px;
    background: #d3dbe9;
    margin: 1.75rem 0;
}

/* Trial features inside welcome card */
.welcome-card .trial-features h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 1rem;
}

.welcome-card .trial-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: grid;
    gap: 0.6rem;
}

.welcome-card .trial-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.925rem;
    color: #38405b;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #10b981;
    flex-shrink: 0;
}

/* Welcome form */
.welcome-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.welcome-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #38405b;
    margin-bottom: 0.5rem;
}

.welcome-form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #38405b;
    background: #f8fafc;
    border: 1px solid #d3dbe9;
    border-radius: 10px;
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    box-sizing: border-box;
}

.welcome-form-group input::placeholder {
    color: #9ca3af;
}

.welcome-form-group input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.welcome-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #38405b;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.1s;
}

.welcome-btn:hover {
    background: #2d3449;
}

.welcome-btn:active {
    transform: scale(0.985);
}

.welcome-btn svg {
    transition: transform 0.2s;
}

.welcome-btn:hover svg {
    transform: translateX(3px);
}

.welcome-fine-print {
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.trial-expired-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.trial-expired-notice svg {
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.trial-expired-notice strong {
    display: block;
    color: #92400e;
    margin-bottom: 0.25rem;
}

.trial-expired-notice p {
    color: #a16207;
    margin: 0;
    font-size: 0.95rem;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .pricing-cards {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    transition: all 0.2s ease;
}

.pricing-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.pricing-card-featured {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.pricing-card-featured:hover {
    border-color: #4f46e5;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

.pricing-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #38405b;
    margin-bottom: 0.25rem;
}

.pricing-description {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

.pricing-price {
    margin-top: 1rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #38405b;
}

.price-interval {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

.pricing-features {
    margin-bottom: 1.5rem;
}

.pricing-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.pricing-features li svg {
    color: #10b981;
    flex-shrink: 0;
}

.pricing-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pricing-actions form {
    width: 100%;
}

.btn-subscribe {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #38405b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-subscribe:hover {
    background: #2d3449;
    transform: translateY(-1px);
}

.btn-subscribe-featured {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.btn-subscribe-featured:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.btn-trial {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-trial:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #4b5563;
}

.onboarding-footer {
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.onboarding-footer a {
    color: #6366f1;
    text-decoration: none;
}

.onboarding-footer a:hover {
    text-decoration: underline;
}

/* Success page */
.onboarding-success,
.onboarding-error {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.success-icon svg {
    color: #10b981;
}

.error-icon svg {
    color: #ef4444;
}

.onboarding-success h1,
.onboarding-error h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #38405b;
    margin: 1.5rem 0 0.75rem;
}

.onboarding-success p,
.onboarding-error p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.success-actions,
.error-actions {
    margin-bottom: 1.5rem;
}

.success-actions .btn-primary,
.error-actions .btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.success-actions .btn-primary:hover,
.error-actions .btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
}

.success-note,
.error-note {
    font-size: 0.875rem;
    color: #9ca3af;
}

.error-note a {
    color: #6366f1;
    text-decoration: none;
}

.error-note a:hover {
    text-decoration: underline;
}

/* ===== SUBSCRIPTION BADGES (Sidebar) ===== */
.subscription-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
}

.subscription-badge-trial {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.subscription-badge-trial:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    color: #78350f;
    text-decoration: none;
}

.subscription-badge-trial .badge-text {
    font-weight: 700;
}

.subscription-badge-trial .badge-days {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.85;
    margin-top: 1px;
}

.subscription-badge-basic {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
    border: 1px solid #a5b4fc;
}

.subscription-badge-pro {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: 1px solid #4338ca;
}

.subscription-badge-warning {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #f87171;
}

.subscription-badge-warning:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    text-decoration: none;
}

.subscription-badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.subscription-badge-inactive:hover {
    background: #e5e7eb;
    color: #4b5563;
    text-decoration: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .subscription-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .subscription-badge-trial .badge-days {
        font-size: 0.55rem;
    }
}

/* Billing Settings */
.billing-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.billing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.billing-label {
    color: #6b7280;
    font-size: 0.95rem;
}

.billing-value {
    font-weight: 500;
    color: #38405b;
}

.billing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge-info {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #dbeafe;
    color: #1d4ed8;
}

/* ===== DASHBOARD HEADER ===== */
.dashboard-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.dashboard-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #38405b;
    margin: 0;
    letter-spacing: -0.02em;
}

.dashboard-header .item-count {
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4b5563;
    margin: 0 0 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0;
    max-width: 300px;
}

/* ===== BOOKMARK CARD REDESIGN ===== */
.bookmark-card {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.bookmark-card:hover {
    background: #fff;
    border-color: #d3dbe9;
    box-shadow: 0 3px 4px 0 #e1e9f8;
}

.bookmark-card-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.bookmark-card-select {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.bookmark-card:hover .bookmark-card-select,
.bookmark-card-select:has(.bookmark-select-checkbox:checked) {
    opacity: 1;
}

.bookmark-card-favicon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.bookmark-card-favicon .favicon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.bookmark-card-favicon .favicon-fallback {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.bookmark-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bookmark-card-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #38405b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-card-title a {
    color: #38405b;
    text-decoration: none;
}

.bookmark-card-title a:hover {
    color: #5a7a8a;
}

.bookmark-card-title ion-icon {
    font-size: 0.85rem;
    color: #9ca3af;
    position: relative;
    top: 1px;
    margin-left: 0.25rem;
}

.bookmark-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.5;
}

.bookmark-card-meta span {
    white-space: nowrap;
}

.bookmark-card-meta span + span::before {
    content: "\00b7";
    margin: 0 0.4rem;
    color: #d1d5db;
    font-weight: 700;
}

.bookmark-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.2rem;
}

.bookmark-card-tags .tag {
    padding: 0.15rem 0.4rem;
    font-size: 0.55rem;
    border-radius: 3px;
    margin: 0;
}

/* Favorite button */
.bookmark-card-fav {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    font-size: 1.1rem;
    padding: 0.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition:
        opacity 0.15s ease,
        color 0.15s ease;
}

.bookmark-card:hover .bookmark-card-fav,
.bookmark-card-fav.favorited {
    opacity: 1;
}

.bookmark-card-fav:hover {
    color: #ef4444;
}

.bookmark-card-fav.favorited {
    color: #ef4444;
}

.bookmark-card-fav.favorited ion-icon {
    --ionicon-stroke-width: 48px;
}

/* Mobile adjustments for bookmark cards */
@media screen and (max-width: 768px) {
    .bookmark-card {
        padding: 0.5rem 0.25rem;
    }

    .bookmark-card-inner {
        gap: 0.5rem;
    }

    .bookmark-card-select {
        display: none;
    }

    .bookmark-card-fav:not(.favorited) {
        display: none;
    }

    .bookmark-card-favicon {
        display: none;
    }

    .view-toggle {
        display: none;
    }

    .token-search-input {
        font-size: 16px;
    }

    .bookmark-card-title {
        font-size: 0.9rem;
    }

    .bookmark-card-meta {
        font-size: 0.75rem;
    }

    .dashboard-header h2 {
        font-size: 1.4rem;
    }
}

/* ===== DASHBOARD PAGINATION ===== */
.dashboard-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    padding: 0.5rem 0;
}

.dash-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.dash-page-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1f2937;
}

.dash-page-btn ion-icon {
    font-size: 0.9rem;
}

.dash-page-info {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
    padding: 0 0.5rem;
    min-width: 3rem;
    text-align: center;
}

/* HTMX sidebar navigation transition */
#main-content-area.htmx-swapping {
    opacity: 0;
    transition: opacity 0.1s ease-in-out;
}
