/* ==========================================================================
   MACROCHART — PUBLIC WEBSITE
   Economic Data Publication & Comparison Workspace
   ========================================================================== */


/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */

:root {
    --background: #ffffff;
    --surface: #f7f8fa;
    --surface-hover: #f0f2f5;

    --text: #22242a;
    --muted: #777d87;

    --border: #e7e9ed;

    --accent: #638cf5;
    --dark: #26272d;

    --white: #ffffff;

    --header-height: 82px;
    --footer-height: 46px;

    --page-padding: 3%;

    --radius: 8px;
}


/* ==========================================================================
   RESET
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;

    margin: 0;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

body.menu-open,
body.modal-open {
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.eyebrow {
    display: inline-block;

    color: var(--accent);

    font-size: 10px;
    font-weight: 750;

    letter-spacing: 1.4px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}


/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    position: relative;
    z-index: 100;

    display: grid;

    grid-template-columns:
        minmax(180px, 1fr) minmax(0, 2fr) minmax(60px, 1fr);

    align-items: center;

    gap: 20px;

    min-height: var(--header-height);

    padding: 12px var(--page-padding);

    background: var(--white);

    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;

    justify-self: start;

    gap: 12px;

    font-size: 17px;
    font-weight: 850;

    letter-spacing: -0.6px;
}

.brand-logo {
    display: block;

    width: auto;
    height: 34px;

    max-width: 160px;

    object-fit: contain;
}

.brand-name {
    color: var(--text);
}

.header-publication {
    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;
}

.header-publication h1 {
    margin: 0;

    color: var(--text);

    font-size: clamp(18px, 1.65vw, 25px);
    font-weight: 850;

    line-height: 1.2;
    letter-spacing: -0.9px;

    white-space: nowrap;
}

.header-publication h1 span {
    color: var(--accent);
}

.header-publication p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.4;

    white-space: nowrap;
}

.header-actions {
    justify-self: end;

    display: flex;
    align-items: center;

    gap: 24px;
}


/* ==========================================================================
   HAMBURGER MENU
   ========================================================================== */

.menu-toggle {
    width: 40px;
    height: 40px;

    padding: 10px 7px;

    border: none;
    background: transparent;

    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 6px;
}

.menu-toggle span {
    display: block;

    width: 100%;
    height: 2px;

    background: var(--text);

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.menu-toggle:hover span {
    background: var(--accent);
}


/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.menu-overlay {
    position: fixed;
    inset: 0;

    background: rgba(20, 22, 28, 0.45);

    z-index: 150;
}

.navigation-panel {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;

    width: min(440px, 100%);

    padding: 32px;

    background: var(--white);

    z-index: 200;

    display: flex;
    flex-direction: column;

    transform: translateX(100%);
    visibility: hidden;

    transition:
        transform 0.3s ease,
        visibility 0.3s ease;
}

.navigation-panel.is-open {
    transform: translateX(0);
    visibility: visible;
}

.navigation-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 28px;

    border-bottom: 1px solid var(--border);
}

.navigation-heading>span {
    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1.5px;
}

.menu-close {
    padding: 0;

    border: none;
    background: transparent;

    color: var(--text);

    font-size: 32px;
    line-height: 1;
}

.navigation-links {
    display: flex;
    flex-direction: column;

    padding-top: 28px;
}

.navigation-links a,
.navigation-links button {
    width: 100%;

    padding: 20px 0;

    display: flex;
    align-items: center;

    gap: 24px;

    border: none;
    border-bottom: 1px solid var(--border);

    background: transparent;

    color: var(--text);

    text-align: left;

    font-size: 25px;
    font-weight: 750;

    letter-spacing: -0.8px;
}

.navigation-links a:hover,
.navigation-links button:hover {
    color: var(--accent);
}

.navigation-links a span,
.navigation-links button span {
    color: var(--accent);

    font-size: 11px;
    font-weight: 750;

    letter-spacing: 0;
}

.navigation-footer {
    margin-top: auto;

    color: var(--muted);

    font-size: 10px;
    font-weight: 650;

    letter-spacing: 1px;
}


/* ==========================================================================
   APPLICATION WORKSPACE
   ========================================================================== */

.app-workspace {
    width: 100%;

    min-height: calc(100dvh - var(--header-height) - var(--footer-height));
}


/* ==========================================================================
   CATEGORY NAVIGATION
   ========================================================================== */

.category-navigation {
    width: 100%;

    padding: 14px var(--page-padding);

    border-bottom: 1px solid var(--border);

    background: var(--white);
}

.category-filters {
    display: flex;
    align-items: center;

    gap: 8px;

    overflow-x: auto;

    scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.category-filters button {
    flex: 0 0 auto;

    padding: 10px 15px;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: var(--white);

    color: var(--muted);

    font-size: 10px;
    font-weight: 750;

    letter-spacing: 0.5px;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.category-filters button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.category-filters button.is-selected {
    background: var(--text);

    border-color: var(--text);

    color: var(--white);
}


/* ==========================================================================
   CHART PUBLICATION SECTION
   ========================================================================== */

.charts-section {
    width: 100%;

    padding: 24px var(--page-padding) 38px;
}

.charts-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.charts-section-title h2 {
    margin: 7px 0 0;

    font-size: 23px;
    font-weight: 800;

    letter-spacing: -0.8px;
}

.charts-section-meta {
    display: flex;
    align-items: center;

    gap: 12px;
}

#chartCount {
    color: var(--muted);

    font-size: 10px;
    font-weight: 750;

    letter-spacing: 1px;

    white-space: nowrap;
}


/* ==========================================================================
   CHART GALLERY
   ========================================================================== */

.charts-gallery {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 18px;

    align-items: stretch;

    width: 100%;
}


/* ==========================================================================
   CHART CARDS
   ========================================================================== */

.published-chart-card {
    min-width: 0;
    height: 100%;

    display: flex;
    flex-direction: column;

    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.published-chart-card:hover {
    border-color: #d3d8e2;

    box-shadow: 0 6px 24px rgba(25, 30, 40, 0.04);
}

.published-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 12px;
}

.chart-category {
    color: var(--accent);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.published-date {
    color: var(--muted);

    font-size: 10px;
    font-weight: 650;

    white-space: nowrap;
}

.published-chart-canvas {
    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    background: var(--dark);

    border-radius: 6px;
}

.published-chart-canvas canvas {
    display: block;

    width: 100% !important;
    height: 100% !important;
}

.published-chart-details {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 8px;

    padding-top: 14px;
}

.published-chart-details h3 {
    margin: 0;

    color: var(--text);

    font-size: 15px;
    font-weight: 750;

    letter-spacing: -0.3px;
    line-height: 1.45;
}

.published-chart-details p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.6;

    display: -webkit-box;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
}

.chart-card-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: auto;
    padding-top: 15px;
}

.chart-card-actions button {
    flex: 1;

    min-width: 0;

    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: var(--white);

    color: var(--text);

    font-size: 11px;
    font-weight: 750;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.chart-card-actions button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chart-card-actions .chart-expand-button {
    background: var(--text);

    border-color: var(--text);

    color: var(--white);
}

.chart-card-actions .chart-expand-button:hover {
    background: var(--accent);

    border-color: var(--accent);

    color: var(--white);
}


/* ==========================================================================
   EMPTY GALLERY
   ========================================================================== */

.gallery-empty {
    grid-column: 1 / -1;

    width: 100%;

    min-height: 360px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;

    background: var(--surface);

    border: 1px dashed var(--border);
    border-radius: var(--radius);

    text-align: center;
}

.gallery-empty h3 {
    margin: 15px 0 8px;

    font-size: 22px;
    font-weight: 750;

    letter-spacing: -0.6px;
}

.gallery-empty p {
    max-width: 400px;

    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.7;
}

.gallery-status {
    margin: 14px 0 0;

    color: var(--muted);

    font-size: 12px;
}


/* ==========================================================================
   GALLERY PAGINATION
   ========================================================================== */

.gallery-pagination[hidden] {
    display: none !important;
}

.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 22px;

    padding: 32px 0 12px;
}

.gallery-pagination button {
    min-width: 120px;

    padding: 11px 18px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--white);

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}

.gallery-pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.gallery-pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#galleryPageInfo {
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}


/* ==========================================================================
   SHARED BUTTONS
   ========================================================================== */

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 12px 16px;

    border-radius: 6px;

    font-size: 12px;
    font-weight: 750;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.primary-button {
    background: var(--text);
    color: var(--white);

    border: 1px solid var(--text);
}

.primary-button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.secondary-button {
    background: var(--white);
    color: var(--text);

    border: 1px solid var(--border);
}

.secondary-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */

.about-section {
    width: 100%;

    min-height: calc(100dvh - var(--header-height) - var(--footer-height));

    padding: 7% var(--page-padding);

    display: grid;

    grid-template-columns:
        minmax(0, 1fr) minmax(0, 1fr);

    align-items: center;

    gap: 8%;
}

.about-heading h2 {
    margin: 20px 0 0;

    font-size: clamp(36px, 4vw, 68px);
    font-weight: 800;

    line-height: 1.1;

    letter-spacing: -2.5px;
}

.about-heading h2 span {
    color: var(--accent);
}

.about-content p {
    margin: 0 0 20px;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.9;
}

.about-principles {
    margin-top: 32px;

    border-top: 1px solid var(--border);
}

.about-principles>div {
    display: flex;
    align-items: center;

    gap: 20px;

    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}

.about-principles span {
    color: var(--accent);

    font-size: 11px;
    font-weight: 750;
}

.about-principles strong {
    font-size: 13px;
    font-weight: 750;
}


/* ==========================================================================
   FULL-SCREEN CHART WORKSPACE
   ========================================================================== */

.chart-modal {
    position: fixed;
    inset: 0;

    z-index: 300;

    display: block;

    padding: 0;

    background: var(--white);
}

.chart-modal-backdrop {
    display: none;
}

.chart-modal-content {
    position: relative;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100dvh;

    overflow: hidden;

    background: var(--white);
}


/* ==========================================================================
   WORKSPACE HEADER
   Compact Chart Viewer Header
   ========================================================================== */

.chart-modal-header {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    width: 100%;
    min-height: 0;

    padding: 10px var(--page-padding);

    border-bottom: 1px solid var(--border);

    background: var(--white);
}

.chart-modal-heading {
    flex: 1;
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 14px;
}

.chart-modal-heading .eyebrow {
    flex: 0 0 auto;

    font-size: 9px;
    letter-spacing: 1px;
}

.chart-modal-header h2 {
    min-width: 0;

    margin: 0;

    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 750;

    letter-spacing: -0.3px;
    line-height: 1.3;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-modal-close {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: var(--white);

    color: var(--text);

    font-size: 22px;
    line-height: 1;
}

.chart-modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* ==========================================================================
   SCROLLABLE WORKSPACE BODY
   ========================================================================== */

.chart-modal-body {
    flex: 1;

    display: flex;
    flex-direction: column;

    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    background: var(--white);
}


/* ==========================================================================
   CHART VISUALISATION GRID
   ========================================================================== */

.chart-modal-visualisation {
    display: grid;

    grid-template-columns: minmax(0, 1fr);

    align-items: start;
    justify-items: center;

    gap: 28px;

    width: 100%;

    padding: 28px var(--page-padding);
}

.chart-modal.comparison-active .chart-modal-visualisation {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 28px;
}


/* ==========================================================================
   PRIMARY CHART PANEL
   ========================================================================== */

.chart-primary-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;

    width: 100%;
    min-width: 0;
}


/* ==========================================================================
   CHART CANVASES
   ========================================================================== */

.chart-modal-canvas {
    position: relative;

    width: min(100%, 520px);
    max-width: 520px;

    aspect-ratio: 1 / 1;

    margin: 0 auto;

    overflow: hidden;

    background: var(--dark);

    border-radius: 7px;
}

.chart-modal-canvas canvas {
    display: block;

    width: 100% !important;
    height: 100% !important;
}


/* ==========================================================================
   COMPARISON PANEL
   ========================================================================== */

.comparison-panel[hidden] {
    display: none !important;
}

.comparison-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;

    width: 100%;
    min-width: 0;
}

.comparison-panel .chart-modal-canvas {
    width: min(100%, 520px);
    max-width: 520px;
}


/* ==========================================================================
   COMPARISON SELECTOR TOOLBAR
   ========================================================================== */

.comparison-selector-toolbar {
    display: none;

    align-items: center;
    justify-content: center;

    width: 100%;

    padding: 20px var(--page-padding);

    background: var(--surface);

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.chart-modal.comparison-active .comparison-selector-toolbar {
    display: flex;
}

.comparison-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 18px;

    width: 100%;
}

.comparison-panel-header .eyebrow {
    white-space: nowrap;
}

.comparison-panel-header select {
    width: min(100%, 460px);
    max-width: 460px;

    min-height: 42px;

    padding: 10px 14px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--white);

    color: var(--text);

    font-size: 13px;
}


/* ==========================================================================
   RESEARCH GRID
   ========================================================================== */

.chart-research-grid {
    display: grid;

    grid-template-columns: minmax(0, 1fr);

    align-items: start;
    justify-items: center;

    gap: 28px;

    width: 100%;

    padding: 28px var(--page-padding) 40px;
}

.chart-modal.comparison-active .chart-research-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}


/* ==========================================================================
   PRIMARY RESEARCH PANEL
   ========================================================================== */

.chart-modal-information {
    width: min(100%, 520px);
    max-width: 520px;

    min-width: 0;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 7px;
}

.primary-research-content {
    width: 100%;
}

#modalChartDescription {
    margin: 14px 0 24px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.8;

    white-space: pre-line;
}


/* ==========================================================================
   COMPARISON RESEARCH PANEL
   ========================================================================== */

.comparison-research {
    display: none;

    flex-direction: column;

    gap: 12px;

    width: min(100%, 520px);
    max-width: 520px;

    min-width: 0;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 7px;
}

.chart-modal.comparison-active .comparison-research {
    display: flex;
}

.comparison-research h3 {
    margin: 0;

    font-size: 15px;
    font-weight: 800;

    line-height: 1.4;
}

#comparisonChartDescription {
    margin: 0 0 12px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.8;

    white-space: pre-line;
}


/* ==========================================================================
   RESEARCH SOURCES
   ========================================================================== */

.modal-sources {
    padding-top: 18px;

    border-top: 1px solid var(--border);
}

.modal-sources h3 {
    margin: 0 0 12px;

    font-size: 12px;
    font-weight: 800;
}

#modalChartSources,
#comparisonChartSources {
    display: flex;
    flex-direction: column;

    gap: 8px;

    max-height: 180px;

    overflow-y: auto;
}

#modalChartSources a,
#comparisonChartSources a {
    color: #3765d5;

    font-size: 12px;
    line-height: 1.6;

    overflow-wrap: anywhere;
}

#modalChartSources a:hover,
#comparisonChartSources a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   FIXED WORKSPACE ACTION BAR
   Compact Desktop & Mobile Controls
   ========================================================================== */

.chart-modal-footer {
    flex: 0 0 auto;

    width: 100%;

    padding: 9px var(--page-padding);

    border-top: 1px solid var(--border);

    background: var(--white);
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: nowrap;

    gap: 8px;

    width: 100%;

    margin: 0 auto;
}

.modal-actions button {
    flex: 0 0 auto;

    width: auto;
    min-width: 0;
    max-width: none;

    padding: 9px 18px;

    border-radius: 5px;

    font-size: 11px;
    font-weight: 750;

    white-space: nowrap;
}

.modal-action-status {
    width: 100%;

    margin: 5px auto 0;

    color: var(--muted);

    text-align: center;

    font-size: 10px;
    line-height: 1.4;
}

.modal-action-status:empty {
    display: none;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    min-height: var(--footer-height);

    padding: 0 var(--page-padding);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-top: 1px solid var(--border);

    background: var(--white);

    color: var(--muted);

    font-size: 9px;
    font-weight: 650;

    letter-spacing: 0.8px;
}


/* ==========================================================================
   LARGE DESKTOP
   ========================================================================== */

@media (min-width: 1600px) {

    .chart-modal-canvas,
    .comparison-panel .chart-modal-canvas,
    .chart-modal-information,
    .comparison-research {
        width: min(100%, 580px);
        max-width: 580px;
    }

    .chart-modal-visualisation,
    .chart-research-grid {
        gap: 40px;
    }

}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1100px) {

    :root {
        --page-padding: 3.5%;
    }

    .site-header {
        grid-template-columns:
            minmax(145px, 1fr) minmax(0, 2fr) 50px;

        gap: 12px;
    }

    .header-publication h1 {
        font-size: clamp(15px, 1.8vw, 21px);
    }

    .header-publication p {
        font-size: 9px;
    }

    .charts-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-modal-visualisation,
    .chart-research-grid {
        gap: 18px;
    }

    .chart-modal-canvas,
    .comparison-panel .chart-modal-canvas,
    .chart-modal-information,
    .comparison-research {
        width: min(100%, 460px);
        max-width: 460px;
    }

}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 700px) {

    :root {
        --header-height: 74px;
        --footer-height: 44px;

        --page-padding: 5%;
    }

    .site-header {
        grid-template-columns:
            auto minmax(0, 1fr) auto;

        gap: 12px;

        min-height: 74px;

        padding-top: 10px;
        padding-bottom: 10px;
    }

    .site-header .brand {
        gap: 7px;
    }

    .brand-logo {
        height: 29px;
    }

    .brand-name {
        font-size: 13px;
    }

    .header-publication h1 {
        max-width: 100%;

        font-size: 12px;
        line-height: 1.3;

        letter-spacing: -0.3px;

        white-space: normal;
    }

    .header-publication p {
        display: none;
    }

    .menu-toggle {
        width: 34px;
        height: 38px;
    }

    .category-navigation {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .category-filters button {
        padding: 10px 12px;
        font-size: 9px;
    }

    .charts-section {
        padding-top: 22px;
        padding-bottom: 30px;
    }

    .charts-section-title h2 {
        font-size: 21px;
    }

    .charts-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .published-chart-card {
        padding: 14px;
    }

    .gallery-empty {
        min-height: 300px;
    }

    .gallery-pagination {
        gap: 12px;
    }

    .gallery-pagination button {
        min-width: 95px;
        padding: 10px 12px;
    }

    .about-section {
        grid-template-columns: 1fr;

        gap: 32px;

        padding-top: 50px;
        padding-bottom: 50px;
    }

    .about-heading h2 {
        font-size: 40px;
        letter-spacing: -1.7px;
    }

    /* ==========================================================
   COMPACT MOBILE CHART HEADER
   ========================================================== */

    .chart-modal-header {
        gap: 10px;

        min-height: 0;

        padding: 9px 4%;
    }

    .chart-modal-heading {
        display: flex;
        flex-direction: column;
        align-items: flex-start;

        gap: 4px;
    }

    .chart-modal-heading .eyebrow {
        font-size: 8px;
    }

    .chart-modal-header h2 {
        width: 100%;

        margin: 0;

        font-size: 13px;
        font-weight: 750;

        line-height: 1.3;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chart-modal-close {
        width: 30px;
        height: 30px;

        font-size: 21px;
    }

    .chart-modal-visualisation,
    .chart-modal.comparison-active .chart-modal-visualisation {
        grid-template-columns: minmax(0, 1fr);

        gap: 20px;

        padding: 20px 5%;
    }

    .chart-modal-canvas,
    .comparison-panel .chart-modal-canvas {
        width: 100%;
        max-width: 100%;
    }

    .comparison-selector-toolbar {
        padding: 18px 5%;
    }

    /* ==========================================================
       MOBILE COMPARISON SELECTOR
       ========================================================== */

    .comparison-panel-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;
        min-width: 0;

        gap: 12px;
    }

    .comparison-panel-header .eyebrow {
        display: block;
        width: 100%;
    }

    .comparison-panel-header select {
        display: block;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        height: 48px;
        min-height: 48px;

        padding: 0 14px;

        background: #ffffff;
        color: #22242a;

        border: 1px solid #e7e9ed;
        border-radius: 6px;

        font-size: 16px;

        -webkit-appearance: menulist;
        appearance: auto;
    }

    /* ==========================================================
       MOBILE COMPARISON SELECTOR
       ========================================================== */

    .comparison-panel-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;
        min-width: 0;

        gap: 12px;
    }

    .comparison-panel-header .eyebrow {
        display: block;
        width: 100%;
    }

    .comparison-panel-header select {
        display: block;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        height: 48px;
        min-height: 48px;

        padding: 0 14px;

        background: #ffffff;
        color: #22242a;

        border: 1px solid #e7e9ed;
        border-radius: 6px;

        font-size: 16px;

        -webkit-appearance: menulist;
        appearance: auto;
    }

    .chart-research-grid,
    .chart-modal.comparison-active .chart-research-grid {
        grid-template-columns: minmax(0, 1fr);

        gap: 20px;

        padding: 20px 5% 30px;
    }

    .chart-modal-information,
    .comparison-research {
        width: 100%;
        max-width: 100%;

        padding: 20px;
    }

    /* ==========================================================
   COMPACT MOBILE ACTION BAR
   ========================================================== */

    .chart-modal-footer {
        padding: 8px 3%;
    }

    .modal-actions {
        display: grid;

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 6px;

        width: 100%;
    }

    .modal-actions button {
        width: 100%;

        min-width: 0;
        max-width: none;

        padding: 10px 4px;

        font-size: 10px;
        line-height: 1.2;

        white-space: normal;

        text-align: center;
    }

}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 390px) {

    .brand-name {
        display: none;
    }

    .header-publication h1 {
        font-size: 12px;
    }

    .chart-card-actions {
        flex-direction: column;
    }

    .chart-card-actions button {
        width: 100%;
    }

}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

}