.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

.page-title {
    margin-top: var(--spacing-md) !important;
    margin-bottom: var(--spacing-sm) !important;
}

.header {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 40px;
    padding-top: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px var(--shadow-color);
    color: var(--logo-teal)
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--text-muted);
    text-align: center;
    margin: 10px 0;
    font-weight: 500;
}

.collapsible-section {
    margin-bottom: 1rem;
    overflow: hidden
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 0, 0, 0.02) 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative
}

.collapsible-header:hover {
    background: var(--color-gray-200);
    color: var(--logo-teal)
}

.collapsible-header :is(h1, h2) {
    font-size: 1.8rem;
    color: var(--accent-primary);
    margin: 0;
    line-height: 1.2
}

.collapse-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--logo-teal);
    transition: transform 0.3s ease
}

.collapse-toggle.collapsed {
    transform: rotate(180deg)
}

.collapsible-content {
    background: var(--bg-primary);
    padding: 1rem;
    border: none;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    overflow: visible
}

.collapsible-content.collapsed {
    max-height: 0;
    padding: 0 1rem;
    opacity: 0
}

.filters {
    margin-bottom: 15px;
    overflow: visible;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    padding: 10px 0;
    transition: box-shadow 0.2s ease;
}

.filters.stuck {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.filter-group {
    position: relative;
    display: inline-block;
}

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: var(--control-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-card);
}

.filter-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.filter-dropdown-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.filter-text {
    display: inline;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
}

.filter-btn.active .filter-icon {
    color: var(--bg-primary);
}

@media (prefers-color-scheme: dark) {
    .filter-btn.active {
        color: #ffffff;
    }

    .filter-btn.active .filter-icon {
        color: #ffffff;
    }

    /* change-metric icons remain same colors in dark mode */
    .change-metric-title-icon.change-positive {
        color: #22c55e;
    }

    .change-metric-title-icon.change-negative {
        color: #ef4444;
    }
}
.desktop-filters {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.mobile-filters {
    display: inline-block;
}

@media (min-width: 769px) {
    .mobile-filters {
        display: none;
    }

    .desktop-filters {
        display: flex;
    }
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scaleY(0.95);
    transform-origin: top left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
}

.filter-dropdown.open {
    max-height: min(70vh, 600px);
    opacity: 1;
    transform: translateY(0) scaleY(1);
    pointer-events: auto;
    overflow-y: auto;
}

.filter-group.open .filter-dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--text-primary);
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--logo-teal);
}

.dropdown-item:hover i {
    color: var(--logo-teal);
}

.dropdown-item.active {
    background: var(--bg-secondary);
    color: var(--logo-teal);
    font-weight: 600;
}

.dropdown-item.active i {
    color: var(--logo-teal);
}



.categories {
    display: grid;
    gap: 15px
}

.category {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--card-radius);
    padding: 0.5rem clamp(1rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    word-break: break-word
}

.category:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15)
}

.category-title {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    color: var(--accent-primary);
    margin-top: 0;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--logo-teal);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px
}

.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    color: var(--logo-teal);
    transition: transform 0.2s ease, color 0.2s ease
}

.category:hover .category-icon {
    transform: scale(1.1);
    color: var(--logo-orange)
}

.category-icon i {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center
}

.category-name {
    position: relative;
    top: 1px
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: start
}

.indicator {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: var(--card-radius);
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: hidden;
}

.indicator:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--logo-teal);
}

.indicator-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.indicator-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    word-break: normal;
    overflow-wrap: normal;
}

.data-headers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
}

.data-header-left,
.data-header-right {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.data-header-right {
    text-align: right;
    margin-left: auto;
}

.indicator-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.indicator-agency {
    font-size: 0.70rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    margin-bottom: 2px;
    display: block;
    position: relative;
    z-index: 1;
}

.indicator-agency a {
    color: var(--text-muted);
    text-decoration: underline;
}

.indicator-date {
    color: var(--logo-teal);
    font-weight: 600;
}

.indicator.expanded .indicator-agency {
    margin-bottom: 6px;
}

.indicator-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.data-rows-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.indicator.expanded .data-rows-container {
    max-height: 500px;
    /* Arbitrary large height */
    margin-top: 0;
}

.latest-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    margin-bottom: 0;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.month-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    word-break: keep-all;
    hyphens: none;
    cursor: help;
}

.month-label[title] {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.month-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.month-change,
.job-change-inline {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 600;
}

.change-indicators {
    margin: 4px 0 6px 0;
    padding-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.change-metric-block {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.change-metric-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
}

.change-metric-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

.change-metric-title-icon i {
    width: 8px;
    height: 8px;
    stroke-width: 2.1px;
}

.change-metric-btn {
    flex: 0 0 auto;
    width: fit-content;
    min-width: fit-content;
    max-width: none;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    white-space: nowrap;
    overflow: visible;
    box-sizing: border-box;
    position: relative;
    box-shadow: none;
    transform: translateY(0);
    transition: color 0.12s ease;
}

.change-metric-btn:hover {
    filter: none;
    border-color: transparent;
}

.change-metric-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.change-metric-btn:focus-visible {
    outline: none;
    outline-offset: 0;
}

.change-metric-btn:only-child {
    max-width: 100%;
}

.change-metric-top {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 1px;
    gap: 4px;
}

.change-metric-top .change-metric-title-icon {
    margin-left: auto;
}

.change-metric-main {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.change-metric-value {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.005em;
    flex-shrink: 0;
    line-height: 1;
    text-align: right;
}

.change-metric-btn.change-positive .change-metric-value {
    color: #22c55e;
}

.change-metric-btn.change-negative .change-metric-value {
    color: #ef4444;
}

.change-metric-btn.change-positive,
.change-metric-btn.change-negative,
.change-metric-btn.change-neutral {
    background: transparent;
    border-color: transparent;
}

.change-metric-title-icon.change-positive {
    color: #22c55e;
}

.change-metric-title-icon.change-negative {
    color: #ef4444;
}

.change-metric-title-icon.change-neutral {
    color: #d1d5db;
}



.expand-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    width: 24px;
    height: 24px;
}

.expand-toggle:hover {
    background: var(--bg-secondary);
    color: var(--logo-teal);
}

.expand-toggle i {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.indicator.expanded .expand-toggle i {
    transform: rotate(180deg);
}

.prediction-toggle-container {
    margin: 1rem 0;
    text-align: center
}

.prediction-toggle-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--control-radius);
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.prediction-toggle-btn:hover {
    background: var(--logo-orange);
    color: var(--color-white);
    border-color: var(--logo-orange);
    transform: translateY(-1px)
}

.prediction-toggle-btn i {
    width: 16px;
    height: 16px
}

.prediction-markets-hidden {
    display: none !important
}

.prediction-bar-container {
    margin: 6px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prediction-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prediction-bar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    flex-shrink: 0;
}

.prediction-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.prediction-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.prediction-bar-fill.yes-bar {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

.prediction-bar-fill.no-bar {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.prediction-bar-value {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 32px;
    text-align: right;
}

.prediction-bar-value.yes-value {
    color: #22c55e;
}

.prediction-bar-value.no-value {
    color: #ef4444;
}

.prediction-change {
    font-size: 0.65rem;
    margin-left: 4px;
    font-weight: 600;
}

.prediction-change.positive {
    color: #22c55e;
}

.prediction-change.negative {
    color: #ef4444;
}

.prediction-dual-bar .prediction-bar-track {
    display: flex;
    flex-direction: row;
    height: 12px;
    position: relative;
}

.prediction-dual-bar .yes-bar {
    border-radius: 4px 0 0 4px;
    flex: 0 0 auto;
}

.prediction-dual-bar .no-bar {
    border-radius: 0 4px 4px 0;
    flex: 0 0 auto;
}

/* Special styling for dual bar value row */
.prediction-dual-bar .prediction-bar-row:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.prediction-yes-section,
.prediction-no-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.prediction-bar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.prediction-bar-value {
    font-size: 0.85rem;
    font-weight: 700;
}



/* Ensure Financial Markets cards are narrow like the rest */
.category[data-category="Financial Markets"] .indicators-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category[data-category="Financial Markets"] .indicator {
    max-width: 100%;
    min-width: 0;
}

.category[data-category="Financial Markets"] .indicator-name {
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 0.8rem;
}

.category[data-category="Financial Markets"] .month-value {
    font-size: 0.75rem;
}


/* Card Chart Overlay Styles */
/* Chart overlay for modal-like display of charts */
.chart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    border-radius: var(--card-radius);
    display: none;
    flex-direction: column;
    z-index: 100;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
    -webkit-border-radius: var(--border-radius);
    will-change: opacity, transform;
}

.chart-overlay.show {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.chart-overlay-header {
    display: none;
}

.chart-overlay-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.chart-overlay-title i {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

.chart-overlay-title-floating {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 40px;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-overlay-close {
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.chart-overlay-close:hover {
    background: var(--logo-teal);
    color: var(--color-white);
    border-color: var(--logo-teal);
}

.chart-overlay-range-picker {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 8px 4px 8px;
    justify-content: flex-start;
}

.chart-overlay-range-picker .chart-overlay-close {
    margin-left: auto;
}

.chart-overlay-range-picker .range-btn {
    padding: 2px 8px;
    font-size: 0.7rem;
}

.chart-overlay-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    position: relative;
}

.chart-overlay-body .chart-overlay-canvas {
    flex: 1;
    min-height: 0;
    width: 100% !important;
    height: 100% !important;
    background: var(--bg-primary);
}

.chart-overlay-canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    background: var(--bg-primary);
}

.chart-overlay-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.chart-overlay-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-gray-200);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.chart-overlay-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.chart-overlay-error-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Enhanced icon styling for info and chart icons */
:is(.info-icon, .chart-icon) {
    transition: var(--transition-hover);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 24px !important;
    color: var(--text-muted) !important;
}

:is(.info-icon, .chart-icon):hover {
    background: var(--bg-secondary);
    color: var(--logo-teal) !important;
}

:is(.info-icon, .chart-icon).active {
    background: var(--logo-teal);
    color: #000000 !important;
}

.info-btn,
.chart-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-hover);
}

.info-btn:hover .info-icon,
.chart-btn:hover .chart-icon {
    background: var(--bg-secondary);
    color: var(--logo-teal) !important;
}

.info-btn.active .info-icon,
.chart-btn.active .chart-icon {
    background: var(--logo-teal);
    color: #000000 !important;
}

/* Ensure tooltip is always on top */
#filter-tooltip {
    position: fixed !important;
    z-index: 2147483647 !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
    will-change: transform, opacity !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-transform: translateZ(0) !important;
    -webkit-perspective: 1000px !important;
    perspective: 1000px !important;
    pointer-events: none !important;
}

/* Mobile responsiveness for filters */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--mobile-padding);
    }

    .filters-wrapper {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0.6rem 1rem;
    }

    .filter-dropdown {
        left: 0;
        right: 0;
        min-width: auto;
    }

    .collapsible-content {
        padding: var(--mobile-padding);
    }

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

    .indicator {
        padding: 0.5rem;
        border-radius: 6px;
    }

    .data-row {
        padding: 3px 0;
        gap: 4px;
    }

    .month-label {
        font-size: 0.63rem;
    }

    .month-value {
        font-size: 0.68rem;
        gap: 2px;
    }

    .category-title {
        font-size: clamp(1rem, 4vw, 1.4rem);
        gap: 6px;
    }

    .category-icon {
        width: 1.25em;
        height: 1.25em;
    }

    .data-row {
        padding: 4px 0;
    }

    .change-indicators {
        gap: 4px;
    }

    .change-metric-title {
        font-size: 0.58rem;
    }

    .change-metric-title-icon,
    .change-metric-title-icon i {
        width: 7px;
        height: 7px;
    }

    .change-metric-value {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .page-title {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .collapsible-header :is(h1, h2) {
        font-size: 1.3rem;
    }

    .collapsible-header {
        padding: 0.5rem 0.75rem;
    }

    .collapse-toggle {
        font-size: 1.2rem;
    }

    .filters-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .filter-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

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

    .indicator {
        padding: 0.4rem;
        border-radius: 6px;
        gap: 0.2rem;
    }

    .indicator-name {
        font-size: 0.8rem;
    }

    .indicator-header {
        gap: 3px;
    }

    .indicator-agency {
        font-size: 0.7rem;
    }

    .latest-data-row {
        padding: 2px 0;
    }

    .data-label,
    .data-value {
        font-size: 0.75rem;
    }

    .data-row {
        padding: 2px 0;
        gap: 3px;
    }

    .month-label {
        font-size: 0.6rem;
    }

    .month-value {
        font-size: 0.63rem;
        gap: 2px;
    }

    .change-indicator {
        font-size: 0.65rem;
        padding: 1px 3px;
    }

    .category {
        padding: 0.75rem 0.5rem;
    }

    .change-indicators {
        flex-wrap: wrap;
        gap: 6px;
    }

    .change-metric-btn {
        font-size: 0.7rem;
    }

    .change-metric-title {
        font-size: 0.55rem;
    }

    .change-metric-value {
        font-size: 0.75rem;
    }
}

/* Extra tiny screens */
@media (max-width: 360px) {
    .page-title {
        font-size: 1.4rem;
    }

    .indicator-name {
        font-size: 0.8rem;
    }

    .indicator {
        padding: 0.4rem;
    }

    .indicators-grid {
        gap: 0.35rem;
    }

    .filter-btn {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }

    .collapsible-header :is(h1, h2) {
        font-size: 1.1rem;
    }
}

/* Chart Modal - Hidden by default */
.chart-modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.chart-modal-content {
    background: var(--bg-primary);
    margin: 3vh auto;
    padding: 0;
    border: 1px solid var(--border-color);
    width: 92%;
    max-width: 820px;
    border-radius: var(--card-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 94vh;
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
    order: 1;
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

#closeChartModal {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

#closeChartModal:hover {
    background: var(--logo-teal);
    color: #fff;
    border-color: var(--logo-teal);
}

.chart-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    min-height: 320px;
    height: 50vh;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
    order: 3;
}

.chart-modal-body canvas {
    flex: 1;
    min-height: 240px;
    width: 100% !important;
    height: 100% !important;
}

/* Search */
.search-wrapper {
    position: relative;
    max-width: 280px;
    margin: 10px auto 0;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.indicator-search {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.indicator-search:focus {
    border-color: var(--logo-teal);
    box-shadow: 0 0 0 2px rgba(44, 95, 90, 0.15);
}

.indicator-search::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
}

.empty-state i {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* Chart modal date range picker */
.chart-modal-range-picker {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
    order: 2;
}

.chart-modal-range-picker #closeChartModal {
    margin-left: auto;
}

.range-btn {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.range-btn.active {
    background: var(--logo-teal);
    color: #fff;
    border-color: var(--logo-teal);
}

/* Sparkline - full card background */
.sparkline-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
}

.sparkline-container canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Indicator keyboard focus */
.indicator:focus-visible {
    outline: 2px solid var(--logo-teal);
    outline-offset: 2px;
}

.indicator-deep-link {
    outline: 2px solid var(--logo-teal);
    outline-offset: 2px;
    animation: deep-link-pulse 1.8s ease-out;
}

@keyframes deep-link-pulse {
    0% { outline-color: var(--logo-teal); }
    100% { outline-color: transparent; }
}

#latest-13f-filings-anchor {
    position: absolute;
    pointer-events: none;
}

#latest-13f-filings {
    margin-top: 2rem;
}
