/* Mobile layout fixes (Claude 2026-12-03, Tim: "mobile sites are scrollable left and right ... suck in general").
   Phones only (max-width 760px); desktop is untouched. Loaded last on every page via includes/cwif-footer.php.
   Works in every language and RTL (logical properties, wrapping labels). */
@media (max-width: 760px) {
    html, body.cwif-modern { overflow-x: hidden; }

    /* Home charts: the grid track sized itself to the canvas (320px) and pushed past the edge on small phones. */
    .cwif-home-charts { padding: 0 !important; }
    .cwif-home-chart { grid-template-columns: minmax(0, 1fr) !important; min-width: 0 !important; max-width: 100%; }
    .cwif-home-chart > *, .cwif-chart-box, .cwif-home-chart-desc { min-width: 0 !important; max-width: 100%; box-sizing: border-box; }
    .cwif-chart-box canvas { max-width: 100% !important; }
    .cwif-home-chart-desc { font-size: 0.78rem !important; line-height: 1.45 !important; }

    /* Top memecoins table: symbols no longer break mid-word ("$CWI F"); value columns get a fixed share. */
    .memecoin-leaderboard .leaderboard-header,
    .memecoin-leaderboard .token-row {
        grid-template-columns: 26px minmax(0, 1fr) 66px 66px !important;
        gap: 6px !important;
    }
    .memecoin-leaderboard .leaderboard-header span { font-size: 0.72rem !important; letter-spacing: 0.02em !important; }
    .memecoin-leaderboard .token-info { min-width: 0; gap: 6px !important; flex-wrap: nowrap; }
    .memecoin-leaderboard .token-name {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.8rem !important;
        white-space: nowrap;
        word-break: keep-all;
        hyphens: none;
        overflow: hidden;
        text-overflow: ellipsis;
        direction: ltr;
        unicode-bidi: isolate;
    }
    .memecoin-leaderboard .token-icon { flex: 0 0 auto; width: 22px !important; height: 22px !important; }
    .memecoin-leaderboard .cmc-token-link {
        flex: 0 0 auto;
        width: 32px !important;
        height: 32px !important;
        margin-inline-start: auto;
    }

    .textoDesc { grid-template-columns: minmax(0, 1fr) !important; min-width: 0; }
    .textoDesc > * { min-width: 0; max-width: 100%; }
    img.wikiImg { max-width: 100% !important; height: auto !important; }

    /* Readable small text + comfortable taps in the shared footer and traction page. */
    .cwif-site-footer a { min-height: 40px; display: inline-flex; align-items: center; }
    .cwif-site-footer__brand { font-size: 0.85rem !important; }
    .eyebrow { font-size: 12px !important; }
    a.text-link { min-height: 40px; display: inline-flex; align-items: center; font-size: 13px !important; }
}

@media (max-width: 380px) {
    .memecoin-leaderboard .token-icon { display: none !important; }
    .memecoin-leaderboard .leaderboard-header,
    .memecoin-leaderboard .token-row { grid-template-columns: 24px minmax(0, 1fr) 60px 60px !important; }
}
