/* ============================================
   MYPUBLINK — Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Light base for ALL modes */
    --bg-primary: #fafaf9;
    --bg-secondary: #f5f5f0;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(0, 0, 0, 0.025);
    --bg-glass-hover: rgba(0, 0, 0, 0.05);

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-tertiary: #888888;
    --text-muted: #bbbbbb;

    --accent-1: #2c3e50;
    --accent-2: #34495e;
    --accent-3: #7f8c8d;
    --accent-4: #27ae60;
    --accent-5: #8e44ad;

    --gradient-1: linear-gradient(135deg, #2c3e50, #34495e);
    --gradient-2: linear-gradient(135deg, #2c3e50, #555);
    --gradient-3: linear-gradient(135deg, #27ae60, #2c3e50);

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.1);

    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-glow: none;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Landing page inherits global light vars, no overrides needed */

/* Loading/error screens inherit global light vars */

/* CV Mode — professional, muted accents (same as default) */
body.mode-cv {
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Fun Mode — playful accents, still light background */
body.mode-fun {
    --accent-1: #e74c3c;
    --accent-2: #2ecc71;
    --accent-3: #f39c12;
    --accent-4: #1abc9c;
    --accent-5: #9b59b6;
    --gradient-1: linear-gradient(135deg, #e74c3c, #f39c12);
    --gradient-2: linear-gradient(135deg, #9b59b6, #3498db);
    --gradient-3: linear-gradient(135deg, #2ecc71, #1abc9c);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-slow), color var(--transition-slow);
}

a {
    color: var(--accent-1);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-2);
}

/* --- Screen Management --- */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ============================================
   LANDING SCREEN — Clean, professional, light
   ============================================ */
#landing {
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px;
    background: var(--bg-primary);
}

.landing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.logo-icon {
    font-size: 18px;
}

.hero-title {
    font-size: clamp(28px, 6vw, 44px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.hero-accent {
    color: var(--accent-1);
}

.hero-subtitle {
    font-size: clamp(14px, 3vw, 16px);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Card */
.search-container {
    width: 100%;
}

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-card);
    text-align: left;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.input-group {
    text-align: left;
    margin-bottom: 0;
}

.input-group+.input-group {
    margin-top: 0;
}

.advanced-panel .input-group {
    margin-bottom: 10px;
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    border-color: var(--accent-1);
    background: var(--bg-glass-hover);
}

/* PubMed Hint */
.pubmed-hint {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    overflow: hidden;
}

.pubmed-hint.visible {
    display: flex;
}

.hint-label {
    white-space: nowrap;
    font-weight: 500;
}

.hint-editable {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--border-medium);
    color: var(--accent-1);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    outline: none;
    padding: 2px 4px;
    min-width: 80px;
}

.hint-editable:focus {
    border-bottom-color: var(--accent-1);
}

.hint-edit-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.hint-edit-btn:hover {
    color: var(--accent-1);
}

/* Advanced Toggle */
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 4px;
    transition: color var(--transition-fast);
    width: 100%;
}

.advanced-toggle:hover {
    color: var(--text-secondary);
}

.advanced-toggle svg {
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

.advanced-toggle.open svg {
    transform: rotate(180deg);
}

/* Advanced Panel */
.advanced-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    padding: 0;
}

.advanced-panel.open {
    max-height: 320px;
    opacity: 1;
    padding: 10px 0 6px;
}

.advanced-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
    font-style: italic;
}

/* Search Button */
.search-btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    margin-top: 4px;
}

.search-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.search-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.search-btn.loading .btn-text {
    opacity: 0;
}

.search-btn.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-loader .dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.btn-loader .dot:nth-child(2) {
    animation-delay: 0.16s;
}

.btn-loader .dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.landing-footer {
    margin-top: 32px;
    font-size: 12px;
    color: var(--text-muted);
}

.landing-footer a {
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading {
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
}

.loading-content {
    text-align: center;
}

.loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-1);
    border-radius: 50%;
    animation: pulse-out 2s ease-out infinite;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.4s;
}

.delay-2 {
    animation-delay: 0.8s;
}

@keyframes pulse-out {
    0% {
        transform: scale(0.5);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.loading-icon {
    font-size: 32px;
    z-index: 1;
}

.loading-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.loading-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.loading-bar {
    width: 180px;
    height: 3px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-1);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ============================================
   ERROR SCREEN
   ============================================ */
#error {
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: var(--bg-primary);
}

.error-content {
    max-width: 400px;
}

.error-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 20px;
}

.error-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.error-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ============================================
   RESULTS SCREEN
   ============================================ */
#results {
    min-height: 100vh;
    background: var(--bg-primary);
    transition: background var(--transition-slow);
}

/* Header */
.results-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(250, 250, 249, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.back-btn,
.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-btn:hover,
.share-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.header-logo {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    justify-content: center;
    padding: 14px 16px 0;
    gap: 4px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn:hover {
    background: var(--bg-glass);
    color: var(--text-secondary);
}

.mode-btn.active {
    background: var(--bg-glass-hover);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* Results Body */
.results-body {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    width: 100%;
}

/* ============================================
   PROFILE HEADER
   ============================================ */
.profile-header {
    text-align: center;
    padding: 28px 0 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    background: var(--gradient-1);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.25);
}

body.mode-cv .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 22px;
    box-shadow: var(--shadow-card);
}

body.mode-fun .profile-avatar {
    width: 88px;
    height: 88px;
    font-size: 38px;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

.profile-name {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 3px;
}

body.mode-cv .profile-name {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
}

.profile-query {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    min-width: 90px;
}

.stat-pill .stat-value {
    font-size: 20px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.mode-cv .stat-pill .stat-value {
    -webkit-text-fill-color: var(--text-primary);
    background: none;
}

body.mode-fun .stat-pill .stat-value {
    font-size: 26px;
}

.stat-pill .stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

body.mode-fun .stat-card:hover {
    transform: translateY(-4px) rotate(1deg);
}

.stat-card-icon {
    font-size: 22px;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stat-card-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ============================================
   SECTION CARDS
   ============================================ */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 14px;
    transition: all var(--transition-base);
}

body.mode-cv .section-card {
    border-radius: var(--radius-md);
    padding: 18px;
}

body.mode-fun .section-card {
    border-radius: var(--radius-xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.section-title svg {
    color: var(--accent-1);
    flex-shrink: 0;
}

body.mode-cv .section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

/* ============================================
   TIMELINE CHART — FIXED bottom-alignment
   ============================================ */
.timeline-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    padding-top: 8px;
}

.timeline-bar-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.timeline-bar {
    width: 100%;
    max-width: 28px;
    border-radius: 3px 3px 0 0;
    background: var(--gradient-1);
    min-height: 3px;
    transition: opacity var(--transition-fast);
    cursor: default;
    position: relative;
}

.timeline-bar:hover {
    opacity: 0.75;
}

body.mode-fun .timeline-bar {
    border-radius: 6px 6px 0 0;
}

.timeline-year {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.timeline-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.timeline-bar:hover .timeline-tooltip {
    opacity: 1;
}

/* ============================================
   TOP JOURNALS / INSTITUTIONS
   ============================================ */
.institutions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.institution-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.institution-item:hover {
    background: var(--bg-glass-hover);
}

.institution-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.institution-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.institution-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-1);
    flex-shrink: 0;
    padding: 2px 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
}

/* ============================================
   PUBLICATION TYPES
   ============================================ */
.pub-types-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pub-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pub-type-badge:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-medium);
}

.pub-type-count {
    font-weight: 700;
    color: var(--accent-1);
    font-size: 11px;
}

body.mode-cv .pub-type-badge {
    border-radius: var(--radius-sm);
}

body.mode-fun .pub-type-badge {
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-glass-hover);
}

/* ============================================
   KEYWORDS CLOUD
   ============================================ */
.keywords-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.keyword-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
    cursor: default;
}

.keyword-tag:hover {
    background: var(--bg-glass-hover);
    transform: scale(1.05);
}

.keyword-tag.large {
    font-size: 14px;
    font-weight: 600;
    padding: 7px 16px;
}

.keyword-tag.small {
    font-size: 10px;
    padding: 3px 8px;
}

body.mode-cv .keyword-tag {
    border-radius: var(--radius-sm);
    font-size: 11px;
}

body.mode-fun .keyword-tag {
    border: none;
    border-radius: var(--radius-md);
}

body.mode-fun .keyword-tag:hover {
    transform: scale(1.1) rotate(2deg);
}

/* ============================================
   FUN STATS
   ============================================ */
.fun-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.fun-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
}

.fun-stat-emoji {
    font-size: 26px;
    flex-shrink: 0;
}

.fun-stat-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.fun-stat-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ============================================
   SORT TOGGLE
   ============================================ */
.sort-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    padding: 2px;
}

.sort-btn {
    padding: 5px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ============================================
   PUBLICATIONS LIST
   ============================================ */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pub-card {
    display: block;
    padding: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
}

.pub-card:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-medium);
}

body.mode-cv .pub-card {
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-1);
}

body.mode-fun .pub-card:hover {
    transform: translateY(-3px) rotate(-0.5deg);
}

.pub-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.pub-card-year {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-1);
    flex-shrink: 0;
    padding: 2px 7px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-sm);
}

body.mode-cv .pub-card-year {
    background: var(--bg-glass);
    color: var(--text-secondary);
}

.pub-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    flex: 1;
}

.pub-card-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.pub-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pub-card-journal {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
}

.pub-card-citation-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.pub-card-citation-btn:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    background: rgba(139, 92, 246, 0.06);
}

.pub-card-citation-btn.loaded {
    border-color: var(--accent-4);
    color: var(--accent-4);
    background: rgba(16, 185, 129, 0.06);
}

.pub-card-citation-btn svg {
    width: 11px;
    height: 11px;
}

.pub-card-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pub-card-link:hover {
    border-color: var(--accent-2);
    color: var(--accent-2);
}

.load-more-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.load-more-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* ============================================
   CV MODE — Publication list as numbered entries
   ============================================ */
.cv-pub-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.cv-pub-item:last-child {
    border-bottom: none;
}

.cv-pub-number {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 28px;
    text-align: right;
    padding-top: 2px;
}

.cv-pub-content {
    flex: 1;
}

.cv-pub-authors {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.cv-pub-title-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.4;
}

.cv-pub-journal-line {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

.cv-pub-journal-line a {
    color: var(--text-tertiary);
    text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */
.results-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
}

.results-footer a {
    color: var(--text-tertiary);
}

.results-footer strong {
    color: var(--text-tertiary);
    font-weight: 600;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 440px;
    width: 100%;
    position: relative;
    transform: translateY(16px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-elevated);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

/* ---- Bottom Sheet (mobile share modal) ---- */
@media (max-width: 600px) {
    .modal-overlay#shareModal {
        align-items: flex-end;
        padding: 0;
    }

    .modal-overlay#shareModal .modal-card {
        max-width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        padding: 20px 20px 32px;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .modal-overlay#shareModal.active .modal-card {
        transform: translateY(0);
    }

    .modal-overlay#shareModal .modal-card::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border-medium);
        border-radius: 2px;
        margin: 0 auto 16px;
    }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.modal-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.share-link-row {
    display: flex;
    gap: 8px;
}

.share-link-row input {
    flex: 1;
    padding: 9px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    outline: none;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 14px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast);
    white-space: nowrap;
}

.copy-btn:hover {
    transform: scale(1.02);
}

/* Citation Modal */
.citation-modal-card {
    max-width: 360px;
    text-align: center;
}

.citation-loading {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 16px;
}

.citation-loading .dot {
    width: 7px;
    height: 7px;
    background: var(--accent-1);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.citation-loading .dot:nth-child(2) {
    animation-delay: 0.16s;
}

.citation-loading .dot:nth-child(3) {
    animation-delay: 0.32s;
}

.citation-result {
    display: none;
}

.citation-result.visible {
    display: block;
}

.citation-count-display {
    font-size: 44px;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.citation-count-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.45s ease backwards;
}

.stagger-1 {
    animation-delay: 0.04s;
}

.stagger-2 {
    animation-delay: 0.08s;
}

.stagger-3 {
    animation-delay: 0.12s;
}

.stagger-4 {
    animation-delay: 0.16s;
}

.stagger-5 {
    animation-delay: 0.2s;
}

.stagger-6 {
    animation-delay: 0.24s;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .input-row {
        grid-template-columns: 1fr;
    }

    .search-card {
        padding: 18px;
    }

    .results-body {
        padding: 14px 12px 28px;
    }

    .section-card {
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .profile-stats {
        gap: 6px;
    }

    .stat-pill {
        padding: 8px 12px;
        min-width: 76px;
    }

    .stats-grid {
        gap: 6px;
    }

    .mode-switcher {
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 14px 12px 0;
        justify-content: flex-start;
    }

    .mode-switcher::-webkit-scrollbar {
        display: none;
    }

    .mode-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 44px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mode-btn svg {
        display: none;
    }

    .share-btn span {
        display: none;
    }

    .timeline-year {
        font-size: 7px;
    }

    .pub-card-header {
        flex-direction: column-reverse;
        gap: 4px;
    }

    .pub-card-year {
        align-self: flex-start;
    }

    .section-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        flex-direction: column;
        align-items: center;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: rgba(44, 62, 80, 0.2);
    color: var(--text-primary);
}

/* --- "Not your article?" notice --- */
.not-yours-notice {
    text-align: center;
    padding: 14px 16px;
    margin-top: 6px;
}

.not-yours-notice .notice-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.not-yours-notice .notice-trigger:hover {
    color: var(--text-tertiary);
    background: var(--bg-glass);
}

.not-yours-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    opacity: 0;
    padding: 0 16px;
}

.not-yours-detail.open {
    max-height: 300px;
    opacity: 1;
    padding: 12px 16px;
}

.not-yours-detail-inner {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
}

.not-yours-detail-inner a {
    color: var(--accent-1);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Advanced panel helper text --- */
.advanced-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.advanced-hint a {
    color: var(--accent-1);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.advanced-hint strong {
    color: var(--text-secondary);
}

.advanced-hint-extra {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.advanced-hint-extra a {
    color: var(--accent-1);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
    display: inline-flex;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 2px;
    margin-top: 8px;
}

.lang-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.03em;
}

.lang-btn:hover {
    color: var(--text-secondary);
}

.lang-btn.active {
    background: var(--accent-1);
    color: #fff;
}

/* ============================================
   COLLAPSIBLE SECTIONS (Short-CV)
   ============================================ */
.collapsible-section {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
    background: var(--bg-card);
    transition: box-shadow var(--transition-fast);
}

.collapsible-section:hover {
    box-shadow: var(--shadow-card);
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
    gap: 10px;
}

.collapsible-header:hover {
    background: var(--bg-glass);
}

.collapsible-header .section-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-glass);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.collapsible-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.collapsible-section.open .collapsible-chevron {
    transform: rotate(180deg);
}

.collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.collapsible-section.open .collapsible-body {
    max-height: 5000px;
}

.collapsible-body-inner {
    padding: 0 16px 16px;
}

/* Short-CV toggle all bar */
.shortcv-controls {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0;
    gap: 8px;
}

.shortcv-toggle-all {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shortcv-toggle-all:hover {
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

/* Short-CV compact pub list */
.shortcv-pub-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    line-height: 1.5;
}

.shortcv-pub-item:last-child {
    border-bottom: none;
}

.shortcv-pub-num {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    min-width: 22px;
    text-align: right;
    flex-shrink: 0;
    padding-top: 1px;
}

.shortcv-pub-content {
    flex: 1;
}

.shortcv-pub-title {
    font-weight: 500;
    color: var(--text-primary);
}

.shortcv-pub-meta {
    color: var(--text-tertiary);
    font-size: 11px;
    margin-top: 2px;
}

.shortcv-pub-meta a {
    color: var(--accent-1);
    text-decoration: none;
}

.shortcv-pub-year {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    flex-shrink: 0;
}

/* ============================================
   PUBLICATION DISMISS / EXCLUDE
   ============================================ */

/* Normal mode dismiss button */
.pub-card-dismiss-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0;
}

.pub-card:hover .pub-card-dismiss-btn {
    opacity: 1;
}

.pub-card-dismiss-btn:hover {
    background: hsl(0 80% 95%);
    color: hsl(0 70% 55%);
}

/* CV / Short-CV dismiss button */
.cv-pub-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0;
    margin-left: 4px;
}

.cv-pub-item:hover .cv-pub-dismiss,
.shortcv-pub-item:hover .cv-pub-dismiss {
    opacity: 1;
}

.cv-pub-dismiss:hover {
    background: hsl(0 80% 95%);
    color: hsl(0 70% 55%);
}

/* Excluded publications banner */
.excluded-banner {
    margin-top: 16px;
}

.excluded-banner-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: hsl(45 100% 96%);
    border: 1px solid hsl(45 80% 85%);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.excluded-banner-icon {
    display: flex;
    align-items: center;
    color: hsl(45 70% 45%);
    flex-shrink: 0;
}

.excluded-banner-text {
    flex: 1;
}

.excluded-banner-undo {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-1);
    background: none;
    border: 1px solid var(--accent-1);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.excluded-banner-undo:hover {
    background: var(--accent-1);
    color: #fff;
}

/* ============================================
   SOURCE SELECTOR (PubMed / OpenAlex)
   ============================================ */
.source-selector {
    display: inline-block;
    position: relative;
}

.source-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    border-bottom: 1.5px dashed var(--accent-1);
    font-family: inherit;
    font-size: inherit;
    color: var(--accent-1);
    font-weight: 600;
    cursor: pointer;
    padding: 0 2px 1px;
    transition: all var(--transition-fast);
}

.source-toggle:hover {
    color: var(--accent-2);
    border-color: var(--accent-2);
}

.source-toggle svg {
    transition: transform 0.2s ease;
}

.source-selector.open .source-toggle svg {
    transform: rotate(180deg);
}

.source-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    z-index: 100;
    min-width: 200px;
}

.source-selector.open .source-dropdown {
    display: block;
    animation: fadeInUp 0.15s ease;
}

.source-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast);
}

.source-option:hover {
    background: var(--bg-glass);
}

.source-option.active {
    color: var(--accent-1);
    font-weight: 600;
}

/* ============================================
   SHARE CTA (bottom of results)
   ============================================ */
.share-cta {
    text-align: center;
    padding: 24px 16px 8px;
}

.share-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-1);
    background: none;
    border: 1.5px solid var(--accent-1);
    border-radius: var(--radius-full);
    padding: 8px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-cta-btn:hover {
    background: var(--accent-1);
    color: #fff;
}

.share-cta-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* ============================================
   SHARE MODAL HINT
   ============================================ */
.share-modal-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.5;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

/* ============================================
   FREE HINT (below search button)
   ============================================ */
.search-free-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
    opacity: 0.7;
    letter-spacing: 0.02em;
}

/* ============================================
   CREATE YOUR OWN CTA (results page)
   ============================================ */
.create-own-cta {
    text-align: center;
    padding: 20px 16px 4px;
    margin-top: 8px;
}

.create-own-cta p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.create-own-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.create-own-btn:hover {
    color: var(--accent-1);
    border-color: var(--accent-1);
    background: rgba(108, 99, 255, 0.08);
}

/* ============================================
   FAQ PAGE
   ============================================ */
.faq-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.faq-header {
    text-align: center;
    margin-bottom: 48px;
}

.faq-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.faq-logo:hover {
    color: var(--accent-1);
}

.faq-header h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.faq-header-sub {
    font-size: 16px;
    color: var(--text-secondary);
}

.faq-section {
    margin-bottom: 40px;
}

.faq-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-1);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: rgba(108, 99, 255, 0.2);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    line-height: 1.5;
}

.faq-question svg {
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer-inner {
    padding: 0 20px 18px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-answer-inner a {
    color: var(--accent-1);
    text-decoration: none;
}

.faq-answer-inner a:hover {
    text-decoration: underline;
}

.faq-answer-inner ul {
    margin: 8px 0 8px 20px;
}

.faq-answer-inner li {
    margin-bottom: 4px;
}

.faq-cta {
    text-align: center;
    margin-top: 48px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.faq-cta h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.faq-cta p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.faq-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: 999px;
    padding: 12px 28px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}

.faq-cta-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.faq-footer {
    text-align: center;
    margin-top: 48px;
    font-size: 13px;
    color: var(--text-muted);
}

.faq-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.faq-footer a:hover {
    color: var(--accent-1);
}

@media (max-width: 600px) {
    .faq-container {
        padding: 40px 16px 60px;
    }

    .faq-question {
        font-size: 14px;
        padding: 14px 16px;
    }

    .faq-answer-inner {
        padding: 0 16px 14px;
        font-size: 13px;
    }
}

/* ============================================
   LEGAL PAGES (Impressum, Datenschutz)
   ============================================ */
.legal-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.legal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.legal-lang-switcher {
    display: flex;
    gap: 4px;
}

.legal-container h1 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.legal-container h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 36px;
    margin-bottom: 12px;
}

.legal-container h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-1);
    margin-top: 24px;
    margin-bottom: 8px;
}

.legal-container p,
.legal-container li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
}

.legal-container ul {
    margin: 8px 0 16px 20px;
}

.legal-container li {
    margin-bottom: 6px;
}

.legal-container a {
    color: var(--accent-1);
    text-decoration: none;
}

.legal-container a:hover {
    text-decoration: underline;
}

.legal-intro {
    font-size: 15px !important;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.legal-footer {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.legal-footer a {
    color: var(--text-muted);
    font-size: 13px;
}

.legal-footer a:hover {
    color: var(--accent-1);
}

.legal-copyright {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: 8px;
}

@media (max-width: 600px) {
    .legal-container {
        padding: 40px 16px 60px;
    }

    .legal-container h2 {
        font-size: 15px;
    }
}

/* Subtle legal links in footers */
.legal-links-subtle {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    opacity: 0.5;
    margin-top: 4px;
}

.legal-links-subtle a {
    color: var(--text-muted) !important;
    text-decoration: none;
}

.legal-links-subtle a:hover {
    color: var(--text-secondary) !important;
    opacity: 1;
}

/* ============================================
   FLOATING ACTION BUTTON (mobile share)
   ============================================ */
.share-fab {
    display: none;
}

@media (max-width: 600px) {
    .share-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 24px;
        right: 20px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--gradient-1);
        border: none;
        color: #fff;
        box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
        cursor: pointer;
        z-index: 900;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        animation: fabEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        animation-delay: 0.6s;
    }

    .share-fab:active {
        transform: scale(0.92);
    }

    .share-fab svg {
        width: 22px;
        height: 22px;
    }

    /* Hide the header share button on mobile since we have FAB */
    .results-header .share-btn {
        display: none;
    }
}

@keyframes fabEnter {
    from {
        opacity: 0;
        transform: scale(0) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   ANIMATED COUNTER
   ============================================ */
.stat-value {
    font-variant-numeric: tabular-nums;
}