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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #202124;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme {
    background-color: #202124;
    color: #e8eaed;
}

/* Sign-in Page */
.signin-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-theme .signin-page {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.signin-container {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 450px;
    width: 90%;
}

body.dark-theme .signin-container {
    background: rgba(32, 33, 36, 0.95);
}

.logo-large {
    font-family: 'Poppins', sans-serif;
    font-size: 72px;
    font-weight: 700;
    color: #202124;
    margin-bottom: 16px;
    letter-spacing: -1px;
    user-select: none;
}

body.dark-theme .logo-large {
    color: #ffffff;
}

.logo-large .first-letter {
    font-size: 80px;
    color: #667eea;
}

body.dark-theme .logo-large .first-letter {
    color: #8ab4f8;
}

.signin-description {
    font-size: 16px;
    color: #5f6368;
    margin-bottom: 40px;
    line-height: 1.5;
}

body.dark-theme .signin-description {
    color: #9aa0a6;
}

.google-signin-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.google-signin-button:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-color: #d2d3d4;
}

body.dark-theme .google-signin-button {
    background: #3c4043;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark-theme .google-signin-button:hover {
    background: #4a4d50;
    border-color: #70757a;
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .signin-container {
        padding: 40px 24px;
    }
    
    .logo-large {
        font-size: 56px;
    }
    
    .logo-large .first-letter {
        font-size: 62px;
    }
    
    .signin-description {
        font-size: 14px;
    }
}

/* Main App */
.main-app {
    display: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Profile Menu */
.button-container {
    display: contents;
}

.profile-menu-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.profile-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.profile-button:hover {
    transform: scale(1.05);
}

.profile-button:active {
    transform: scale(0.95);
}

.profile-avatar-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.dark-theme .profile-avatar-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    display: block;
}

.dark-theme .profile-avatar {
    border-color: #202124;
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

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

.dark-theme .profile-dropdown {
    background: #292a2d;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.profile-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8eaed;
}

.dark-theme .profile-avatar-large {
    border-color: #3c4043;
}

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

.profile-name {
    font-weight: 500;
    font-size: 14px;
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark-theme .profile-name {
    color: #e8eaed;
}

.profile-email {
    font-size: 12px;
    color: #5f6368;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.dark-theme .profile-email {
    color: #9aa0a6;
}

.profile-dropdown-divider {
    height: 1px;
    background: #e8eaed;
    margin: 4px 0;
}

.dark-theme .profile-dropdown-divider {
    background: #3c4043;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
    font-size: 14px;
    transition: background-color 0.2s;
    text-align: left;
}

.profile-menu-item:hover {
    background-color: #f1f3f4;
}

.dark-theme .profile-menu-item {
    color: #9aa0a6;
}

.dark-theme .profile-menu-item:hover {
    background-color: #3c4043;
}

.profile-menu-item .material-symbols-outlined {
    font-size: 20px;
}

/* Result items (existing styles likely below; appending tooltip styles) */
.meta-info-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    cursor: pointer;
}

.meta-info-icon {
    font-size: 18px;
    color: #5f6368;
    vertical-align: middle;
}

.meta-info-wrapper:hover .meta-info-icon {
    color: #1a73e8;
}

.meta-tooltip {
    position: absolute;
    top: 24px;
    right: 0;
    min-width: 380px;
    max-width: 520px;
    max-height: 320px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
    color: #202124;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Custom scrollbar for meta tooltip */
.meta-tooltip::-webkit-scrollbar {
    width: 6px;
}

.meta-tooltip::-webkit-scrollbar-track {
    background: transparent;
}

.meta-tooltip::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.meta-tooltip::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

.dark-theme .meta-tooltip::-webkit-scrollbar-thumb {
    background: #5f6368;
}

.dark-theme .meta-tooltip::-webkit-scrollbar-thumb:hover {
    background: #80868b;
}

.dark-theme .meta-tooltip {
    background: #292a2d;
    color: #e8eaed;
    border-color: #3c4043;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.meta-tooltip.show,
.meta-info-wrapper:hover .meta-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.meta-tooltip-title {
    font-weight: 600;
    font-size: 13px;
}

.meta-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
}

.meta-tooltip-chip {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 18px;
    font-weight: 500;
    background: #eaf1fd;
    color: #1a73e8;
    border: 1px solid #d2e3fc;
}
.dark-theme .meta-tooltip-chip {
    background: #2b2f3a;
    color: #8ab4f8;
    border: 1px solid #3c4043;
}

.meta-tooltip-grid {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 6px 12px;
    margin-bottom: 8px;
}

.meta-row { display: contents; }
.meta-key {
    font-size: 12px;
    color: #5f6368;
    white-space: nowrap;
}
.dark-theme .meta-key { color: #9aa0a6; }
.meta-value {
    font-size: 12px;
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dark-theme .meta-value { color: #e8eaed; }

.meta-copy-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #5f6368;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.meta-copy-btn:hover {
    background-color: #f1f3f4;
    color: #1a73e8;
    opacity: 1;
}

.dark-theme .meta-copy-btn {
    color: #9aa0a6;
}

.dark-theme .meta-copy-btn:hover {
    background-color: #3c4043;
    color: #8ab4f8;
}

.meta-copy-btn .material-symbols-outlined {
    font-size: 16px;
}

.download-embedding-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-embedding-btn:hover {
    background-color: #1557b0;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.download-embedding-btn:active {
    transform: scale(0.98);
}

.dark-theme .download-embedding-btn {
    background-color: #8ab4f8;
    color: #202124;
}

.dark-theme .download-embedding-btn:hover {
    background-color: #aecbfa;
    box-shadow: 0 2px 8px rgba(138, 180, 248, 0.3);
}

.download-embedding-btn .material-symbols-outlined {
    font-size: 18px;
}

.meta-details summary {
    font-size: 12px;
    color: #5f6368;
    cursor: pointer;
    margin-bottom: 6px;
}
.dark-theme .meta-details summary { color: #9aa0a6; }

.meta-empty {
    font-size: 12px;
    color: #5f6368;
    font-style: italic;
}
.dark-theme .meta-empty { color: #9aa0a6; }

.profile-menu-item.stats-item {
    padding: 16px;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.dark-theme .profile-menu-item.stats-item {
    background-color: #2d2e30;
}

.profile-menu-item.stats-item:hover {
    background-color: #e8eaed;
}

.dark-theme .profile-menu-item.stats-item:hover {
    background-color: #3c4043;
}

/* Statistics Modal Styles */
.stats-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stats-label {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

.dark-theme .stats-label {
    color: #9aa0a6;
}

.stats-value {
    font-size: 14px;
    color: #202124;
    font-weight: 600;
}

.dark-theme .stats-value {
    color: #e8eaed;
}

/* Legacy buttons - hidden */
.theme-toggle,
#lockButton {
    display: none !important;
}

.login-button {
    position: absolute;
    top: 20px;
    right: 120px;
    background: #1a73e8;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, box-shadow 0.2s;
    z-index: 1000;
}

.login-button:hover {
    background: #1557b0;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

.dark-theme .login-button {
    background: #8ab4f8;
    color: #202124;
}

.dark-theme .login-button:hover {
    background: #aecbfa;
}

.theme-toggle:hover {
    background-color: rgba(95, 99, 104, 0.1);
}

body.dark-theme .theme-toggle {
    color: #e8eaed;
}

body.dark-theme .theme-toggle:hover {
    background-color: rgba(232, 234, 237, 0.1);
}

.theme-toggle .material-symbols-outlined {
    font-size: 24px;
}

/* Logo */
.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 92px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 30px;
    letter-spacing: -1px;
    user-select: none;
    transition: all 0.3s ease;
}

body.dark-theme .logo {
    color: #ffffff;
}

.logo .first-letter {
    font-size: 100px;
    transition: all 0.3s ease;
}

/* Logo when results are shown - smaller, at top */
.search-area.has-results .logo {
    font-size: 40px;
    margin-bottom: 16px;
}

.search-area.has-results .logo .first-letter {
    font-size: 44px;
}

/* Mobile responsive logo */
@media (max-width: 768px) {
    .logo {
        font-size: 56px;
    }

    .logo .first-letter {
        font-size: 62px;
    }

    .search-area.has-results .logo {
        font-size: 32px;
    }

    .search-area.has-results .logo .first-letter {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 48px;
    }

    .logo .first-letter {
        font-size: 54px;
    }

    .search-area.has-results .logo {
        font-size: 28px;
    }

    .search-area.has-results .logo .first-letter {
        font-size: 32px;
    }
}

/* Logo and search area */
.search-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60vh;
    justify-content: center;
    padding: 20px;
    transition: all 0.4s ease-in-out;
}

.search-area.has-results {
    min-height: auto;
    justify-content: flex-start;
    padding: 20px 20px 30px;
}

/* Search box */
.search-box-wrapper {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s, background-color 0.3s, color 0.3s;
    background-color: #ffffff;
    color: #202124;
}

body.dark-theme .search-box {
    background-color: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

.search-box:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223, 225, 229, 0);
}

body.dark-theme .search-box:hover {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.search-box:focus {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223, 225, 229, 0);
}

body.dark-theme .search-box:focus {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    cursor: pointer;
}

.clear-button {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #70757a;
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
}

.clear-button:hover {
    color: #202124;
}

body.dark-theme .clear-button {
    color: #9aa0a6;
}

body.dark-theme .clear-button:hover {
    color: #e8eaed;
}

.search-box:not(:placeholder-shown) ~ .clear-button {
    display: flex;
}

/* Results info container with download button */
.results-info-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 20px;
}

/* Results info */
.results-info {
    text-align: center;
    color: #70757a;
    font-size: 12px;
}

body.dark-theme .results-info {
    color: #9aa0a6;
}

/* Download query button - tiny icon button */
.download-query-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #5f6368;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.download-query-btn:hover {
    background-color: #f1f3f4;
    color: #1a73e8;
    opacity: 1;
}

.download-query-btn:active {
    transform: scale(0.95);
}

.dark-theme .download-query-btn {
    color: #9aa0a6;
}

.dark-theme .download-query-btn:hover {
    background-color: #3c4043;
    color: #8ab4f8;
}

.download-query-btn .material-symbols-outlined {
    font-size: 16px;
}

/* Results list */
.results {
    max-width: 700px;
    margin: 0 auto;
}

.result-item {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

body.dark-theme .result-item {
    border-bottom-color: #3c4043;
}

.result-item.best-match {
    background-color: #f8f9fa;
    padding: 16px;
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 8px;
}

body.dark-theme .result-item.best-match {
    background-color: #292a2d;
}

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

.result-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.result-icon {
    width: auto;
    height: 100%;
    max-width: 48px;
    flex-shrink: 0;
    align-self: stretch;
}

.contact-photo {
    border-radius: 50%;
    object-fit: cover;
    width: 48px;
    height: 48px;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.result-title {
    color: #1a0dab;
    text-decoration: none;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    transition: text-decoration 0.2s;
}

body.dark-theme .result-title {
    color: #8ab4f8;
}

.result-title:hover {
    text-decoration: underline;
}

.result-title:visited {
    color: #681da8;
}

body.dark-theme .result-title:visited {
    color: #c58af9;
}

.title-with-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.result-score {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

body.dark-theme .result-score {
    background-color: #1e3a2e;
    color: #81c784;
}

.chunk-count {
    background-color: rgba(46, 125, 50, 0.15);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
}

body.dark-theme .chunk-count {
    background-color: rgba(129, 199, 132, 0.2);
}

.result-url {
    color: #006621;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

@media (max-width: 600px) {
    .result-url {
        max-width: 100%;
    }
}

body.dark-theme .result-url {
    color: #9aa0a6;
}

.result-summary {
    color: #4d5156;
    font-size: 14px;
    background-color: #ffffff;
    padding: 12px 16px 10px 16px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #e0e0e0;
    transition: all 0.2s ease;
}

body.dark-theme .result-summary {
    color: #bdc1c6;
    background-color: #1e1e1e;
    border-color: #3c4043;
    border-left-color: #3c4043;
}

.result-summary.collapsible {
    cursor: pointer;
}

.result-summary.collapsible:hover {
    background-color: #f8f9fa;
    border-left-color: #1a73e8;
}

body.dark-theme .result-summary.collapsible {
    background-color: #1e1e1e;
    border-color: #3c4043;
    border-left-color: #3c4043;
}

body.dark-theme .result-summary.collapsible:hover {
    background-color: #2a2a2a;
    border-left-color: #8ab4f8;
}

.result-summary .summary-text {
    display: block;
    white-space: pre-line;
    transition: max-height 0.3s ease;
}

.result-summary .summary-text.collapsed {
    max-height: 3.16em; /* ~2 lines at 1.58 line-height */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Gradient hint for collapsible summaries */
.result-summary.collapsible {
    position: relative;
}

.result-summary.collapsible::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px; /* height of the fade */
    pointer-events: none; /* allow clicks to pass through to toggle */
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Hide gradient when expanded */
.result-summary:not(:has(.summary-text.collapsed))::after {
    opacity: 0;
}

/* Dark theme gradient */
body.dark-theme .result-summary.collapsible::after {
    background: linear-gradient(to bottom, rgba(30,30,30,0), rgba(30,30,30,1));
}

/* Phone numbers */
.phone-numbers {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.phone-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    user-select: none;
}

.phone-number:hover {
    background-color: #c8e6c9;
    transform: translateY(-1px);
}

.phone-number:active {
    transform: translateY(0);
}

body.dark-theme .phone-number {
    background-color: #1e3a2e;
    color: #81c784;
}

body.dark-theme .phone-number:hover {
    background-color: #2d4f3d;
}

.phone-number .material-symbols-outlined {
    font-size: 18px;
}

.phone-text {
    font-weight: 500;
}

/* Email addresses */
.email-addresses {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.email-address {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #e3f2fd;
    color: #1565c0;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    user-select: none;
    text-decoration: none;
}

.email-address:hover {
    background-color: #bbdefb;
    transform: translateY(-1px);
}

.email-address:active {
    transform: translateY(0);
}

body.dark-theme .email-address {
    background-color: #1a2a3a;
    color: #64b5f6;
}

body.dark-theme .email-address:hover {
    background-color: #2a3a4a;
}

.email-address .material-symbols-outlined {
    font-size: 18px;
}

.email-text {
    font-weight: 500;
}

/* Event time */
.event-time {
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #e3f2fd;
    color: #1565c0;
    border-radius: 8px;
    font-size: 14px;
    width: fit-content;
}

body.dark-theme .event-time {
    background-color: #1a2a3a;
    color: #64b5f6;
}

.event-time .material-symbols-outlined {
    font-size: 18px;
}

.event-time-text {
    font-weight: 500;
}

/* Past event badge */
.past-event-badge {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

body.dark-theme .past-event-badge {
    background-color: #3a1f1f;
    color: #ef5350;
}

.past-event-badge .material-symbols-outlined {
    font-size: 16px;
}

/* Event location */
.event-location {
    margin-top: 8px;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #fff3e0;
    color: #e65100;
    border-radius: 16px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.event-location:hover {
    background-color: #ffe0b2;
    transform: translateY(-1px);
}

.event-location:active {
    transform: translateY(0);
}

body.dark-theme .event-location {
    background-color: #3a2e1a;
    color: #ffb74d;
}

body.dark-theme .event-location:hover {
    background-color: #4a3a2a;
}

.event-location .material-symbols-outlined {
    font-size: 18px;
}

.event-location-text {
    font-weight: 500;
}

/* Gmail metadata */
.gmail-metadata {
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gmail-from {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 16px;
    font-size: 13px;
}

body.dark-theme .gmail-from {
    background-color: #1a3a1f;
    color: #81c784;
}

.gmail-from .material-symbols-outlined {
    font-size: 16px;
}

.gmail-from-text {
    font-weight: 500;
}

.gmail-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #fff3e0;
    color: #e65100;
    border-radius: 16px;
    font-size: 13px;
}

body.dark-theme .gmail-date {
    background-color: #3a2e1a;
    color: #ffb74d;
}

.gmail-date .material-symbols-outlined {
    font-size: 16px;
}

.gmail-date-text {
    font-weight: 500;
}

/* Google Drive tags (path/folder) */
.gdrive-tags {
    margin: 8px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gdrive-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1;
    user-select: none;
    max-width: 100%;
    text-decoration: none;
}

.gdrive-tag-folder {
    background-color: #e3f2fd;
    color: #1565c0;
}

.gdrive-tag-path {
    background-color: #f1f3f4;
    color: #5f6368;
}

.gdrive-tag-path:hover { filter: brightness(0.97); }

body.dark-theme .gdrive-tag-folder {
    background-color: #1a2a3a;
    color: #64b5f6;
}

body.dark-theme .gdrive-tag-path {
    background-color: #3c4043;
    color: #e8eaed;
}

body.dark-theme .gdrive-tag-path:hover { filter: brightness(1.05); }

.gdrive-tag .material-symbols-outlined {
    font-size: 16px;
}

.gdrive-path-text {
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .gdrive-path-text { max-width: 260px; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #70757a;
}

body.dark-theme .empty-state {
    color: #9aa0a6;
}

.empty-state .material-symbols-outlined {
    font-size: 4em;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 1.2em;
    font-weight: 400;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9em;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #70757a;
}

body.dark-theme .loading {
    color: #9aa0a6;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

body.dark-theme .spinner {
    border-color: #3c4043;
    border-top-color: #8ab4f8;
}

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

/* Error state */
.error-message {
    max-width: 600px;
    margin: 20px auto;
    padding: 16px;
    background-color: #fef7f7;
    border-left: 4px solid #d93025;
    border-radius: 4px;
    color: #c5221f;
}

body.dark-theme .error-message {
    background-color: #3c2626;
    border-left-color: #f28b82;
    color: #f28b82;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 40px 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.pagination button {
    padding: 10px 16px;
    border: 1px solid #dfe1e5;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
    color: #667eea;
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s;
    min-width: 40px;
}

body.dark-theme .pagination button {
    background-color: #303134;
    border-color: #5f6368;
    color: #8ab4f8;
}

.pagination button:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #dadce0;
}

body.dark-theme .pagination button:hover:not(:disabled) {
    background-color: #3c4043;
    border-color: #5f6368;
}

.pagination button:disabled {
    background-color: #f8f9fa;
    color: #dadce0;
    cursor: not-allowed;
}

body.dark-theme .pagination button:disabled {
    background-color: #303134;
    color: #5f6368;
}

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

body.dark-theme .pagination button.active {
    background-color: #8ab4f8;
    color: #202124;
    border-color: #8ab4f8;
}

.pagination-info {
    color: #70757a;
    margin: 0 10px;
    font-size: 14px;
}

body.dark-theme .pagination-info {
    color: #9aa0a6;
}

/* Mobile pagination adjustments */
@media (max-width: 600px) {
    .pagination {
        gap: 4px;
        padding: 0 5px;
    }

    .pagination button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
    }

    .pagination-info {
        font-size: 12px;
        margin: 0 4px;
    }
}

.hidden {
    display: none;
}

/* Modal styles (shared between passkey and settings) */
.passkey-modal,
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.passkey-modal.hidden,
.settings-modal.hidden {
    display: none !important;
}

.passkey-content,
.settings-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.dark-theme .passkey-content,
body.dark-theme .settings-content {
    background-color: #303134;
}

.passkey-content h2,
.settings-content h2 {
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 400;
}

.passkey-content p,
.settings-content p {
    margin-bottom: 24px;
    color: #5f6368;
    line-height: 1.5;
}

body.dark-theme .passkey-content p,
body.dark-theme .settings-content p {
    color: #9aa0a6;
}

.settings-field {
    margin-bottom: 20px;
}

.settings-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

body.dark-theme .settings-field label {
    color: #e8eaed;
}

.settings-field input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    color: #202124;
}

body.dark-theme .settings-field input {
    background-color: #202124;
    border-color: #5f6368;
    color: #e8eaed;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.settings-actions button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.settings-actions .save-button {
    background-color: #667eea;
    color: white;
}

.settings-actions .save-button:hover {
    background-color: #5568d3;
}

.settings-actions .cancel-button {
    background-color: #f1f3f4;
    color: #202124;
}

.settings-actions .cancel-button:hover {
    background-color: #e8eaed;
}

body.dark-theme .settings-actions .save-button {
    background-color: #8ab4f8;
    color: #202124;
}

body.dark-theme .settings-actions .save-button:hover {
    background-color: #aecbfa;
}

body.dark-theme .settings-actions .cancel-button {
    background-color: #3c4043;
    color: #e8eaed;
}

body.dark-theme .settings-actions .cancel-button:hover {
    background-color: #5f6368;
}

/* Passkey Modal */
.passkey-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.passkey-modal.hidden {
    display: none !important;
}

.passkey-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.dark-theme .passkey-content {
    background-color: #303134;
}

.passkey-content h2 {
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 400;
}

.passkey-content p {
    margin-bottom: 24px;
    color: #5f6368;
    line-height: 1.5;
}

body.dark-theme .passkey-content p {
    color: #9aa0a6;
}

.passkey-button {
    width: 100%;
    padding: 12px 24px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.passkey-button:hover {
    background-color: #5568d3;
}

.passkey-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

body.dark-theme .passkey-button {
    background-color: #8ab4f8;
    color: #202124;
}

body.dark-theme .passkey-button:hover {
    background-color: #aecbfa;
}

.passkey-error {
    margin-top: 16px;
    padding: 12px;
    background-color: #fef7f7;
    border-left: 4px solid #d93025;
    border-radius: 4px;
    color: #c5221f;
    font-size: 14px;
}

body.dark-theme .passkey-error {
    background-color: #3c2626;
    border-left-color: #f28b82;
    color: #f28b82;
}

.passkey-info {
    margin-top: 16px;
    padding: 12px;
    background-color: #e8f5e9;
    border-left: 4px solid #2e7d32;
    border-radius: 4px;
    color: #1b5e20;
    font-size: 14px;
}

body.dark-theme .passkey-info {
    background-color: #1e3a2e;
    border-left-color: #81c784;
    color: #81c784;
}

/* API Key Management Styles */
.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.api-key-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

body.dark-theme .api-key-item {
    background-color: #3c4043;
    border-color: #5f6368;
}

.api-key-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

body.dark-theme .api-key-item:hover {
    border-color: #8ab4f8;
}

.api-key-item.expired {
    opacity: 0.6;
    border-color: #d32f2f;
}

.api-key-delete-btn {
    padding: 8px;
    background-color: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-key-delete-btn:hover {
    background-color: #fee;
    color: #d32f2f;
}

body.dark-theme .api-key-delete-btn {
    color: #9aa0a6;
}

body.dark-theme .api-key-delete-btn:hover {
    background-color: #3c2626;
    color: #f28b82;
}

/* Animation for notifications */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
