/* HYPERSTITION READER V13.0 - STYLES */

:root {
    --bg-body: #050505;
    --bg-panel: #0a0a0a;
    --bg-card: #111111;
    --bg-hover: #1a1a1a;
    --border-subtle: #2a2a2a;
    --border-active: #444444;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --text-dim: #555555;
    --accent-primary: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --accent-secondary: #10b981;
    --accent-alert: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-vault: #0ea5e9;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', system-ui, sans-serif;
    --header-height: 56px;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--border-active) var(--bg-body); }

body {
    margin: 0; padding: 0; background-color: var(--bg-body); color: var(--text-main);
    font-family: var(--font-sans); overflow: hidden; height: 100vh;
    display: flex; flex-direction: column; font-size: 14px;
}

/* --- Header --- */
header {
    border-bottom: 1px solid var(--border-subtle); padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(5, 5, 5, 0.9); backdrop-filter: blur(12px); z-index: 1000;
    height: var(--header-height);
}

.header-left {
    display: flex; align-items: center; gap: 16px;
}

.logo-link {
    text-decoration: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}

h1 {
    font-size: 0.9rem; margin: 0; letter-spacing: 0.5px;
    font-weight: 600; color: var(--text-main);
    transition: color 0.2s;
}
h1 span.accent { color: var(--accent-primary); }
.logo-link:hover h1 { color: var(--accent-primary); }

.tagline {
    font-size: 0.7rem; color: var(--text-dim); font-style: italic;
    border-left: 1px solid var(--border-subtle);
    padding-left: 16px; margin-left: 8px;
}

.version-badge {
    font-family: var(--font-mono); font-size: 0.6rem;
    background: var(--bg-hover); border: 1px solid var(--border-subtle);
    padding: 2px 6px; border-radius: 4px; color: var(--text-muted); margin-left: 8px;
}

.beta-badge {
    font-family: var(--font-mono); font-size: 0.55rem;
    background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 2px 6px; border-radius: 4px; color: var(--accent-alert);
    margin-left: 4px; text-transform: uppercase; letter-spacing: 1px;
}

.about-link {
    font-size: 0.7rem; color: var(--text-muted); text-decoration: none;
    margin-left: 12px; transition: color 0.2s;
}
.about-link:hover { color: var(--accent-primary); }

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

/* Time Filter Buttons */
.time-filters {
    display: flex; gap: 4px; margin-right: 12px;
    border-right: 1px solid var(--border-subtle);
    padding-right: 12px;
}

.time-btn {
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-muted); font-family: var(--font-mono);
    padding: 4px 8px; cursor: pointer; border-radius: 4px;
    font-size: 0.65rem; transition: all 0.2s; font-weight: 500;
}
.time-btn:hover { border-color: var(--text-muted); color: var(--text-main); background: var(--bg-hover); }
.time-btn.active { background: var(--accent-glow); color: var(--accent-primary); border-color: var(--accent-primary); }

.time-btn.dice-btn {
    font-size: 0.8rem; padding: 4px 10px;
}

.search-group { display: flex; gap: 8px; }
input.search-bar {
    background: var(--bg-panel); border: 1px solid var(--border-subtle);
    color: var(--text-main); font-family: var(--font-sans);
    padding: 6px 12px; font-size: 0.85rem; border-radius: 6px;
    transition: all 0.2s; width: 200px;
}
input.search-bar:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-glow); }
input.search-bar.author-search { border-color: #2a2a2a; border-style: dashed; }
input.search-bar.author-search:focus { border-color: var(--accent-purple); border-style: solid; box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15); }
input.search-bar.author-search.highlight-pulse {
    animation: authorPulse 1s ease-in-out 3;
}

@keyframes authorPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15); }
    50% { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.3); border-color: var(--accent-purple); }
}

button.filter-btn {
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-muted); font-family: var(--font-mono);
    padding: 6px 12px; cursor: pointer; border-radius: 6px;
    font-size: 0.7rem; transition: all 0.2s; font-weight: 500;
}
button.filter-btn:hover { border-color: var(--text-muted); color: var(--text-main); background: var(--bg-hover); }
button.filter-btn.active { background: var(--accent-glow); color: var(--accent-primary); border-color: var(--accent-primary); }

/* Neuro Toggle Switch */
.neuro-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.neuro-toggle-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.neuro-toggle.active .neuro-toggle-label {
    color: var(--accent-primary);
}

.neuro-toggle-track {
    width: 36px;
    height: 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
    position: relative;
    transition: all 0.2s;
}

.neuro-toggle.active .neuro-toggle-track {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
}

.neuro-toggle-thumb {
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: all 0.2s;
}

.neuro-toggle.active .neuro-toggle-thumb {
    left: 19px;
    background: var(--accent-primary);
}

.vault-btn {
    background: rgba(14, 165, 233, 0.1) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: var(--accent-vault) !important;
}
.vault-btn:hover {
    background: rgba(14, 165, 233, 0.2) !important;
    border-color: var(--accent-vault) !important;
}

/* --- Tabs --- */
.tabs {
    display: flex; border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-body); user-select: none; padding: 0 24px;
    position: relative;
    justify-content: flex-start;
    gap: 0;
    min-height: 50px;
    z-index: 1000;
}
.tab {
    padding: 12px 20px; cursor: pointer; font-size: 0.75rem;
    font-weight: 500; color: var(--text-muted);
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab:hover { color: var(--text-main); }
.tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

/* Push followed authors to far right */
.tab[data-target="following"] {
    margin-left: auto;
}

/* Epic centered vault logo */
.tab.vault-tab {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vault-logo-img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 4px 20px rgba(14, 165, 233, 0.4));
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab.vault-tab:hover {
    transform: translateX(-50%) translateY(-12px) scale(1.08);
}

.tab.vault-tab:hover .vault-logo-img {
    filter: drop-shadow(0 8px 30px rgba(14, 165, 233, 0.6)) drop-shadow(0 0 60px rgba(14, 165, 233, 0.5));
}

.tab.vault-tab.active .vault-logo-img {
    filter: drop-shadow(0 6px 25px rgba(14, 165, 233, 0.7)) drop-shadow(0 0 50px rgba(14, 165, 233, 0.6)) brightness(1.2);
    outline: 2px solid rgba(14, 165, 233, 0.6);
    outline-offset: 4px;
    border-radius: 4px;
}
.shortcut-hint { opacity: 0.3; font-size: 0.6rem; margin-left: 4px; font-family: var(--font-mono); }

/* Pulsing tab animation for attention */
.tab.pulse-attention {
    animation: tabPulse 2s ease-in-out infinite;
}

@keyframes tabPulse {
    0%, 100% {
        border-bottom: 2px solid transparent;
    }
    50% {
        border-bottom: 2px solid var(--accent-primary);
        color: var(--accent-primary);
    }
}

/* --- Main Layout --- */
main { flex: 1; overflow-y: hidden; position: relative; outline: none; }
.feed-container { display: none; height: 100%; grid-template-columns: repeat(3, 1fr); }
.feed-container.active { display: grid; }
#search-container { display: none; height: 100%; overflow-y: auto; padding: 0; }
#search-container.active { display: block; }

/* Search Controls Bar */
.search-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-controls-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-bar-main {
    width: 220px;
}

.search-year-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-right: 8px;
}

.year-filter-btn {
    padding: 5px 10px;
    font-size: 0.65rem;
}

/* --- Home/Landing Page --- */
#home-container {
    display: none; height: 100%; overflow-y: auto;
    background: linear-gradient(180deg, var(--bg-body) 0%, #080810 100%);
    padding-bottom: 60px;
}
#home-container.active { display: block; }

/* Ensure home container scrolls properly */
#home-container::-webkit-scrollbar { width: 8px; }
#home-container::-webkit-scrollbar-track { background: var(--bg-body); }
#home-container::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 4px; }

.home-content {
    max-width: 1100px; margin: 0 auto; padding: 30px 40px;
}

.home-hero {
    text-align: center; margin-bottom: 24px;
}

/* Large logo on landing page */
.hero-logo {
    font-size: 2.8rem; font-weight: 700; margin: 0 0 12px 0;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--accent-primary) 50%, var(--accent-vault) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-logo .accent {
    color: var(--accent-primary);
}

.hero-tagline {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.5px;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Diagonal staggered layout for steps */
.home-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
    align-items: start;
}

.step-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: 12px; padding: 20px 24px; position: relative;
    transition: all 0.3s; overflow: hidden;
}

/* Diagonal stagger effect */
.step-card:nth-child(1) { grid-column: 1; }
.step-card:nth-child(2) { grid-column: 2; margin-top: 30px; }
.step-card:nth-child(3) { grid-column: 3; margin-top: 60px; }

.step-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--accent-primary);
    font-weight: 700;
    flex-shrink: 0;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.1rem;
    margin: 0 0 12px 0;
    color: var(--text-main);
    font-weight: 600;
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    font-size: 0.9rem;
}

/* Other features section */
.home-features-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-subtle);
}

.home-features-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--accent-primary);
}

.feature-card-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.feature-card-title {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 8px;
}

.feature-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.step-shortcuts {
    display: none; /* Hidden - removing shortcut tags from home */
}

.shortcut-tag {
    display: none; /* Hidden */
}

.vault-highlight {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-vault);
    border-color: rgba(14, 165, 233, 0.3);
}

.home-features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-top: 20px;
}

.feature-chip {
    background: var(--bg-panel); border: 1px solid var(--border-subtle);
    border-radius: 8px; padding: 16px; text-align: center;
}

.feature-chip .icon { font-size: 1.5rem; margin-bottom: 8px; }
.feature-chip .label { font-size: 0.8rem; color: var(--text-muted); }

/* --- Authors Following Tab --- */
#following-container {
    display: none; height: 100%; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
}
#following-container.active { display: flex; }

#following-container::-webkit-scrollbar { height: 8px; }
#following-container::-webkit-scrollbar-track { background: var(--bg-body); }
#following-container::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 4px; }

.following-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; width: 100%;
    color: var(--text-muted); text-align: center; padding: 40px;
}

.following-empty h3 { margin: 0 0 12px 0; color: var(--text-main); }
.following-empty p { margin: 0 0 24px 0; max-width: 400px; line-height: 1.6; }

.author-column {
    min-width: 350px; max-width: 450px; flex-shrink: 0;
}

.author-column-header {
    position: relative;
}

.author-column-header .unfollow-btn {
    background: transparent; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 1rem; transition: color 0.2s;
    margin-left: auto;
}
.author-column-header .unfollow-btn:hover { color: var(--accent-alert); }

.author-column-papers {
    flex: 1; overflow-y: auto; padding: 0;
}

/* --- Feed Columns --- */
.feed-column {
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto; height: 100%; padding: 0;
    scroll-behavior: auto; position: relative;
}
.feed-header {
    position: sticky; top: 0; background: rgba(5,5,5,0.95); padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle); backdrop-filter: blur(4px); z-index: 10;
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    display: flex; justify-content: space-between; align-items: center;
}

/* --- Articles --- */
.article {
    padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s; position: relative; border-left: 3px solid transparent;
}
.article:hover { background: var(--bg-hover); }
.article.expanded { background: #131313; border-left: 3px solid var(--accent-primary); }
.article.keyboard-focused { border-left: 3px solid var(--accent-purple); background: var(--bg-hover); }

.meta-row {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: 6px; font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
}
.meta-journal { color: var(--text-dim); font-weight: 600; text-transform: uppercase; }

.title {
    font-size: 0.95rem; line-height: 1.4; color: var(--text-main);
    cursor: pointer; font-weight: 500; margin-bottom: 6px;
}
.article:hover .title { color: #fff; }
.article.expanded .title { color: var(--accent-primary); }

.authors {
    font-size: 0.8rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.author-link {
    cursor: pointer; color: var(--text-muted); transition: color 0.2s;
    text-decoration: none; border-bottom: 1px dotted transparent;
}
.author-link:hover { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

.abstract-container { display: none; margin-top: 16px; animation: fadeIn 0.3s ease; }
.article.expanded .abstract-container { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.concept-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.concept-chip {
    font-size: 0.65rem; font-family: var(--font-mono); padding: 3px 8px;
    background: rgba(139, 92, 246, 0.1); color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 12px;
    cursor: pointer; transition: all 0.2s;
}
.concept-chip:hover { background: rgba(139, 92, 246, 0.2); }

/* Abstract Clamping & Button */
.abstract-text {
    font-size: 0.9rem; line-height: 1.6; color: #ccc;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.abstract-text.full { -webkit-line-clamp: unset; display: block; }

.abstract-wrapper {
    padding: 16px; background: var(--bg-panel); border-radius: 6px;
    border: 1px solid var(--border-subtle); margin-bottom: 16px; text-align: left;
}
.btn-read-more {
    display: inline-block; margin-top: 8px; font-size: 0.7rem;
    color: var(--accent-primary); cursor: pointer; font-weight: 600;
}

.actions { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.btn-action {
    flex: 1; padding: 8px 12px; font-size: 0.7rem; font-family: var(--font-mono);
    cursor: pointer; border: 1px solid var(--border-subtle); background: var(--bg-body);
    color: var(--text-muted); text-align: center; border-radius: 6px; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    text-decoration: none;
}
.btn-action:hover { background: var(--bg-hover); color: var(--text-main); }
.btn-action.active { background: var(--accent-glow); color: var(--accent-primary); border-color: var(--accent-primary); }
.btn-pdf { border-color: rgba(239, 68, 68, 0.3); color: var(--accent-alert); }
.btn-pdf:hover { background: rgba(239, 68, 68, 0.1); }

/* Flash animation for refs/cited buttons to guide users to vault */
.btn-action.flash-vault-hint {
    animation: flashVaultHint 1.5s ease-in-out infinite;
    position: relative;
}

@keyframes flashVaultHint {
    0%, 100% {
        border-color: var(--border-subtle);
        box-shadow: none;
    }
    50% {
        border-color: var(--accent-vault);
        box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
    }
}

/* Vault hint tooltip */
.vault-hint-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--accent-vault);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.7rem;
    color: var(--accent-vault);
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: tooltipFadeIn 0.3s ease;
}

.vault-hint-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--accent-vault);
}

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

/* Open link button - underlined text with arrow */
.btn-open-link { text-decoration: underline; text-underline-offset: 2px; }
.btn-open-link:hover { text-decoration: underline; }

/* Blue vault open button */
.btn-open-vault {
    background: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
    color: var(--accent-vault) !important;
}
.btn-open-vault:hover {
    background: rgba(14, 165, 233, 0.25) !important;
    border-color: var(--accent-vault) !important;
}

/* Network Lists */
.network-panel {
    display: none; background: var(--bg-panel);
    border: 1px solid var(--border-subtle); border-radius: 6px;
    margin-bottom: 12px; padding: 4px;
}
.network-panel.active { display: block; }

.network-sort-bar {
    display: flex; gap: 8px; padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-body);
}

.sort-btn {
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-muted); font-family: var(--font-mono);
    padding: 4px 10px; cursor: pointer; border-radius: 4px;
    font-size: 0.65rem; transition: all 0.2s;
    display: flex; align-items: center; gap: 4px;
}
.sort-btn:hover { border-color: var(--text-muted); color: var(--text-main); }
.sort-btn.active { background: var(--accent-glow); color: var(--accent-primary); border-color: var(--accent-primary); }

.sort-arrow { font-size: 0.7rem; }

.network-list { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; }

.network-item {
    padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem;
    display: flex; flex-direction: column; gap: 3px; cursor: pointer;
    transition: all 0.15s; border-radius: 4px; margin: 2px; position: relative;
}
.network-item:hover { background: var(--bg-hover); }
.network-item-title { font-weight: 500; color: var(--text-main); }
.network-item:hover .network-item-title { color: var(--accent-primary); }
.network-item-meta {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim);
    display: flex; flex-wrap: wrap; gap: 8px;
}

/* In Vault Badge */
.network-item.in-vault {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    order: -1;
}
.network-item.in-vault .network-item-title { color: var(--accent-vault); }
.in-vault-badge {
    position: absolute; top: 8px; right: 8px;
    font-size: 0.6rem; font-family: var(--font-mono);
    background: rgba(14, 165, 233, 0.2);
    color: var(--accent-vault);
    padding: 2px 6px; border-radius: 3px;
}

.load-more-btn {
    width: 100%; padding: 12px; background: var(--bg-hover); border: none;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted); font-family: var(--font-mono); font-size: 0.7rem; cursor: pointer;
}
.load-more-btn:hover { background: #222; color: var(--text-main); }

/* Author Overlay */
#author-overlay {
    position: fixed; top: var(--header-height); right: -600px; bottom: 0; width: 550px;
    background: var(--bg-panel); border-left: 1px solid var(--border-subtle); z-index: 2200;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.6);
}
#author-overlay.open { right: 0; }
.author-header { padding: 24px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-body); }

.author-name { font-size: 1.3rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.author-inst { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.author-stats {
    display: flex; gap: 12px; margin-top: 12px; font-family: var(--font-mono);
    font-size: 0.7rem; color: var(--accent-primary); background: var(--bg-hover);
    padding: 8px 12px; border-radius: 4px; border: 1px solid var(--border-subtle);
    width: fit-content;
}

.author-content { flex: 1; overflow-y: auto; padding: 0; }
.author-result-card {
    padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.author-result-card:hover { background: var(--bg-hover); }

/* Author Search Results - Improved Layout */
.author-search-results {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.author-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--bg-card);
    transition: border-color 0.2s;
}
.author-search-row:hover {
    border-color: var(--accent-primary);
}

.author-search-info {
    cursor: pointer;
}
.author-search-info:hover h3 {
    color: var(--accent-primary);
}

.author-search-highlights {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 1px solid var(--border-subtle);
    padding-left: 20px;
}

.highlights-loading, .no-highlights {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-style: italic;
}

.highlight-paper {
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.highlight-paper:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.highlight-title {
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 4px;
}

.highlight-meta {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

/* --- VAULT MODE (formerly Drill) --- */
#vault-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #050505; z-index: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
    display: flex; flex-direction: column;
    padding-top: calc(var(--header-height) + 50px); /* Account for header + tabs */
}
#vault-overlay.active { opacity: 1; pointer-events: auto; }

/* Vault Blue Stripe */
.vault-stripe {
    height: 4px; background: linear-gradient(90deg, var(--accent-vault), var(--accent-primary), var(--accent-vault));
    background-size: 200% 100%;
    animation: vaultStripeShimmer 2s linear infinite;
}

@keyframes vaultStripeShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Vault Loading Animation - DISABLED */
.vault-loading-overlay {
    display: none !important;
}

.vault-door-container {
    position: relative; width: 400px; height: 250px;
    display: flex; overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(14, 165, 233, 0.5), 0 0 120px rgba(14, 165, 233, 0.3);
}

.vault-door {
    width: 50%; height: 100%;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    border: 4px solid #38bdf8;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 3rem; color: white;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

.vault-door-left {
    border-radius: 16px 0 0 16px;
    border-right: 2px solid #38bdf8;
    animation: vaultSlideLeft 0.8s ease-out forwards;
}

.vault-door-right {
    border-radius: 0 16px 16px 0;
    border-left: 2px solid #38bdf8;
    animation: vaultSlideRight 0.8s ease-out forwards;
}

@keyframes vaultSlideLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-110%); }
}

@keyframes vaultSlideRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(110%); }
}

.vault-loading-text {
    margin-top: 32px; font-family: var(--font-mono); font-size: 1rem;
    color: #38bdf8; letter-spacing: 3px; font-weight: 600;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.vault-controls-bar {
    position: absolute;
    top: calc(var(--header-height) + 50px);
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.reorder-btn, .vault-export-btn {
    background: rgba(14, 165, 233, 0.1) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: var(--accent-vault) !important;
}
.reorder-btn:hover, .vault-export-btn:hover {
    background: rgba(14, 165, 233, 0.2) !important;
    border-color: var(--accent-vault) !important;
}

/* Vault Card Tabs */
.vault-card-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #0e0e0e;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}

/* Vault Sort Bar */
.vault-sort-bar {
    display: flex;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-subtle);
}

/* Traffic Lane Connections Bar */
.vault-connections-bar {
    width: 100%;
    padding: 10px 24px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    min-height: 90px;
}

.traffic-lanes-svg {
    display: block;
}

.vault-viewport {
    flex: 1; overflow: hidden; position: relative; perspective: 1000px;
    background-image: radial-gradient(#1a1a1a 1px, transparent 1px); background-size: 30px 30px;
    display: flex; align-items: flex-start;
    padding-top: 30px;
}

.vault-stack-wrapper {
    position: relative; min-height: calc(85vh + 40px); width: max-content;
    display: flex; align-items: flex-start; justify-content: flex-start;
    padding-left: 50px; padding-top: 20px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Vault Card - Open State */
.vault-card {
    position: absolute;
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column; overflow: hidden;
}

.vault-card-open {
    width: 550px; max-width: 90vw;
    height: calc(75vh - 40px); /* Further reduced to prevent cutoff */
    max-height: calc(100vh - 280px);
}

/* Vault Card Header Bar - top bar with number in center */
.vault-card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(180deg, #1a1a2e 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

/* Number badge on open card - centered in header bar */
.open-card-number {
    width: 40px;
    height: 40px;
    background: var(--accent-vault);
    color: #050505;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.4);
}

/* Open link in header bar */
.vault-card-open-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}
.vault-card-open-link:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

/* Vault Card - Spine State - Redesigned per PNG inspiration */
.vault-card-spine {
    width: auto;
    min-width: 80px;
    max-width: 150px;
    height: calc(75vh - 40px);
    max-height: calc(100vh - 260px);
    background: linear-gradient(180deg, #0a0a14 0%, #0d1220 100%);
    border: 2px solid var(--accent-vault);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.vault-card-spine:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
    transform: scale(1.02);
}

/* Spine Number at Top - Dark background */
.spine-number {
    width: 36px;
    height: 36px;
    background: #0a0a14;
    border: 2px solid var(--accent-vault);
    color: var(--accent-vault);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-bottom: 12px;
}

/* Spine Meta Section - Horizontal text below number */
.spine-meta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 16px;
    flex-shrink: 0;
    text-align: center;
    width: 100%;
    padding: 0 2px;
}

.spine-author {
    color: var(--accent-vault);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-align: center;
    max-width: 100%;
    line-height: 1.2;
}

.spine-year {
    color: var(--accent-vault);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.75rem;
}

.spine-journal {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: lowercase;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-align: center;
    max-width: 100%;
    line-height: 1.2;
}

/* Spine Title Section - Vertical text */
.spine-title-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 4px 0;
}

.spine-title-line {
    color: var(--accent-vault);
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

/* Legacy spine-meta and spine-content for backward compatibility */
.spine-meta {
    display: none;
}

.spine-content {
    display: none;
}

/* Spine Remove Button */
.spine-remove {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--accent-alert);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.vault-card-spine:hover .spine-remove {
    opacity: 1;
}

.spine-remove:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Vault Card Remove Button */
.vault-card-remove {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-alert); width: 28px; height: 28px;
    border-radius: 6px; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.vault-card-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Vault Card Minimize Button */
.vault-card-minimize {
    background: rgba(14, 165, 233, 0.1); border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--accent-vault); width: 28px; height: 28px;
    border-radius: 6px; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    margin-right: 8px;
}
.vault-card-minimize:hover {
    background: rgba(14, 165, 233, 0.2);
    transform: scale(1.1);
}

/* Vault Card Slide Out Animation */
.vault-card.removing {
    animation: slideOutDown 0.4s ease-in forwards;
}

@keyframes slideOutDown {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) scale(0.8); opacity: 0; }
}

.vault-card-header {
    padding: 24px; cursor: pointer; background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
    position: relative;
}
.vault-card-body { flex: 1; overflow-y: auto; padding: 0 0 20px 0; background: #0e0e0e; }
.vault-card-content-inner { padding: 24px; }

/* Connection arrows - now rendered in top bar, keeping minimal styling for reference */
.vault-connection-arrow {
    display: none; /* Moved to connections bar */
}

/* --- Vault Panel (Sidebar) - REMOVED --- */
/* Vault panel sidebar has been removed - vault is now accessed directly */

/* Export Dropdown */
.export-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--accent-vault);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(14, 165, 233, 0.2);
    z-index: 3000;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

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

.export-option {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-subtle);
}

.export-option:last-child {
    border-bottom: none;
}

.export-option:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-vault);
}

.export-icon {
    font-size: 1.1rem;
}

/* Shuffle Animation */
.vault-stack-wrapper.shuffling .vault-card {
    pointer-events: none;
}

.shuffle-out {
    animation: shuffleOut 0.3s ease-in forwards;
}

@keyframes shuffleOut {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* Email Modal */
.email-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8); z-index: 3000;
    display: none; align-items: center; justify-content: center;
}
.email-modal-overlay.active { display: flex; }

.email-modal {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: 12px; padding: 32px; max-width: 450px; width: 90%;
}

.email-modal h3 { margin: 0 0 8px 0; color: var(--text-main); }
.email-modal p { margin: 0 0 20px 0; color: var(--text-muted); font-size: 0.9rem; }

.email-modal input {
    width: 100%; padding: 12px 16px; background: var(--bg-panel);
    border: 1px solid var(--border-subtle); border-radius: 6px;
    color: var(--text-main); font-size: 0.9rem; margin-bottom: 16px;
}
.email-modal input:focus { outline: none; border-color: var(--accent-primary); }

.email-modal-actions {
    display: flex; gap: 12px; justify-content: flex-end;
}

.email-modal-btn {
    padding: 10px 20px; border-radius: 6px; font-family: var(--font-mono);
    font-size: 0.75rem; cursor: pointer; transition: all 0.2s;
}

.email-modal-btn.secondary {
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}
.email-modal-btn.secondary:hover { background: var(--bg-hover); color: var(--text-main); }

.email-modal-btn.primary {
    background: var(--accent-primary); border: 1px solid var(--accent-primary);
    color: white;
}
.email-modal-btn.primary:hover { background: #2563eb; }

/* About Modal */
.about-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8); z-index: 3000;
    display: none; align-items: center; justify-content: center;
}
.about-modal-overlay.active { display: flex; }

.about-modal {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: 12px; padding: 32px; max-width: 500px; width: 90%;
}

.about-modal h3 { margin: 0 0 16px 0; color: var(--text-main); }
.about-modal p { margin: 0 0 12px 0; color: var(--text-muted); line-height: 1.6; font-size: 0.9rem; }
.about-modal .close-btn {
    margin-top: 20px; width: 100%;
}

/* Helpers */
.author-trunc { color: var(--text-dim); cursor: default; }

/* Expandable author list */
.author-expand {
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}
.author-expand:hover {
    color: var(--accent-primary);
}
.author-collapse {
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.75em;
    margin-left: 4px;
    transition: color 0.2s;
}
.author-collapse:hover {
    color: var(--accent-primary);
}
.authors-expanded {
    white-space: normal;
}
.loader { text-align: center; padding: 24px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.error-msg { text-align: center; padding: 20px; color: var(--accent-alert); font-family: var(--font-mono); font-size: 0.75rem; }

/* Infinite scroll sentinel */
.scroll-sentinel {
    height: 1px; width: 100%;
}

/* Loading more indicator */
.loading-more-indicator {
    text-align: center;
    padding: 16px;
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Vault Connections Scale (deprecated) --- */
.vault-connections-scale {
    display: none; /* No longer used - traffic lanes SVG replaces this */
}

/* Preview tooltip removed per user request */
