/* ============================================================
   Arkansas Research Expertise Database — Design System
   Clean, professional layout for research professionals,
   industry experts, and support organizations.
   ============================================================ */

/* --- Google Fonts loaded in HTML <head> --- */

:root {
    /* Brand palette */
    --brand-navy: #0f172a;
    --brand-navy-light: #1e293b;

    /* Primary action color */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-subtle: #eff6ff;

    /* Accent / verified */
    --verified: #059669;
    --verified-bg: #ecfdf5;

    /* Neutrals */
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Text */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #f8fafc;

    /* Feedback */
    --error: #dc2626;
    --error-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --success: #059669;
    --success-bg: #ecfdf5;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    /* Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Accent (used for match-summary highlights) */
    --accent: var(--primary);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
}


/* ============================================================
   Reset & Base
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Sticky footer: flex column pushes footer to bottom on short pages */
    display: flex;
    flex-direction: column;
    /* Prevent horizontal overflow on mobile */
    overflow-x: hidden;
}


/* ============================================================
   Accessibility
   ============================================================ */

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 200;
    font-weight: 600;
    font-size: 0.875rem;
    transition: top var(--duration) var(--ease);
}

.skip-link:focus {
    top: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* ============================================================
   Site Header — dark top bar
   ============================================================ */

.site-header {
    background: var(--brand-navy);
    color: var(--text-inverse);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-inverse);
}

.brand-tagline {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Header stats */
.header-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.header-stat-value {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-inverse);
}

/* Skeleton shimmer for loading states */
.skeleton-text {
    color: transparent;
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 25%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.08) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    line-height: 1;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.header-stat-label {
    color: var(--text-muted);
    font-weight: 400;
}

.header-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--verified);
    display: inline-block;
    flex-shrink: 0;
}

.header-stat-dot.offline {
    background: var(--error);
}


/* ============================================================
   Page Container
   ============================================================ */

.page-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    /* Grow to fill available space so footer sticks to bottom */
    flex: 1;
}


/* ============================================================
   Search Section
   ============================================================ */

.search-section {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.search-heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.search-subheading {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Search box card */
.search-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease),
                border-color var(--duration) var(--ease);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.search-guidance {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.search-input-wrap {
    position: relative;
}

.search-input {
    width: 100%;
    border: none;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    resize: none;
    overflow: hidden;
    min-height: 2.5rem;
    line-height: 1.6;
    background: transparent;
}

.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: -1.5rem;
    right: -1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text);
    transition: background 0.1s;
}

.suggest-item:hover,
.suggest-item.active {
    background: var(--bg);
}

.suggest-item-type {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 4rem;
}

.suggest-item-type.type-topic {
    color: var(--primary);
}

.suggest-item-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
}

/* Controls below textarea */
.search-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.4375rem 0.75rem;
    padding-right: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--bg);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: border-color var(--duration) var(--ease);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.search-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    user-select: none;
    white-space: nowrap;
}

.char-counter.warning { color: var(--warning); }
.char-counter.danger { color: var(--error); font-weight: 600; }

.search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--duration) var(--ease),
                transform 100ms var(--ease);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-hover);
}

.search-btn:active {
    transform: scale(0.97);
}

.search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.search-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Suggested searches */
.suggested-searches {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.suggested-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.suggested-chips {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    padding: 0.3125rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
    line-height: 1.4;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.chip:active {
    transform: scale(0.97);
}


/* ============================================================
   Topic Browse Banner
   ============================================================ */

.topic-browse-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--primary-light, #eff6ff);
    border: 1px solid var(--primary, #2563eb);
    border-radius: var(--radius, 8px);
    font-size: 0.9375rem;
    color: var(--text, #1e293b);
}

.topic-browse-label {
    color: var(--text-muted, #64748b);
}

.topic-browse-name {
    color: var(--primary, #2563eb);
}

.topic-browse-clear {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.topic-browse-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text, #1e293b);
}

/* ============================================================
   Results Section
   ============================================================ */

.results-section {
    animation: fadeIn 0.25s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.results-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

.clear-btn {
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.clear-btn:hover {
    background: var(--bg);
    border-color: var(--border-strong);
}

/* Loading state */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.search-status-text {
    transition: opacity 0.3s var(--ease);
    min-height: 1.4em;
    text-align: center;
}

.search-status-fade {
    opacity: 0;
}

/* Shared search loading overlay (directory, etc.) */
.search-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(248, 250, 252, 0.85);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(2px);
}

.search-loading-overlay.visible {
    display: flex;
}

.search-loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.search-loading-overlay p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity 0.3s var(--ease);
    min-height: 1.4em;
    text-align: center;
}

/* Error message */
.error-message {
    background: var(--error-bg);
    color: var(--error);
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

/* Empty state — informational, not error-like */
.empty-state {
    background: var(--bg);
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    border: 1px solid var(--border);
    text-align: center;
}


/* ============================================================
   Researcher Cards — Grid
   ============================================================ */

.researchers-section {
    margin-top: 0.5rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.researchers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 1rem;
}


/* ============================================================
   Researcher Card
   ============================================================ */

.researcher-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow var(--duration) var(--ease),
                border-color var(--duration) var(--ease);
    opacity: 0;
    animation: cardIn 0.35s var(--ease) forwards;
}

.researcher-card:nth-child(1)  { animation-delay: 0.03s; }
.researcher-card:nth-child(2)  { animation-delay: 0.06s; }
.researcher-card:nth-child(3)  { animation-delay: 0.09s; }
.researcher-card:nth-child(4)  { animation-delay: 0.12s; }
.researcher-card:nth-child(5)  { animation-delay: 0.15s; }
.researcher-card:nth-child(6)  { animation-delay: 0.18s; }
.researcher-card:nth-child(n+7){ animation-delay: 0.21s; }

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.researcher-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.researcher-card.verified {
    border-left: 3px solid var(--verified);
}

.researcher-card.probable {
    border-left: 3px solid var(--primary);
}

/* Card header row */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    user-select: none;
}

.card-avatar.verified-avatar {
    background: var(--verified-bg);
    color: var(--verified);
}

.card-avatar.probable-avatar {
    background: var(--primary-subtle);
    color: var(--primary);
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--verified);
    color: white;
    font-size: 0.625rem;
    flex-shrink: 0;
    line-height: 1;
}

.probable-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--primary);
    gap: 0.25rem;
    flex-shrink: 0;
}

.probable-badge svg {
    width: 14px;
    height: 14px;
}

/* Tier 3 — Institution Verified badge in search cards */
.verified-badge.tier-institution {
    width: auto;
    height: auto;
    border-radius: 100px;
    background: #b7791f;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    letter-spacing: 0;
}

/* ============================================================
   Search Card Designation Badges
   Rendered as a stacking row below the researcher name
   ============================================================ */

.card-designation-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.375rem;
}

.card-designation-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 100px;
    color: #fff;
    letter-spacing: 0;
    white-space: nowrap;
}

.card-designation-badge.desig-ara-academy   { background: #7c3aed; }
.card-designation-badge.desig-federal-grant { background: #0369a1; }
.card-designation-badge.desig-high-impact   { background: #92400e; }
.card-designation-badge.desig-emeritus      { background: #64748b; }

.card-institution {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.125rem 0 0;
    line-height: 1.4;
}

.card-title {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.125rem 0 0;
    line-height: 1.4;
}

.card-department {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.card-career-stage {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Card metrics row */
.card-metrics {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 0.1875rem 0.5rem;
    border-radius: 100px;
    font-variant-numeric: tabular-nums;
}

.metric-badge strong {
    font-weight: 600;
    color: var(--text);
}

/* Card topics */
.card-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3125rem;
}

.topic-tag {
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 500;
    line-height: 1.5;
}

a.topic-tag-link {
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

a.topic-tag-link:hover {
    background: var(--primary);
    color: #fff;
}

/* Card actions */
.card-actions {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.card-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap var(--duration) var(--ease);
}

.card-link:hover {
    gap: 0.5rem;
}

.card-link::after {
    content: '\2192';
    transition: transform var(--duration) var(--ease);
}


/* ============================================================
   Buttons (shared)
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--border-strong);
}


/* ============================================================
   External links
   ============================================================ */

.profile-links {
    margin-top: 1rem;
}

.profile-links h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 1rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--duration) var(--ease);
}

.external-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}


/* ============================================================
   Hero Section
   ============================================================ */

.hero {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.hero-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.hero-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}


/* ============================================================
   Guided Link
   ============================================================ */

.guided-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: gap var(--duration) var(--ease);
}

.guided-link:hover {
    gap: 0.625rem;
    text-decoration: underline;
}


/* ============================================================
   Browse / Explore Section
   ============================================================ */

.explore-section {
    margin-top: 3rem;
}

.explore-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.explore-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.explore-subheading {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.explore-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.explore-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.explore-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.explore-card-icon svg {
    width: 22px;
    height: 22px;
}

.explore-card-icon.icon-institutions {
    background: #ede9fe;
    color: #7c3aed;
}

.explore-card-icon.icon-topics {
    background: #fef3c7;
    color: #d97706;
}

.explore-card-icon.icon-directory {
    background: var(--verified-bg);
    color: var(--verified);
}

.explore-card-icon.icon-howto {
    background: var(--primary-subtle);
    color: var(--primary);
}

.explore-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.explore-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.explore-card-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: auto;
    padding-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.explore-card:hover .explore-card-link {
    gap: 0.5rem;
}


/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.footer-brand-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 360px;
}

.footer-column-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text);
    pointer-events: auto;
    animation: toastIn 0.25s var(--ease);
    border-left: 3px solid var(--primary);
}

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }

.toast-fade-out {
    animation: toastOut 0.25s var(--ease) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}


/* ============================================================
   Modal (shared base)
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s var(--ease);
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--duration) var(--ease);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}


/* ============================================================
   Forms
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}


/* ============================================================
   Responsive — Tablet (max-width: 768px)
   ============================================================ */

@media (max-width: 768px) {
    /* --- Header / Navigation --- */
    .header-inner {
        height: 56px;
        padding: 0 1rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .brand-name {
        font-size: 0.875rem;
        /* Prevent the long brand name from forcing horizontal scroll */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-tagline {
        display: none;
    }

    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: flex;
    }

    /* Slide-out nav panel */
    .header-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100dvh;
        background: var(--brand-navy, #0f172a);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.25rem;
        z-index: 1001;
        transition: right 0.25s var(--ease, ease);
        overflow-y: auto;
    }

    .header-nav.open {
        right: 0;
    }

    .nav-close-btn {
        display: flex;
    }

    .nav-overlay.active {
        display: block;
    }

    .header-nav .header-nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        white-space: nowrap;
        border-radius: var(--radius, 8px);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Hide stats on tablet to save space */
    .header-stats {
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    .header-stat-label {
        display: none;
    }

    /* --- Page Container --- */
    .page-container {
        padding: 1.25rem 1rem;
    }

    /* --- Hero --- */
    .hero h1 {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9375rem;
    }

    .hero-description {
        font-size: 0.8125rem;
    }

    /* --- Search --- */
    .search-heading {
        font-size: 1.375rem;
    }

    .search-box {
        padding: 1.25rem;
    }

    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-actions {
        margin-left: 0;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Hide the keyboard hint on mobile — not useful for touch users */
    .search-hint {
        display: none;
    }

    .search-btn {
        flex: 1;
        min-height: 44px;
        width: 100%;
    }

    .search-guidance {
        font-size: 0.8125rem;
    }

    .suggested-searches {
        flex-direction: column;
        align-items: flex-start;
    }

    .suggested-chips {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .chip {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    /* --- Results --- */
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* --- Researcher Cards Grid --- */
    .researchers-grid {
        grid-template-columns: 1fr;
    }

    /* --- Explore Grid --- */
    .explore-grid {
        grid-template-columns: 1fr;
    }

    /* --- Footer --- */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    /* --- Buttons — touch target size --- */
    .btn {
        min-height: 44px;
    }

    .clear-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    .load-more-btn {
        min-height: 44px;
        padding: 0.75rem 2rem;
    }

    /* --- Toast on mobile --- */
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .toast {
        width: 100%;
    }

    /* --- Pagination --- */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination-btn {
        min-height: 44px;
    }

    /* --- Designation filter pills — wrap nicely --- */
    .designation-filters {
        gap: 0.375rem;
    }

    .designation-pill {
        min-height: 36px;
    }
}

/* ============================================================
   Responsive — Phone (max-width: 480px)
   ============================================================ */

@media (max-width: 480px) {
    /* --- Header further compact --- */
    .header-inner {
        padding: 0.5rem 0.75rem;
    }

    .brand-name {
        font-size: 0.8125rem;
    }

    .brand-mark {
        width: 28px;
        height: 28px;
    }

    /* Compact stats on phone — show count, hide status dot */
    .header-stats {
        gap: 0.5rem;
    }

    .header-stats .header-stat:last-child {
        display: none;
    }

    /* --- Page Container tighter padding --- */
    .page-container {
        padding: 1rem 0.75rem;
    }

    /* --- Hero --- */
    .hero h1 {
        font-size: 1.25rem;
    }

    .hero-subtitle {
        font-size: 0.875rem;
    }

    /* --- Search --- */
    .search-box {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }

    .search-input {
        font-size: 0.875rem;
    }

    .search-filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
        min-height: 44px;
    }

    /* --- Researcher Card adjustments --- */
    .researcher-card {
        padding: 1rem;
    }

    .card-name {
        font-size: 0.875rem;
    }

    .card-institution {
        font-size: 0.75rem;
    }

    .card-metrics {
        gap: 0.5rem;
    }

    .metric-badge {
        font-size: 0.6875rem;
    }

    .topic-tag {
        font-size: 0.625rem;
    }

    /* --- Explore cards --- */
    .explore-card {
        padding: 1.25rem;
    }

    /* --- Footer --- */
    .footer-inner {
        padding: 2rem 1rem 1.5rem;
    }

    .footer-brand-desc {
        font-size: 0.75rem;
    }

    /* --- Breadcrumb --- */
    .breadcrumb {
        font-size: 0.75rem;
        gap: 0.375rem;
        margin-bottom: 1rem;
        /* Allow breadcrumb to scroll if path is very long */
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    /* --- Designation pills wrap on small screens --- */
    .designation-filters {
        flex-wrap: wrap;
        gap: 0.375rem;
    }

    .designation-pill {
        flex-shrink: 0;
        min-height: 36px;
    }

    /* --- Topic browse banner mobile --- */
    .topic-browse-banner {
        font-size: 0.8125rem;
    }
}


/* ============================================================
   Breadcrumb Navigation
   ============================================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.breadcrumb-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--duration) var(--ease);
}

.breadcrumb-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted);
    user-select: none;
}

.breadcrumb-current {
    color: var(--text-secondary);
}


/* ============================================================
   Browse Page Header
   ============================================================ */

.browse-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.browse-header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.browse-header-icon svg {
    width: 26px;
    height: 26px;
}

.browse-header-icon.icon-institutions {
    background: #ede9fe;
    color: #7c3aed;
}

.browse-header-icon.icon-topics {
    background: #fef3c7;
    color: #d97706;
}

.browse-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.browse-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* ============================================================
   Institution Cards Grid
   ============================================================ */

.institutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.institution-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    opacity: 0;
    animation: cardIn 0.35s var(--ease) forwards;
}

.institution-card:nth-child(1)  { animation-delay: 0.03s; }
.institution-card:nth-child(2)  { animation-delay: 0.06s; }
.institution-card:nth-child(3)  { animation-delay: 0.09s; }
.institution-card:nth-child(4)  { animation-delay: 0.12s; }
.institution-card:nth-child(5)  { animation-delay: 0.15s; }
.institution-card:nth-child(6)  { animation-delay: 0.18s; }
.institution-card:nth-child(n+7){ animation-delay: 0.21s; }

.institution-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.inst-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inst-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inst-card-icon svg {
    width: 22px;
    height: 22px;
}

.inst-card-icon.icon-institutions {
    background: #ede9fe;
    color: #7c3aed;
}

.inst-card-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.inst-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.inst-type-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ARA Partner institution cards */
.institution-card.inst-ara-partner {
    border-color: var(--primary);
}

.inst-ara-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Institutions toolbar (legend + view toggle) */
.inst-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.inst-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inst-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.inst-legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: var(--radius);
    background: var(--surface);
}

.inst-legend-swatch--ara {
    border: 2px solid var(--primary);
}

.inst-legend-swatch--other {
    border: 2px solid var(--border);
}

.inst-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.inst-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--surface);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.inst-view-btn + .inst-view-btn {
    border-left: 1px solid var(--border);
}

.inst-view-btn.active {
    background: var(--primary);
    color: white;
}

.inst-view-btn:hover:not(.active) {
    background: var(--bg);
}

/* Bubble chart */
.inst-bubble-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.inst-bubble-svg {
    width: 100%;
    height: 100%;
}

.inst-bubble-node {
    cursor: pointer;
    transition: opacity 0.15s;
}

.inst-bubble-node:hover {
    opacity: 0.85;
}

.inst-bubble-node:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.inst-bubble-label {
    pointer-events: none;
    fill: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: central;
}

.inst-bubble-count {
    pointer-events: none;
    fill: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-anchor: middle;
}

.inst-bubble-tooltip {
    position: absolute;
    background: var(--text);
    color: var(--surface);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.inst-bubble-tooltip.visible {
    opacity: 1;
}

.inst-card-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.inst-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.inst-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.inst-stat-confirmed {
    color: var(--verified);
}

.inst-stat-probable {
    color: var(--primary);
}

.inst-stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}


/* ============================================================
   Topics Page Filter
   ============================================================ */

.topics-toolbar {
    max-width: 900px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.topics-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.topics-filter-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.topics-filter-icon {
    position: absolute;
    left: 0.625rem;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.topics-filter-input {
    flex: 1;
    padding: 0.5rem 2rem 0.5rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
}

.topics-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.topics-filter-input::placeholder {
    color: var(--text-muted);
}

.topics-filter-clear {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.125rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.topics-filter-clear:hover {
    color: var(--text);
}

.topics-filter-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.topics-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topics-sort {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.topics-sort-btn {
    background: var(--surface);
    border: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.topics-sort-btn + .topics-sort-btn {
    border-left: 1px solid var(--border);
}

.topics-sort-btn.active {
    background: var(--primary);
    color: white;
}

.topics-sort-btn:hover:not(.active) {
    background: var(--primary-subtle);
}

/* View toggle buttons */
.topics-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.topics-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--surface);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.topics-view-btn + .topics-view-btn {
    border-left: 1px solid var(--border);
}

.topics-view-btn.active {
    background: var(--primary);
    color: white;
}

.topics-view-btn:hover:not(.active) {
    background: var(--bg);
}

/* Tag cloud view */
.topics-cloud-view {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    padding: 2rem 1rem;
}

.topic-cloud-tag {
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
    line-height: 1.6;
}

.topic-cloud-tag:hover {
    text-decoration: underline;
    opacity: 1 !important;
}

/* Discipline filter pills */
.topics-disciplines {
    max-width: 900px;
    margin: 0 auto 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: center;
}

.topics-discipline-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--duration) var(--ease);
}

.topics-discipline-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.topics-discipline-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Show All button */
.topics-show-all {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.625rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--duration) var(--ease);
}

.topics-show-all:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
}


/* ============================================================
   Topic Cards Grid
   ============================================================ */

.topics-container {
    max-width: 900px;
    margin: 0 auto;
}

.topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
}

.topic-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    opacity: 0;
    animation: cardIn 0.35s var(--ease) forwards;
}

.topic-card:nth-child(1)  { animation-delay: 0.02s; }
.topic-card:nth-child(2)  { animation-delay: 0.04s; }
.topic-card:nth-child(3)  { animation-delay: 0.06s; }
.topic-card:nth-child(4)  { animation-delay: 0.08s; }
.topic-card:nth-child(5)  { animation-delay: 0.10s; }
.topic-card:nth-child(6)  { animation-delay: 0.12s; }
.topic-card:nth-child(7)  { animation-delay: 0.14s; }
.topic-card:nth-child(8)  { animation-delay: 0.16s; }
.topic-card:nth-child(9)  { animation-delay: 0.18s; }
.topic-card:nth-child(10) { animation-delay: 0.20s; }
.topic-card:nth-child(n+11){ animation-delay: 0.22s; }

.topic-card:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: var(--shadow-sm);
}

.topic-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
}

.topic-card-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Color coding for top topics */
.topic-card-top10 {
    background: #fffbeb;
    border-color: #fbbf24;
}

.topic-card-top10:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.topic-card-top50 {
    background: #eff6ff;
    border-color: #93c5fd;
}

.topic-card-top50:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}


/* ============================================================
   Institution Detail — Filters Bar
   ============================================================ */

.inst-filters {
    margin-bottom: 1.5rem;
}

.inst-filters-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.inst-search-wrap {
    position: relative;
    flex: 1 1 220px;
    max-width: 320px;
}

.inst-search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.inst-search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
}

.inst-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.inst-search-input::placeholder {
    color: var(--text-muted);
}

.inst-search-clear {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.inst-search-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.inst-coverage-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--warning-bg);
    border: 1px solid #fbbf24;
    border-radius: var(--radius, 8px);
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.inst-coverage-note svg {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.125rem;
}


/* ============================================================
   Pagination
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.pagination-btn:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}


/* ============================================================
   Print
   ============================================================ */

@media print {
    .site-header,
    .site-footer,
    .search-section,
    .toast-container {
        display: none;
    }

    .results-section {
        box-shadow: none;
    }

    .researcher-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}


/* ============================================================
   Responsive — Browse Pages
   ============================================================ */

@media (max-width: 768px) {
    .institutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .inst-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .inst-legend {
        justify-content: center;
    }

    .inst-view-toggle {
        align-self: center;
    }

    .inst-bubble-container {
        aspect-ratio: 4 / 3;
    }

    .browse-header h1 {
        font-size: 1.375rem;
    }

    .browse-description {
        font-size: 0.875rem;
    }

    .inst-filters-row {
        flex-direction: column;
    }

    .inst-search-wrap {
        max-width: 100%;
    }

    .inst-filters-row .filter-select {
        width: 100%;
        min-height: 44px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination-btn {
        min-height: 44px;
    }

    .inst-card-stats {
        gap: 0.75rem;
    }

    .inst-stat-value {
        font-size: 1.125rem;
    }

    .institution-card {
        padding: 1.25rem;
    }

    /* Topics page */
    .topics-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topics-filter-input {
        width: 100%;
        min-height: 44px;
    }

    .topics-filter-count {
        text-align: center;
    }

    .topics-disciplines {
        gap: 0.25rem;
    }

    .topics-discipline-pill {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .institutions-grid {
        grid-template-columns: 1fr;
    }

    .institution-card {
        padding: 1rem;
    }

    .inst-card-name {
        font-size: 0.875rem;
    }

    .inst-stat-value {
        font-size: 1rem;
    }

    .inst-bubble-container {
        aspect-ratio: 3 / 4;
    }
}


/* ============================================================
   Header Navigation (Directory & About pages)
   ============================================================ */

/* Hamburger menu (hidden on desktop) */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-inverse, #f8fafc);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius, 8px);
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-close-btn {
    display: none;
    align-self: flex-end;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-inverse, #f8fafc);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius, 8px);
    margin-bottom: 0.5rem;
}

.nav-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    transition: color var(--duration) var(--ease),
                background var(--duration) var(--ease);
}

.header-nav-link:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.08);
}

.header-nav-link.active {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}


/* ============================================================
   Expert Directory Page
   ============================================================ */

.directory-header {
    margin-bottom: 1.5rem;
}

.directory-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.directory-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Filter bar */
.directory-filters {
    margin-bottom: 1.5rem;
}

.directory-filter-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.directory-filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.directory-search-group {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    align-items: center;
}

.directory-toggle-group {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.directory-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.directory-toggle-checkbox {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.directory-search-input {
    padding: 0.4375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    min-width: 180px;
    transition: border-color var(--duration) var(--ease);
}

.directory-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.directory-search-input::placeholder {
    color: var(--text-muted);
}

.directory-filter-btn {
    padding: 0.4375rem 1rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

/* Active filter chips */
.directory-active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.directory-active-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.directory-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.directory-filter-chip:hover {
    background: var(--primary);
    color: white;
}

.directory-clear-all {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: underline;
    margin-left: 0.25rem;
}

.directory-clear-all:hover {
    color: var(--text-secondary);
}

/* Directory table */
.directory-results {
    margin-top: 0.5rem;
}

.directory-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.directory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.directory-table thead th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

.dir-sort-header {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}

.dir-sort-header:hover {
    color: var(--primary);
}

.dir-sort-header.active {
    color: var(--text);
}

.dir-sort-arrow {
    font-size: 0.5rem;
    line-height: 1;
}

.directory-table tbody tr {
    transition: background var(--duration) var(--ease);
}

.directory-table tbody tr:hover {
    background: var(--primary-subtle);
}

.directory-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.dir-col-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dir-cell-secondary {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.dir-researcher-cell {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dir-name-line {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.directory-name-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: color var(--duration) var(--ease);
}

.directory-name-link:hover {
    color: var(--primary);
}

.dir-role-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.dir-active-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.125rem 0.4rem;
    border-radius: 4px;
    vertical-align: middle;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
}

.dir-active-badge.active-recent { background: #dcfce7; color: #166534; }
.dir-active-badge.active-moderate { background: #dbeafe; color: #1e40af; }
.dir-active-badge.active-stale { background: #fef3c7; color: #92400e; }
.dir-active-badge.active-old { background: #f3f4f6; color: #6b7280; }

/* Clickable rows */
.dir-row-clickable {
    cursor: pointer;
}

/* Zebra striping */
.directory-table tbody tr:nth-child(even) {
    background: var(--bg);
}

.directory-table tbody tr:hover {
    background: var(--primary-subtle);
}

.dir-empty-field {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Pagination: numbered pages */
.dir-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.dir-page-num:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.dir-page-num.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.dir-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 2rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.directory-page-summary {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Pagination */
.directory-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.dir-page-btn {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.dir-page-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.directory-page-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Empty state */
.directory-empty {
    padding: 4rem 2rem;
    text-align: center;
}

.directory-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.directory-empty-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.directory-empty-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Directory responsive */
@media (max-width: 768px) {
    .directory-title {
        font-size: 1.375rem;
    }

    .directory-subtitle {
        font-size: 0.875rem;
    }

    .directory-filter-form {
        flex-direction: column;
        align-items: stretch;
        padding: 0.875rem 1rem;
    }

    .directory-filter-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .directory-filter-group .filter-select {
        width: 100%;
        min-height: 44px;
    }

    .directory-search-group {
        margin-left: 0;
        flex-direction: row;
    }

    .directory-search-input {
        min-width: 0;
        flex: 1;
        min-height: 44px;
    }

    .directory-filter-btn {
        min-height: 44px;
    }

    .dir-col-hide-mobile {
        display: none;
    }

    .dir-col-hide-tablet {
        display: none;
    }

    .directory-table thead th,
    .directory-table tbody td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }

    .directory-name-link {
        font-size: 0.8125rem;
    }

    /* Pagination */
    .directory-pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dir-page-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .directory-table thead th,
    .directory-table tbody td {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }

    .directory-name-link {
        font-size: 0.75rem;
    }

    .dir-cell-secondary {
        font-size: 0.6875rem;
    }

    /* On very small screens the table might still overflow —
       the .directory-table-wrap overflow-x: auto handles this */
}

@media (max-width: 1024px) and (min-width: 769px) {
    .dir-col-hide-tablet {
        display: none;
    }
}


/* ============================================================
   About / How It Works Page
   ============================================================ */

.about-hero {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.about-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.about-hero-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.about-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.about-hero-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Section layout */
.about-section {
    max-width: 960px;
    margin: 0 auto 3rem;
    text-align: center;
}

.about-section-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.about-section-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Audience cards */
.about-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.about-audience-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.about-audience-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.about-audience-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-audience-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.about-audience-icon svg {
    width: 22px;
    height: 22px;
}

/* Steps */
.about-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1rem;
}

.about-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
}

.about-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.about-step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.about-step-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Sources grid */
.about-sources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.about-source-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: left;
}

.about-source-card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.about-source-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Institutions grid */
.about-institutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.about-institution-item {
    font-size: 0.875rem;
    color: var(--text);
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    text-align: left;
}

/* CTA section */
.about-cta {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
}

.about-cta .about-section-heading {
    font-size: 1.375rem;
}

.about-cta-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Contact section */
.about-contact {
    text-align: center;
}

.about-contact-email a,
a.about-contact-email {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.about-contact-email a:hover,
a.about-contact-email:hover {
    text-decoration: underline;
}

.about-contact-block {
    margin-top: 1.5rem;
}

.about-contact-phone {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.about-contact-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.about-contact-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.about-contact-link:hover {
    text-decoration: underline;
}

.about-list {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.about-list li {
    margin-bottom: 0.5rem;
}

/* Contact page info grid */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.contact-info-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.contact-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.contact-info-value {
    font-size: 1rem;
    color: var(--text-primary);
}

.contact-email-link {
    color: var(--primary);
    text-decoration: none;
}

.contact-email-link:hover {
    text-decoration: underline;
}

/* About responsive — tablet */
@media (max-width: 900px) {
    .about-steps {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }

    .about-step {
        flex-direction: row;
        text-align: left;
        padding: 1.5rem;
    }

    .about-institutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* About responsive — mobile */
@media (max-width: 768px) {
    .about-hero h1 {
        font-size: 1.5rem;
    }

    .about-hero-text {
        font-size: 0.9375rem;
    }

    .about-audience-grid {
        grid-template-columns: 1fr;
    }

    .about-audience-card {
        padding: 1.25rem;
    }

    .about-sources-grid {
        grid-template-columns: 1fr;
    }

    .about-institutions-grid {
        grid-template-columns: 1fr;
    }

    .about-cta {
        padding: 2rem 1.25rem;
    }

    .about-cta-buttons .btn {
        min-height: 44px;
        width: 100%;
    }

    .about-cta-buttons {
        flex-direction: column;
    }

    .about-section-heading {
        font-size: 1.125rem;
    }
}

/* About responsive — small mobile */
@media (max-width: 480px) {
    .about-hero h1 {
        font-size: 1.25rem;
    }

    .about-steps {
        grid-template-columns: 1fr;
    }

    .about-step {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .about-institution-item {
        font-size: 0.8125rem;
        padding: 0.625rem 0.75rem;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Institution abbreviation badge on search result cards */
.inst-badge {
    background: #e8f4fd;
    color: #0369a1;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    display: inline-block;
    margin-left: 4px;
}

/* Last-active badge on search result cards */
.card-active-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 4px;
}
.active-recent   { background: #d1fae5; color: #065f46; }
.active-moderate { background: #dbeafe; color: #1e40af; }
.active-stale    { background: #fef3c7; color: #92400e; }
.active-old      { background: #f3f4f6; color: #6b7280; }

/* Match summary on search result cards */
.card-match-summary {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--accent);
    background: rgba(37, 99, 235, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 6px 10px;
    margin: 4px 0 8px;
    line-height: 1.45;
    font-style: italic;
}

.card-match-summary svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent);
    opacity: 0.8;
}

/* Load more button */
.load-more-btn {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.625rem 2rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.load-more-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}
.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ============================================================
   Designation Filter Pills
   Toggle-able pills for filtering by researcher designations.
   Used on both the directory page and search results.
   ============================================================ */

.designation-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.designation-filters-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
    user-select: none;
}

.designation-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: 1.5px solid transparent;
    user-select: none;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
}

/* Inactive (default) pill states — outlined */
.designation-pill[data-designation="federal_grant_pi"] {
    background: transparent;
    color: #0369a1;
    border-color: #0369a1;
}

.designation-pill[data-designation="high_impact"] {
    background: transparent;
    color: #92400e;
    border-color: #92400e;
}

.designation-pill[data-designation="ara_academy"] {
    background: transparent;
    color: #7c3aed;
    border-color: #7c3aed;
}

/* Active pill states — filled */
.designation-pill.active[data-designation="federal_grant_pi"] {
    background: #0369a1;
    color: #fff;
    border-color: #0369a1;
}

.designation-pill.active[data-designation="high_impact"] {
    background: #92400e;
    color: #fff;
    border-color: #92400e;
}

.designation-pill.active[data-designation="ara_academy"] {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

/* Hover states for inactive pills */
.designation-pill[data-designation="federal_grant_pi"]:not(.active):hover {
    background: rgba(3, 105, 161, 0.08);
}

.designation-pill[data-designation="high_impact"]:not(.active):hover {
    background: rgba(146, 64, 14, 0.08);
}

.designation-pill[data-designation="ara_academy"]:not(.active):hover {
    background: rgba(124, 58, 237, 0.08);
}

/* Active pill hover — slightly darker */
.designation-pill.active:hover {
    opacity: 0.9;
}

/* Clear filters link */
.designation-clear {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    padding: 0.25rem 0.375rem;
    display: none;
    transition: color var(--duration) var(--ease);
}

.designation-clear.visible {
    display: inline;
}

.designation-clear:hover {
    color: var(--text-secondary);
}

/* Designation badge in directory table rows */
.dir-designation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.dir-designation-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.075rem 0.375rem;
    border-radius: 100px;
    color: #fff;
    white-space: nowrap;
    line-height: 1.5;
}

.dir-designation-badge.desig-ara-academy   { background: #7c3aed; }
.dir-designation-badge.desig-federal-grant { background: #0369a1; }
.dir-designation-badge.desig-high-impact   { background: #92400e; }
.dir-designation-badge.desig-emeritus      { background: #64748b; }

/* Responsive: designation pills handled in main responsive blocks above */

/* ============================================================
   Data Provenance Page
   ============================================================ */

/* Sources grid — horizontal cards with icon */
.provenance-sources-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.provenance-source-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.provenance-source-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.provenance-source-icon svg {
    width: 22px;
    height: 22px;
}

.provenance-source-text {
    flex: 1;
    min-width: 0;
}

.provenance-source-text h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.125rem;
}

.provenance-source-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.provenance-source-text p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.provenance-source-link {
    margin-top: 0.375rem;
}

.provenance-source-link a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.provenance-source-link a:hover {
    text-decoration: underline;
}

/* Pipeline steps — numbered vertical timeline */
.provenance-pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1rem;
    position: relative;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.provenance-pipeline-step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem 0;
    position: relative;
    text-align: left;
}

.provenance-pipeline-step:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.provenance-pipeline-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.provenance-pipeline-content h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.provenance-pipeline-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Update frequency grid */
.provenance-frequency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.provenance-frequency-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: left;
}

.provenance-frequency-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.provenance-frequency-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.provenance-frequency-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Data Provenance responsive — tablet */
@media (max-width: 900px) {
    .provenance-frequency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Data Provenance responsive — mobile */
@media (max-width: 768px) {
    .provenance-source-card {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .provenance-frequency-grid {
        grid-template-columns: 1fr;
    }

    .provenance-pipeline-step {
        gap: 0.75rem;
    }

    .provenance-pipeline-number {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.875rem;
    }

    .provenance-pipeline-content h3 {
        font-size: 0.875rem;
    }

    .provenance-frequency-item {
        padding: 1rem;
    }
}

/* Verification status tooltip */
.status-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: help;
}

.status-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
}

.status-info .status-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 280px;
    padding: 0.625rem 0.75rem;
    background: var(--text);
    color: white;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: var(--radius);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-info .status-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text);
}

.status-info:hover .status-tooltip,
.status-info:focus-within .status-tooltip {
    display: block;
}

.status-tooltip a {
    color: #93c5fd;
    text-decoration: underline;
}

/* Toast close button */
.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

/* ============================================================================
   Topic Detail Page
   ============================================================================ */

.topic-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.topic-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topic-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.topic-narrative-section {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    position: relative;
}

.topic-narrative p {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 0.75rem 0;
}

.topic-narrative p:last-child {
    margin-bottom: 0;
}

.topic-narrative-ai-label {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.topic-stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.topic-filter-section {
    margin-bottom: 2rem;
}

.topic-filter-group {
    margin-bottom: 0.75rem;
}

.topic-filter-heading {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.topic-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.topic-pill:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

.topic-pill.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.topic-pill-count {
    font-size: 0.7rem;
    background: rgba(0,0,0,0.06);
    padding: 0.1rem 0.375rem;
    border-radius: 9999px;
    font-weight: 600;
}

.topic-pill.active .topic-pill-count {
    background: rgba(255,255,255,0.2);
}

.topic-section {
    margin-bottom: 2.5rem;
}

.topic-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.topic-section-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.topic-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.topic-researchers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.topic-researchers-table thead th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    user-select: none;
}

.topic-researchers-table thead th.sortable {
    cursor: pointer;
}

.topic-researchers-table thead th.sortable:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.topic-researchers-table thead th.sorted-desc::after {
    content: " \u25BC";
    font-size: 0.6rem;
    opacity: 0.7;
}

.topic-researchers-table thead th.sorted-asc::after {
    content: " \u25B2";
    font-size: 0.6rem;
    opacity: 0.7;
}

.topic-researchers-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s, box-shadow 0.15s;
}

.topic-researchers-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.topic-researchers-table tbody tr:hover {
    background: #eff6ff;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.topic-researchers-table tbody tr:last-child {
    border-bottom: none;
}

.topic-researchers-table td {
    padding: 0.75rem 1rem;
    color: #334155;
    vertical-align: middle;
}

.topic-researcher-link {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
}

.topic-researcher-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.topic-table-inst {
    color: #64748b;
    font-size: 0.8rem;
}

.topic-table-num {
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: 500;
}

.topic-table-stage {
    font-size: 0.8rem;
    color: #64748b;
}

.topic-table-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.topic-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-ara {
    background: #dbeafe;
    color: #1e40af;
}

.badge-grant, .badge-grant-sm {
    background: #dcfce7;
    color: #166534;
}

.badge-impact {
    background: #fef3c7;
    color: #92400e;
}

/* Related topics chips */
.related-topics-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.related-topic-chip:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.related-topic-name {
    font-weight: 500;
}

.related-topic-count {
    font-size: 0.7rem;
    background: #e2e8f0;
    color: #475569;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    font-weight: 600;
}

/* Bridge cards */
.bridge-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bridge-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: border-color 0.15s;
}

.bridge-card:hover {
    border-color: #94a3b8;
}

.bridge-side {
    flex: 1;
    min-width: 0;
}

.bridge-name {
    display: block;
    color: #1e40af;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bridge-name:hover {
    text-decoration: underline;
}

.bridge-inst {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bridge-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    flex-shrink: 0;
    width: 3.5rem;
    color: #94a3b8;
}

.bridge-score {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
}

.bridge-line {
    width: 2.5rem;
    height: 1.25rem;
}

/* Grant PIs compact list */
.topic-grantpi-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.625rem;
}

.topic-grantpi-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #22c55e;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #334155;
    transition: all 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.topic-grantpi-item:hover {
    border-color: #94a3b8;
    border-left-color: #16a34a;
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.topic-grantpi-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e40af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-grantpi-inst {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.topic-grantpi-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #166534;
    background: #dcfce7;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* CTA section */
.topic-cta-section {
    text-align: center;
    padding: 2rem 0 1rem;
}

.topic-browse-btn {
    display: inline-block;
    font-size: 0.95rem;
}

/* Responsive: topic detail */
@media (max-width: 768px) {
    .topic-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .topic-researchers-table {
        font-size: 0.8rem;
    }
    .topic-researchers-table td,
    .topic-researchers-table th {
        padding: 0.5rem 0.625rem;
    }
    .bridge-card {
        flex-direction: column;
        text-align: center;
    }
    .bridge-side {
        width: 100%;
    }
    .bridge-connector {
        flex-direction: row;
        width: auto;
    }
    .bridge-line {
        width: 1.5rem;
    }
    .topic-grantpi-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .topic-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .topic-stat-card {
        padding: 0.875rem;
    }
    .topic-stat-value {
        font-size: 1.35rem;
    }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
