/* ========================================
   PHOTOS - Street / Landscape, shown as a
   horizontal editorial strip or a masonry grid
   ======================================== */

/* The page itself never scrolls sideways - only the strip does. `clip` (unlike
   `hidden`) also blocks scripted scrolling, so the header and controls stay put. */
html:has(body.photos-page),
body.photos-page {
    overflow-x: clip;
}

/* Short intro line: above the sidebar tabs on desktop, above the tab row on smaller screens */
.fun-intro {
    color: var(--text-color);
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.6;
    margin: 0 0 1rem;
}

/* ---------- Toolbar: categories | strip controls + view toggle ---------- */
.photos-toolbar {
    /* Fast repeated clicks on the arrows shouldn't highlight text */
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
    color: var(--text-color);
}

.photos-tabs {
    display: flex;
    gap: 1.75rem;
}

.photos-tab {
    padding: 0.25rem 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-color);
    font: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.photos-tab:hover {
    opacity: 0.8;
}

.photos-tab.active {
    opacity: 1;
    border-bottom-color: var(--text-color);
}

.photos-tab-count {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.6;
    margin-left: 0.25rem;
}

.photos-toolbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.photos-view-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(64, 59, 53, 0.25);
    background: none;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.photos-view-btn:hover {
    background: rgba(64, 59, 53, 0.08);
}

.photos-view-toggle {
    display: flex;
    gap: 0.35rem;
    padding-left: 1.25rem;
    border-left: 1px solid rgba(64, 59, 53, 0.2);
}

.photos-view-btn.active {
    background: var(--text-color);
    border-color: var(--text-color);
    color: var(--bg-color);
}

/* Strip arrows/counter only make sense in strip view */
body.photos-view-grid .strip-controls {
    display: none;
}

/* ---------- Shared photo item ---------- */
.photo-item {
    position: relative;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    text-align: left;
    cursor: zoom-in;
}

.photos-display .photo-item[hidden] {
    display: none;
}

.photo-item img {
    display: block;
    background: rgba(64, 59, 53, 0.08);
}

.photo-item:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.photo-caption {
    display: block;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* ---------- View: horizontal editorial strip ---------- */
.photos-display.view-strip {
    --photo-height: clamp(300px, calc(100vh - 25rem), 820px);
    /* line the first photo up with the heading, even on very wide screens */
    --strip-inset: max(var(--container-padding), calc((100vw - var(--container-max-width)) / 2));
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 0 var(--strip-inset) 1rem;
    scroll-padding: 0 var(--strip-inset);
    overflow-x: auto;
    overflow-y: hidden;   /* sideways only - the card fade-in would otherwise let it scroll a few px up/down */
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    user-select: none;
    -webkit-user-select: none;
}

.photos-display.view-strip::-webkit-scrollbar {
    display: none;
}

.view-strip .photo-item {
    flex: none;
}

/* Images shouldn't start the browser's own image drag */
.view-strip .photo-item img {
    -webkit-user-drag: none;
}

.view-strip .photo-item img {
    height: var(--photo-height);
    width: auto;
}

.view-strip .photo-caption {
    margin-top: 0.75rem;
    opacity: 0.7;
}

/* ---------- View: masonry grid ---------- */
.photos-display.view-grid {
    columns: 3;
    column-gap: 1rem;
}

.view-grid .photo-item {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    break-inside: avoid;
}

.view-grid .photo-item img {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

.view-grid .photo-item:hover img,
.view-grid .photo-item:focus-visible img {
    transform: scale(1.03);
}

.view-grid .photo-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 0.9rem 0.75rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.view-grid .photo-item:hover .photo-caption,
.view-grid .photo-item:focus-visible .photo-caption {
    opacity: 1;
}

/* Touch screens have no hover, so always show grid captions */
@media (hover: none) {
    .view-grid .photo-caption { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 970px) {
    .photos-display.view-strip {
        --photo-height: clamp(260px, 58vh, 620px);
        gap: 1.25rem;
        padding: 0 2rem 1rem;
        scroll-padding: 0 2rem;
    }

    .photos-display.view-grid {
        columns: 2;
    }

}

@media (max-width: 560px) {
    /* Wide shots are capped by the screen width, so keep tall shots close to
       their height - otherwise the strip leaves a big gap under every wide one */
    .photos-display.view-strip {
        --photo-height: min(320px, 50vh);
        align-items: center;
        padding: 0 1rem 1rem;
        scroll-padding: 0 1rem;
    }

    /* Keep wide shots from being wider than the screen */
    .view-strip .photo-item img {
        height: auto;
        max-height: var(--photo-height);
        max-width: calc(100vw - 3rem);
    }

    .photos-display.view-grid {
        columns: 1;
    }

    .photos-tabs {
        gap: 1.25rem;
    }

    .photos-view-toggle {
        padding-left: 0;
        border-left: none;
    }
}

.photos-empty {
    color: var(--text-color);
    opacity: 0.7;
    padding: 3rem 0;
}

.photos-flickr-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.photos-flickr-link:hover {
    color: var(--accent-hover);
}

.photos-flickr-link i {
    transition: transform 0.2s ease;
}

.photos-flickr-link:hover i {
    transform: translateX(4px);
}

/* ---------- Fun page sections, shown one at a time as tabs (js/photos.js) ---------- */
/* The tabs name each section, so the headings stay for screen readers only */
.fun-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.fun-block.tab-inactive {
    display: none;
}

.fun-block.tab-entering {
    animation: fun-tab-in 0.35s ease;
}

@keyframes fun-tab-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .fun-block.tab-entering { animation: none; }
}

/* Shared tab look: uppercase, spaced, full-strength text; the open one gets a tinted highlight */
.fun-tab {
    position: relative;
    padding: 0;
    border: none;
    background: none;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    white-space: nowrap;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.fun-tab:hover,
.fun-tab:focus-visible {
    background-color: rgba(64, 59, 53, 0.05);
}

.fun-tab[aria-selected="true"] {
    background-color: rgba(64, 59, 53, 0.1);
}

.fun-tab::after {
    content: '';
    position: absolute;
    background: currentColor;
    transition: transform 0.25s ease;
}

/* Phone / tablet: a row of tabs at the top of the section */
.fun-tabbar {
    display: flex;
    flex-wrap: wrap;   /* very narrow phones get a second line rather than a cut-off tab */
    gap: 0.4rem 0.3rem;
    margin: 0 0 2rem -0.55rem;   /* first label still lines up with the content edge */
}

.fun-tabbar .fun-tab {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.55rem;
}

.fun-tabbar .fun-tab::after {
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    transform: scaleX(0);
}

.fun-tabbar .fun-tab[aria-selected="true"]::after {
    transform: scaleX(1);
}

.music-row-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.6;
    margin: 1.75rem 0 1rem;
}

.music-row-title:first-of-type {
    margin-top: 0;
}

/* Side-scrolling row, laid out like the photo strip (full width, first card under the heading) */
.music-row {
    --strip-inset: max(var(--container-padding), calc((100vw - var(--container-max-width)) / 2));
    --card-width: 170px;
    display: flex;
    gap: 1.5rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    /* top padding leaves room for the hover lift */
    padding: 0.5rem var(--strip-inset) 1rem;
    scroll-padding: 0 var(--strip-inset);
    overflow-x: auto;
    overflow-y: hidden;   /* sideways only - the card fade-in would otherwise let it scroll a few px up/down */
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    user-select: none;
    -webkit-user-select: none;
}

.music-row::-webkit-scrollbar {
    display: none;
}

.music-card {
    flex: none;
    width: var(--card-width);
    color: var(--text-color);
    text-decoration: none;
}

.music-cover {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    -webkit-user-drag: none;
}

/* Artists get round photos so the two rows read differently at a glance */
.music-card-artist .music-cover {
    border-radius: 50%;
}

.music-card-artist .music-title {
    text-align: center;
}

.music-card:hover .music-cover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.music-title,
.music-artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-title {
    font-weight: 600;
}

.music-artist {
    font-size: 0.9rem;
    opacity: 0.65;
    margin-top: 0.15rem;
}

/* ---------- Desktop: the tabs become a sidebar menu in the left margin ---------- */
.fun-toc {
    display: none;
}

@media (min-width: 971px) {
    .fun-tabbar,
    .fun-intro-inline {
        display: none;
    }

    /* Where the content starts and ends. It starts right of the sidebar (2.5rem margin +
       12.75rem sidebar + 1.75rem gap) and stops 6rem short of the right edge. On very
       wide screens it is a centred column, 1900px at most.
       The 8px is the body margin the other pages' sections sit inside. */
    body.photos-page {
        --fun-right: max(6rem, calc((100vw - 1900px) / 2));
        --fun-left: max(var(--fun-right), 17rem);
    }

    section#photos {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-left: calc(var(--fun-left) - 8px);
        padding-right: calc(var(--fun-right) - 8px);
    }

    .fun-toc {
        /* right edge sits 1.75rem left of the content; top lines up with it */
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 10.5rem);
        right: calc(100vw - var(--fun-left) + 1.75rem);
        /* same light panel as the sections it switches between */
        padding: 0.9rem 0.6rem 0.6rem;
        background: #f5ece6;
        border: 1px solid rgba(64, 59, 53, 0.24);
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(64, 59, 53, 0.06), 0 10px 28px -12px rgba(64, 59, 53, 0.22);
        z-index: 10;
        display: block;
        counter-reset: fun-tab;
        /* hidden behind the loading screen, like the rest of the page */
        opacity: 0;
        transition: opacity 0.6s ease;
    }

    body.loaded .fun-toc,
    html.returning .fun-toc {
        opacity: 1;
    }

    .fun-toc-tabs {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    /* lines up with the tab numbers */
    .fun-toc .fun-intro {
        padding-left: 0.9rem;
    }

    .fun-toc .fun-tab {
        display: flex;
        align-items: baseline;
        gap: 0.6rem;
        padding: 0.45rem 0.7rem 0.45rem 0.9rem;
        font-size: 0.82rem;
        letter-spacing: 0.12em;
        text-align: left;
    }

    .fun-toc .fun-tab::before {
        counter-increment: fun-tab;
        content: counter(fun-tab, decimal-leading-zero);
        font-size: 0.7rem;
        font-weight: 500;
        letter-spacing: 0.05em;
        opacity: 0.7;
    }

    /* bar down the left edge of the open section's highlight */
    .fun-toc .fun-tab::after {
        top: 0;
        bottom: 0;
        left: 0;
        width: 2px;
        transform: scaleY(0);
    }

    .fun-toc .fun-tab[aria-selected="true"]::after {
        transform: scaleY(1);
    }

}

/* ---------- Photos and On Rotation sit on the same light panel as the stats cards ---------- */
#fun-photos,
#fun-on-rotation {
    padding: 1.75rem;
    background: #f5ece6;
    border: 1px solid rgba(64, 59, 53, 0.24);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(64, 59, 53, 0.06), 0 10px 28px -12px rgba(64, 59, 53, 0.22);
}

/* Strips stay inside the panel: cut off at its left and right edges,
   with the rest revealed by scrolling the strip */
.fun-block .photos-display.view-strip,
.fun-block .music-row {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
    scroll-padding: 0;
}

/* Tablets: cap the strip height so a 3:2 landscape shot is no wider than the
   panel's inside (page padding + panel padding each side) */
@media (min-width: 561px) and (max-width: 970px) {
    .fun-block .photos-display.view-strip {
        --photo-height: min(clamp(260px, 58vh, 620px), calc((100vw - 8.75rem) / 1.5));
    }
}

@media (max-width: 560px) {
    #fun-photos,
    #fun-on-rotation {
        padding: 1rem;
    }

    /* wide shots no wider than the panel's inside (page padding + panel padding each side) */
    .fun-block .view-strip .photo-item img {
        max-width: calc(100vw - 7.25rem);
    }
}

@media (max-width: 970px) {
    .music-row {
        --strip-inset: 2rem;
    }
}

@media (max-width: 560px) {
    .music-row {
        --strip-inset: 1rem;
        --card-width: 135px;
        gap: 1rem;
    }
}

/* ---------- Lightbox: photos sit edge-to-edge, unlike the padded diagram modal ---------- */
.photo-modal-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.photo-modal-figure img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
}

.photo-modal-figure figcaption {
    color: #fff;
    opacity: 0.85;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    text-align: center;
}

.photo-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.photo-modal-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.photo-modal-prev { left: 1.5rem; }
.photo-modal-next { right: 1.5rem; }

@media (max-width: 560px) {
    .photo-modal-prev { left: 0.5rem; }
    .photo-modal-next { right: 0.5rem; }
}

/* ========================================
   LISTENING STATS (charts drawn by js/music-stats.js)
   One data color: a richer step of the site's sage, validated against the
   beige surface (contrast >= 3:1, chroma above the "reads gray" floor)
   ======================================== */
.stats-section {
    --series-1: #5a8a4a;
    --card-bg: #f5ece6;               /* lighter panel the charts sit on (green re-validated against it) */
    --card-border: rgba(64, 59, 53, 0.24);
    --card-shadow: 0 1px 2px rgba(64, 59, 53, 0.06), 0 10px 28px -12px rgba(64, 59, 53, 0.22);
    --chart-surface: var(--card-bg);
    --ink-muted: rgba(64, 59, 53, 0.62);
    --hairline: rgba(64, 59, 53, 0.16);
    --axis: rgba(64, 59, 53, 0.32);
    color: var(--text-color);
}

.stats-note {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

/* ---------- Stat tiles ---------- */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.stat-tile {
    padding: 1.1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.stat-label {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.stat-value {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 600;
    line-height: 1.1;
}

.stat-detail {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    color: var(--ink-muted);
}

/* ---------- Chart cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.chart-card {
    margin: 0;
    padding: 1.5rem 1.5rem 1.15rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    min-width: 0;
}

/* Popularity strip and climbing/fading span the full width */
.chart-wide {
    grid-column: 1 / -1;
}

.chart-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.chart-sub {
    margin: 0.25rem 0 1.1rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.chart-body {
    position: relative;
}

/* Hovered / focused marks lift slightly */
.chart-mark {
    cursor: default;
    outline: none;
}

.chart-mark:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

/* Horizontal bars (genres) */
.hbar-row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 9rem) 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.2rem 0;
}

.hbar-label {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbar-track {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hbar {
    height: 14px;
    min-width: 4px;
    background: var(--series-1);
    border-radius: 0 4px 4px 0;   /* rounded data end, square at the baseline */
    transition: filter 0.15s ease;
}

.hbar-value {
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

.chart-mark:hover .hbar,
.chart-mark:focus-visible .hbar,
.chart-mark:hover .vbar,
.chart-mark:focus-visible .vbar {
    filter: brightness(1.15);
}

/* Columns (release years) */
.vbar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 170px;
    border-bottom: 1px solid var(--axis);
}

.vbar-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    height: 100%;
}

.vbar-value {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

.vbar {
    width: 24px;
    min-height: 3px;
    background: var(--series-1);
    border-radius: 4px 4px 0 0;
    transition: filter 0.15s ease;
}

.vbar-labels {
    display: flex;
    justify-content: space-around;
    padding-top: 0.45rem;
}

.vbar-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

/* Dot strip (popularity) */
.strip-svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.strip-svg .dot {
    fill: var(--series-1);
    stroke: var(--chart-surface);   /* 2px surface ring so overlapping dots stay legible */
    stroke-width: 2;
    transition: r 0.15s ease;
}

.strip-svg .chart-mark:hover .dot,
.strip-svg .chart-mark:focus .dot {
    r: 7;
}

.strip-svg .hit {
    fill: transparent;
}

.strip-svg .axis-line {
    stroke: var(--axis);
    stroke-width: 1;
}

.strip-svg .grid-line {
    stroke: var(--hairline);
    stroke-width: 1;
}

.strip-svg .median-line {
    stroke: var(--text-color);
    stroke-width: 1;
}

.strip-svg text {
    fill: var(--ink-muted);
    font-size: 12px;
    font-family: inherit;
}

.strip-svg .median-label {
    fill: var(--text-color);
    font-weight: 600;
}

/* Climbing / fading lists */
.movers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.movers h4 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.movers h4 i {
    font-size: 0.75rem;
}

.mover-up {
    color: var(--series-1);
}

.mover-down {
    color: var(--ink-muted);
}

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

.movers li {
    padding: 0.4rem 0;
    border-top: 1px solid var(--hairline);
    min-width: 0;
}

.mover-name {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mover-detail {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

/* "Show data" table twin */
.chart-data {
    margin-top: 0.9rem;
    font-size: 0.82rem;
}

.chart-data summary {
    cursor: pointer;
    color: var(--ink-muted);
    width: fit-content;
}

.chart-data summary:hover {
    color: var(--text-color);
}

.chart-data-scroll {
    max-height: 14rem;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.chart-data table {
    width: 100%;
    border-collapse: collapse;
}

.chart-data th,
.chart-data td {
    padding: 0.3rem 0.4rem;
    text-align: left;
    border-bottom: 1px solid var(--hairline);
}

.chart-data th {
    font-weight: 600;
}

.chart-data td.num,
.chart-data th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Shared tooltip (lives outside the section so position: fixed uses the viewport) */
.chart-tooltip {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    background: #403b35;
    color: #edddd4;
    font-size: 0.8rem;
    line-height: 1.35;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    max-width: 16rem;
}

.chart-tooltip strong {
    display: block;
    font-size: 0.95rem;
}

@media (max-width: 970px) {
    .stat-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 420px) {
    .movers {
        grid-template-columns: 1fr;
    }

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