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

/* Light theme (default) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-card: #f5f5f5;
    --bg-hover: #eeeeee;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent-green: #059669;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;
    --accent-red: #dc2626;
    --border: #e5e5e5;
}

/* Dark theme - auto from system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #141414;
        --bg-card: #1a1a1a;
        --bg-hover: #252525;
        --text-primary: #f0f0f0;
        --text-secondary: #a0a0a0;
        --text-muted: #707070;
        --accent-green: #10b981;
        --accent-blue: #3b82f6;
        --accent-purple: #8b5cf6;
        --accent-pink: #ec4899;
        --accent-red: #ef4444;
        --border: #2a2a2a;
    }
}

/* Manual override: force dark */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-red: #ef4444;
    --border: #2a2a2a;
}

/* Manual override: force light */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-card: #f5f5f5;
    --bg-hover: #eeeeee;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent-green: #059669;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;
    --accent-red: #dc2626;
    --border: #e5e5e5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-sep {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-home, .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-home:hover, .nav-link:hover {
    color: var(--text-primary);
}

.logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 0.5rem;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.75rem;
}

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

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.theme-toggle-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.theme-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background 0.2s;
}

.theme-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

/* Toggle active state for manual dark mode */
[data-theme="dark"] .theme-switch {
    background: #3b82f6;
    border-color: #3b82f6;
}

[data-theme="dark"] .theme-switch::after {
    transform: translateX(20px);
    background: white;
}

/* Toggle active state for system dark mode (when no manual override) */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .theme-switch {
        background: #3b82f6;
        border-color: #3b82f6;
    }

    html:not([data-theme="light"]) .theme-switch::after {
        transform: translateX(20px);
        background: white;
    }
}

.theme-toggle:hover .theme-switch {
    border-color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-green);
}

.stat-card.purple::before {
    background: var(--accent-purple);
}

.stat-card.blue::before {
    background: var(--accent-blue);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Period Tabs (Today/Week/Month) */
.period-tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    width: fit-content;
    border: 1px solid var(--border);
}

.period-tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.period-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.period-tab-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

[data-theme="dark"] .period-tab-btn.active {
    background: #f5f5f5;
    color: #0a0a0a;
}

.period-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.period-content.active {
    display: block;
}

/* Trending Section */
.trending-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.trending-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.trending-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.trending-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trending-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.trend-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 0.625rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.trend-pill:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.trend-badge {
    background: var(--accent-green);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.trend-badge.down {
    background: var(--accent-red);
}

.rank-shift {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.rank-shift.up {
    color: var(--accent-green);
}

.rank-shift.down {
    color: var(--accent-red);
}

.trend-group {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
}

.trend-group-prefix {
    font-size: 0.7rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-right: 0.25rem;
}

.trend-group-prefix::after {
    content: '/';
    margin-left: 0.25rem;
    color: var(--text-muted);
}

.trending-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.trending-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-summary li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.trending-summary li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

/* Top Repos Section */
.top-repos-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top-repos-summary {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 0.75rem;
    border-left: 3px solid var(--accent-green);
}

.top-repos-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-repos-summary li {
    padding: 0.35rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.top-repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding-top: 4px;  /* Room for hover lift effect */
}

.top-repo-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.top-repo-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.top-repo-meta .lang {
    color: var(--accent-blue);
}

.top-repo-meta .stars {
    color: var(--text-muted);
}

.top-repo-meta .stars-gained {
    color: #f97316;
    font-weight: 600;
    font-size: 0.8rem;
}

.repo-activity {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.repo-bullets {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.repo-bullets li {
    margin-bottom: 0.2rem;
}

.top-repo-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.top-repo-abstract {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.top-repo-link {
    text-decoration: none;
    display: block;
}

.top-repo-link:hover {
    text-decoration: none;
}

.top-repo-link:hover .top-repo-name,
.top-repo-link:hover .top-repo-desc {
    text-decoration: none;
}

.top-repo-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.top-repo-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* GitHub language sections */
.gh-category {
    margin-bottom: 1.25rem;
}

.gh-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-primary);
    border-radius: 0.375rem;
}

.gh-cat-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.gh-cat-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}

.gh-repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.gh-repo-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.gh-repo-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.gh-repo-link {
    text-decoration: none;
    display: block;
}

.gh-repo-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.gh-repo-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.gh-repo-meta .stars-gained {
    color: #f97316;
    font-weight: 600;
}

.gh-repo-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.see-all-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.see-all-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.repo-extras {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.repo-extra-item {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.repo-extra-item:hover {
    color: var(--accent-blue);
}

.extra-type {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    font-weight: 500;
}

.extra-type.issue {
    background: #fef3c7;
    color: #92400e;
}

.extra-type.disc {
    background: #dbeafe;
    color: #1e40af;
}

.issue-label {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* Collapsible sections */
.section-header.clickable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collapsible .section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible .section-content.expanded {
    max-height: none;
}

.section-header .expand-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.section-header.collapsed .expand-icon {
    transform: rotate(-90deg);
}

/* Compact language cards grid */
.lang-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

.lang-card {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.lang-card:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.lang-card.active {
    background: var(--bg-card);
    border-color: var(--accent);
}

.lang-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.lang-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lang-card-stars {
    color: #f97316;
}

.lang-details-container {
    margin-top: 0.5rem;
}

.lang-details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: slideDown 0.2s ease;
}

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

.lang-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.close-details {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.close-details:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Group sections */
.group-section {
    margin-bottom: 1rem;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-header:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.group-header.expanded {
    border-radius: 0.375rem 0.375rem 0 0;
    border-bottom-color: transparent;
}

.group-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.group-indicator {
    width: 4px;
    height: 40px;
    border-radius: 2px;
}

.group-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.group-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.group-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.group-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

.expand-icon {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.group-header.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Group details */
.group-details {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    padding: 1.25rem;
}

.group-details.expanded {
    display: block;
}

.group-summary {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    border-left: 3px solid var(--accent-blue);
}

.summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.summary-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

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

.summary-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-green);
}

/* Category grid */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.cat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cat-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.cat-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cat-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.cat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.cat-trend.up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.cat-trend.down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.cat-trend.stable {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.cat-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cat-summary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cat-summary ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-summary li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.35rem;
}

.cat-summary li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-size: 0.75rem;
}

.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.spark-bar {
    flex: 1;
    background: linear-gradient(to top, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
    min-height: 3px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cat-card:hover .spark-bar {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    max-width: 700px;
    width: 100%;
    margin-top: 3rem;
    animation: modalIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-summary {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
    border-left: 3px solid var(--accent-green);
}

.paper-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.paper-title {
    color: var(--accent-green);
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}

a.paper-title:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

a.paper-title::after {
    content: ' ↗';
    font-size: 0.8em;
    opacity: 0.6;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-green);
}

/* Today's Pulse Section - prominent hero area */
.pulse-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pulse-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pulse-title::before {
    content: '⚡';
    margin-right: 0.5rem;
}

.pulse-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pulse-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.pulse-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pulse-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pulse-link {
    color: var(--text-primary);
    text-decoration: none;
}

.pulse-link:hover {
    color: var(--accent-blue);
}

/* Pulse plates grid - larger, more prominent */
.pulse-plates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.pulse-plate {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 4px solid var(--border);
}

/* Source-colored left borders - always visible */
.pulse-plate.reddit { border-left-color: #ff4500; }
.pulse-plate.github { border-left-color: var(--accent-green); }
.pulse-plate.academia { border-left-color: var(--accent-purple); }
.pulse-plate.industry { border-left-color: var(--accent-blue); }

.pulse-plate:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.pulse-plate.reddit:hover { background: rgba(255, 69, 0, 0.03); }
.pulse-plate.github:hover { background: rgba(16, 185, 129, 0.03); }
.pulse-plate.academia:hover { background: rgba(139, 92, 246, 0.03); }
.pulse-plate.industry:hover { background: rgba(59, 130, 246, 0.03); }

.pulse-plate-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pulse-plate-icon {
    font-size: 1.25rem;
}

.pulse-plate-source {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pulse-plate-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.pulse-plate-bullets {
    margin: 0.75rem 0 0 0;
    padding: 0 0 0 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-left: 2px solid var(--border);
}

.pulse-plate-bullets li {
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
}

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

.pulse-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pulse-badge:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.pulse-badge.reddit:hover {
    border-color: #ff4500;
    color: #ff4500;
}

.pulse-badge.github:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.pulse-badge.research:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Expandable Sections (Accordion) */
.expandable-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.section-header:hover {
    background: var(--bg-tertiary);
}

.section-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}

.section-toggle {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-muted);
    width: 1.5rem;
    text-align: center;
}

.section-content {
    display: none;
    padding: 0 1.25rem 1.25rem;
}

.expandable-section.expanded .section-content {
    display: block;
}

.expandable-section.expanded .section-toggle {
    transform: rotate(0deg);
}

/* Mobile: all sections collapsed by default */
@media (max-width: 768px) {
    .expandable-section {
        margin-bottom: 0.5rem;
    }

    .expandable-section.expanded .section-content {
        display: block;
    }

    .section-header {
        padding: 0.875rem 1rem;
    }

    .section-content {
        padding: 0 1rem 1rem;
    }

    .pulse-section {
        padding: 1rem;
    }

    .pulse-badges {
        justify-content: center;
    }
}

/* Navigation */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-home {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a.active {
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .nav-bar {
        flex-direction: column;
        gap: 1rem;
    }
    .nav-links {
        gap: 1rem;
    }
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Period tabs (Today/Week/Month) - make scrollable */
    .period-tabs-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .period-tabs-container::-webkit-scrollbar {
        display: none;
    }
    .period-tab-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .trending-pills {
        flex-direction: column;
    }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-repos-grid {
        grid-template-columns: 1fr;
    }

    .group-right {
        gap: 1rem;
    }

    .group-count {
        font-size: 1.25rem;
    }

    .group-header {
        padding: 1rem;
    }

    .group-info h3 {
        font-size: 1rem;
    }

    /* Header responsive */
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-left {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .tagline {
        display: none;
    }

    .last-updated {
        font-size: 0.75rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    /* Modal responsive */
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        width: 100%;
        max-width: none;
        border-radius: 0.5rem;
        margin-top: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1rem;
    }

    .paper-item {
        padding: 0.75rem 0;
    }

    .paper-title {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .header-sep {
        display: none;
    }

    .nav-home, .nav-link, .logo {
        font-size: 0.85rem;
    }

    /* Stack stats vertically on small screens */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Period tabs - compact */
    .period-tabs-container {
        padding: 0.375rem;
        gap: 0.25rem;
    }

    .period-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .period-tab-btn .tab-count {
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem;
    }

    /* Category grid */
    .cat-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .cat-card {
        padding: 1rem;
    }

    .cat-count {
        font-size: 1.5rem;
    }

    /* Group sections */
    .group-left {
        gap: 0.5rem;
    }

    .group-indicator {
        height: 30px;
    }

    .group-meta {
        font-size: 0.75rem;
    }

    /* Trending section */
    .trending-section,
    .top-repos-section {
        padding: 1rem;
    }

    .trend-pill {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Highlights */
    .highlight-item {
        padding: 0.625rem;
    }

    .highlight-title {
        font-size: 0.8rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .period-tab-btn .tab-count {
        display: none;
    }

    .period-tab-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pulse-badge {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
}

/* Trending Plates Grid (Research categories) */
.trending-plates-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.trending-plate {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.875rem;
    transition: all 0.2s ease;
}

.trending-plate:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.trending-plate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.trending-plate-group {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.trending-plate-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.trending-plate-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.trending-plate-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trending-plate-cat {
    font-family: 'Monaco', 'Menlo', monospace;
    background: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.trending-plate-count {
    color: var(--text-secondary);
}

@media (max-width: 1200px) {
    .trending-plates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .trending-plates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* HN source styling for pulse */
.pulse-plate.hn { border-left-color: #ff6600; }
.pulse-plate.hn:hover { background: rgba(255, 102, 0, 0.03); }
.pulse-badge.hn:hover {
    border-color: #ff6600;
    color: #ff6600;
}

/* HuggingFace Papers source styling for pulse */
.pulse-plate.hf { border-left-color: #ffcc00; }
.pulse-plate.hf:hover { background: rgba(255, 204, 0, 0.03); }
.pulse-badge.hf:hover {
    border-color: #ffcc00;
    color: #b8860b;
}

/* HuggingFace Daily Papers Section */
.hf-papers-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.hf-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.hf-icon {
    font-size: 1.25rem;
}

.hf-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hf-badge {
    font-size: 0.7rem;
    background: #ffcc00;
    color: #1a1a1a;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
    margin-left: auto;
}

.hf-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0.75rem 0 0.5rem 0;
}

/* Top Highlighted Papers Grid */
.hf-papers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.hf-paper-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
}

.hf-paper-card:hover {
    border-color: #ffcc00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hf-paper-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hf-paper-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.hf-upvotes {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ff6600;
}

.hf-paper-org {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.hf-paper-summary {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hf-paper-bullets {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    padding-left: 1rem;
}

.hf-paper-bullets li {
    margin-bottom: 0.25rem;
}

/* Tags */
.hf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.hf-tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.hf-tag-count {
    font-weight: 600;
    color: var(--text-muted);
}

/* All Papers List */
.hf-all-papers-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hf-all-paper-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.hf-all-paper-item:hover {
    background: var(--bg-primary);
}

.hf-all-paper-item .hf-upvotes {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ff6600;
    min-width: 35px;
}

.hf-all-paper-title {
    font-size: 0.8rem;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hf-all-paper-item .hf-paper-org {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    white-space: nowrap;
}

/* Trending Categories Grid */
.hf-categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hf-category-chip {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.hf-category-chip:hover {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.05);
}

.hf-cat-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hf-cat-stats {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Academia & Industry Highlights Container */
.hf-highlights-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

.hf-highlights-column {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.hf-column-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.hf-highlights-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hf-highlight-item {
    display: block;
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.hf-highlight-item:hover {
    background: var(--bg-secondary);
}

.hf-highlight-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.hf-highlight-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.hf-highlight-meta span:first-child {
    color: #ff6600;
    font-weight: 600;
}

.hf-authors, .hf-org {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Research Institutions Section (compact layout) */
.institutions-section .group-details {
    padding: 0.75rem;
}

.institutions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.institution-column {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.institution-column-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.institution-papers-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.institution-paper-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.375rem;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.institution-paper-item:hover {
    background: var(--bg-secondary);
}

.institution-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.institution-paper-title {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Mobile Responsive: Stack layouts vertically */
@media (max-width: 1024px) {
    .hf-papers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hf-papers-section {
        padding: 0.75rem;
    }

    .hf-papers-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .hf-paper-card {
        padding: 0.625rem;
    }

    .hf-paper-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .hf-paper-summary {
        -webkit-line-clamp: 2;
    }

    .hf-highlights-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .hf-highlights-column {
        padding: 0.625rem;
    }

    .institutions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .institution-column {
        padding: 0.625rem;
    }

    .hf-categories-grid {
        gap: 0.375rem;
    }

    .hf-category-chip {
        padding: 0.3rem 0.5rem;
    }

    .hf-cat-name {
        font-size: 0.75rem;
    }

    .hf-cat-stats {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .hf-header {
        flex-wrap: wrap;
    }

    .hf-badge {
        font-size: 0.65rem;
    }

    .hf-highlight-title {
        font-size: 0.75rem;
    }

    .hf-highlight-meta {
        font-size: 0.65rem;
    }

    .institution-name {
        font-size: 0.7rem;
    }

    .institution-paper-title {
        font-size: 0.75rem;
    }
}
/* Filter buttons for publications */
.filter-bar {
    border-bottom: 1px solid var(--border);
}

.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Section header as button - reset styles */
button.section-header {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font: inherit;
}

button.section-header:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Mobile improvements */
@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .header-left {
        flex-wrap: wrap;
    }

    .tagline {
        display: none;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .filter-bar {
        justify-content: flex-start !important;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .top-repo-name {
        font-size: 0.9rem;
    }

    .top-repo-meta {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .lang-cards-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Fix padding on publication cards */
.pub-item {
    padding: 1rem !important;
    margin-bottom: 0.5rem;
}

.pub-item .top-repo-link {
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.pub-item .top-repo-name {
    padding-right: 0.5rem;
}

/* Stance card hover for history */
.lang-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lang-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stance-history {
    display: block;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.stance-history-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    color: var(--text-muted);
}

.next-meeting {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: var(--bg-card);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--accent-blue);
}

.next-meeting-label {
    color: var(--text-muted);
}

/* Bank Quick Navigation */
.bank-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.bank-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.bank-nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.bank-nav-btn .flag {
    font-size: 0.9rem;
}

/* Data Coverage Indicator */
.coverage-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.6rem;
    font-weight: 600;
}

.coverage-badge.high {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.coverage-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.coverage-badge.low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Improved table scrolling on mobile */
.table-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-secondary);
}

.table-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

/* Scroll hint for mobile */
.scroll-hint {
    display: none;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.25rem;
}

@media (max-width: 768px) {
    .scroll-hint {
        display: block;
    }

    .bank-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .bank-nav-btn {
        flex-shrink: 0;
    }
}

/* Minimum font size improvements */
@media (max-width: 480px) {
    .top-repo-meta, .pub-item .top-repo-meta {
        font-size: 0.75rem;
    }

    .section-content table {
        font-size: 0.75rem;
    }

    .section-content td {
        padding: 0.2rem;
    }
}

/* Expandable Bank Rows */
.bank-summary-row {
    transition: background 0.2s ease;
}

.bank-summary-row:hover {
    background: var(--bg-hover);
}

.bank-summary-row.expanded {
    background: var(--bg-card);
}

.bank-summary-row .expand-indicator {
    transition: transform 0.2s ease;
}

.bank-details-row {
    animation: slideDown 0.2s ease;
}

.bank-details-row td {
    padding: 0 !important;
}

/* Bank details trends grid - responsive */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    align-items: end;
}

@media (max-width: 640px) {
    .trends-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .trends-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Touch-friendly minimum sizes */
.bank-summary-row,
.expandable-section .section-header {
    min-height: 48px;
}

@media (max-width: 768px) {
    .filter-btn {
        min-height: 40px;
        min-width: 40px;
        padding: 0.5rem 0.75rem;
    }

    .expand-all-btn,
    .collapse-all-btn {
        min-height: 40px;
        padding: 0.5rem 1rem !important;
    }

    .bank-nav-btn {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
    }
}

/* Expand/Collapse buttons */
.expand-collapse-all {
    justify-content: flex-end;
}

.expand-all-btn:hover,
.collapse-all-btn:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Accent gold color for rates */
:root {
    --accent-gold: #d4a853;
}

[data-theme="dark"] {
    --accent-gold: #f0c674;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --accent-gold: #f0c674;
    }
}

/* Make policy rate more prominent in summary */
.bank-summary-row td:nth-child(2) {
    min-width: 80px;
}

/* Hide extra columns on mobile */
@media (max-width: 768px) {
    .bank-summary-row .extra-col,
    thead .extra-col {
        display: none !important;
    }
}

/* Show extra columns on wider screens */
@media (min-width: 1024px) {
    .bank-summary-row .extra-col,
    thead .extra-col {
        display: table-cell !important;
    }
}

/* Economic indicators table mobile optimization */
@media (max-width: 640px) {
    /* Stack bank name and flag vertically on small screens */
    .bank-summary-row td:first-child {
        padding: 0.5rem 0.25rem;
    }

    .bank-summary-row td:first-child > div {
        gap: 0.25rem !important;
    }

    /* Reduce sparkline column width */
    .bank-summary-row td:nth-last-child(2) {
        padding: 0.25rem !important;
    }

    /* Compact the rate/FX sparklines */
    .bank-summary-row td:nth-last-child(2) > div {
        gap: 0.25rem !important;
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    /* Hide M2 and Trade columns on very small screens */
    .bank-summary-row td:nth-child(6),
    .bank-summary-row td:nth-child(7),
    thead th:nth-child(6),
    thead th:nth-child(7) {
        display: none;
    }

    /* Reduce padding in table cells */
    .bank-summary-row td {
        padding: 0.375rem 0.25rem !important;
    }

    /* Smaller bank name font */
    .bank-summary-row td:first-child div[style*="font-weight: 600"] {
        font-size: 0.8rem !important;
    }

    /* Hide sparklines on very small screens, show only current values */
    .bank-summary-row td:nth-last-child(2) {
        display: none;
    }

    thead th:nth-last-child(2) {
        display: none;
    }
}
