/* ========== PS99VALUES – v3 Tactile‑optimized, 2×2 dashboard ========== */
:root {
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --accent-secondary: #06b6d4;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.06), 0 4px 10px -6px rgba(0,0,0,0.03);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --font: 'Outfit', system-ui, sans-serif;
    --easing: cubic-bezier(0.23, 1, 0.32, 1);
    --bg-card-rgb: 255, 255, 255;
    --touch-min: 44px;
}

[data-theme="dark"] {
    --bg-base: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border: #334155;
    --border-hover: #475569;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.4);
    --bg-card-rgb: 30, 41, 59;
}

[data-theme="super-dark"] {
    --bg-base: #0a0a0f;
    --bg-card: #111118;
    --bg-card-hover: #1a1a25;
    --accent: #10b981;
    --text-main: #e5e5ea;
    --text-muted: #8e8e98;
    --text-soft: #636370;
    --border: #22222e;
    --border-hover: #33334a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.6);
    --bg-card-rgb: 17, 17, 24;
}

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.125rem);
}

body {
    position: relative; min-height: 100vh; overflow-x: hidden;
    display: flex; flex-direction: column;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.ambient-light {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background: radial-gradient(circle at 15% 15%, rgba(16,185,129,0.03) 0%, transparent 40%),
                radial-gradient(circle at 85% 85%, rgba(6,182,212,0.03) 0%, transparent 40%);
}
.ambient-glow {
    position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
    filter: blur(80px); opacity: 0.4;
    will-change: transform; transform: translateZ(0);
}
.ambient-glow--top-left  { width: 300px; height: 300px; top: -60px; left: -60px; background: rgba(16,185,129,0.06); }
.ambient-glow--bottom-right { width: 250px; height: 250px; bottom: -50px; right: -50px; background: rgba(6,182,212,0.05); }
[data-theme="dark"] .ambient-light {
    background: radial-gradient(circle at 15% 15%, rgba(16,185,129,0.04) 0%, transparent 40%),
                radial-gradient(circle at 85% 85%, rgba(6,182,212,0.04) 0%, transparent 40%);
}
[data-theme="dark"] .ambient-glow--top-left { background: rgba(16,185,129,0.08); }
[data-theme="dark"] .ambient-glow--bottom-right { background: rgba(6,182,212,0.06); }

/* ========== CABECERA & NAV ========== */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(var(--bg-card-rgb), 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
    will-change: transform; transform: translateZ(0);
}
.nav {
    position: sticky; top: 56px; z-index: 99;
    background: rgba(var(--bg-card-rgb), 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0;
    will-change: transform; transform: translateZ(0);
}

.header__inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo__icon { font-size: 1.8rem; color: var(--accent); }
.logo__text { font-size: 1.4rem; font-weight: 900; color: var(--text-main); letter-spacing: -1px; }
.logo__accent { color: var(--accent); }
.header__actions { display: flex; align-items: center; gap: 0.8rem; }
.theme-toggle,
#settingsToggle {
    background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem;
    cursor: pointer; padding: 0.3rem; border-radius: 50%; transition: color 0.2s, background 0.2s;
    min-width: var(--touch-min); min-height: var(--touch-min);
    display: inline-flex; align-items: center; justify-content: center;
    touch-action: manipulation;
}
.theme-toggle:hover,
#settingsToggle:hover { color: var(--accent); background: rgba(16,185,129,0.1); }
.legal-link { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.85rem; }
.legal-link:hover { color: var(--accent); }

.nav__inner { display: flex; gap: 0.3rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav__btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 0.45rem 1rem; border-radius: 99px; font-size: 0.85rem;
    font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: all 0.2s var(--easing); display: flex; align-items: center; gap: 0.4rem;
    font-family: var(--font);
    min-height: var(--touch-min);
    touch-action: manipulation;
}
.nav__btn:hover { color: var(--text-main); background: rgba(16,185,129,0.05); }
.nav__btn.active { background: var(--accent); color: #fff; }

/* ========== CONTENEDORES ========== */
.wrapper { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding: 1.5rem 16px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

@media (prefers-reduced-motion: no-preference) {
    .tab-content.active { animation: fadeSlide 0.3s var(--easing); }
}
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.tab-content:not(.active) {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}

/* ========== TARJETAS (DASHBOARD STATS 2x2) ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}
#dashboardStats.stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s var(--easing);
    will-change: transform;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-hover); transform: translateY(-2px); }
.card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; flex-wrap: wrap; gap: 0.5rem; }
.card__title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    display: flex; align-items: center; gap: 0.4rem;
}
.card .value { font-size: 1.8rem; font-weight: 900; color: var(--text-main); }
.card .sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ========== GRÁFICAS ========== */
.charts-row, .tier-rates-row { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.charts-row { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tier-rates-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.chart-wrap { width: 100%; height: 260px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ========== TABLAS ========== */
.table-wrap {
    overflow-x: auto; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--bg-card);
    background-image: linear-gradient(to right, var(--bg-card) 30%, transparent),
                      linear-gradient(to left, var(--bg-card) 30%, transparent);
    background-position: left center, right center;
    background-repeat: no-repeat;
    background-size: 20px 100%, 20px 100%;
    background-attachment: local, local;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th, .table td { padding: 0.6rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th {
    background: var(--bg-card-hover); font-weight: 700; font-size: 0.7rem;
    text-transform: uppercase; color: var(--text-muted); cursor: pointer;
    user-select: none; position: sticky; top: 0;
    touch-action: manipulation;
}
.table th:hover { color: var(--accent); }
.table tbody tr { transition: background 0.15s; cursor: pointer; }
.table tbody tr:hover { background: var(--bg-card-hover); }
.rap-cell { font-weight: 700; color: var(--accent); }

/* ========== BADGES ========== */
.badge {
    display: inline-block; padding: 0.2rem 0.5rem; border-radius: 99px;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; margin: 0.1rem;
    border: 1px solid; background: #fff;
}
.badge--huge { color: #f97316; border-color: #fed7aa; background: #fff7ed; }
.badge--titanic { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
.badge--gargantuan { color: #ca8a04; border-color: #fef08a; background: #fefce8; }
.badge--shiny { color: #a855f7; border-color: #e9d5ff; background: #faf5ff; }
.badge--golden { color: #eab308; border-color: #fef08a; background: #fefce8; }
.badge--rainbow { color: #0f172a; border-color: #cbd5e1; background: linear-gradient(90deg, #fee2e2, #fef3c7, #d1fae5, #dbeafe, #ede9fe); }

/* ========== BÚSQUEDA ========== */
.search-wrap { position: relative; margin-bottom: 0.8rem; }
.search-wrap__icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }
.search-wrap input {
    width: 100%; padding: 0.7rem 0.8rem 0.7rem 2.4rem; border-radius: 99px;
    border: 2px solid var(--border); background: var(--bg-card);
    color: var(--text-main); font-family: var(--font); font-size: 0.9rem;
    outline: none; transition: all 0.2s;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,0.08); }
.suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-card); border: 2px solid var(--border);
    border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 200px; overflow-y: auto; z-index: 50; display: none;
    box-shadow: var(--shadow-lg);
}
.suggestions.show { display: block; }
.suggestions div { padding: 0.5rem 0.8rem; cursor: pointer; font-weight: 500; font-size: 0.85rem; transition: background 0.15s; }
.suggestions div:hover { background: var(--bg-card-hover); }

/* ========== FILTROS & BOTONES TEMPORALES ========== */
.filter-bar { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.filter-chip {
    padding: 0.45rem 1rem; border-radius: 99px; border: 2px solid var(--border);
    background: transparent; color: var(--text-muted); font-weight: 600;
    font-size: 0.8rem; cursor: pointer; transition: all 0.2s; font-family: var(--font);
    min-height: var(--touch-min);
    touch-action: manipulation;
}
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-chip:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

.timeframe-selector { display: flex; gap: 0.2rem; }
.timeframe-selector button {
    padding: 0.3rem 0.7rem; border-radius: 6px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); font-size: 0.7rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: var(--font);
    min-height: var(--touch-min);
    touch-action: manipulation;
}
.timeframe-selector button.active { background: var(--accent); color: white; border-color: var(--accent); }
.timeframe-selector button:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ========== PAGINACIÓN ========== */
.pagination { display: flex; justify-content: center; gap: 0.2rem; margin-top: 0.8rem; flex-wrap: wrap; }
.pagination button {
    padding: 0.4rem 0.8rem; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-muted); font-weight: 600;
    cursor: pointer; font-family: var(--font); font-size: 0.8rem; transition: all 0.2s;
    min-height: var(--touch-min); min-width: var(--touch-min);
    touch-action: manipulation;
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(4px);
    z-index: 200; display: flex; align-items: center; justify-content: center;
    padding: 1rem; will-change: opacity;
}
@media (prefers-reduced-motion: no-preference) {
    .modal-overlay { animation: fadeSlide 0.25s var(--easing); }
}
.modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    width: 100%; max-width: 800px; max-height: 90vh; overflow-y: auto;
    padding: 1.5rem; box-shadow: var(--shadow-lg); position: relative;
}
.modal .close-btn {
    position: absolute; top: 0.5rem; right: 0.7rem; background: none;
    border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer;
    min-width: var(--touch-min); min-height: var(--touch-min);
    display: flex; align-items: center; justify-content: center;
    touch-action: manipulation;
}
.modal .close-btn:hover { color: var(--text-main); }

/* ========== TOAST ========== */
.toast-container { position: fixed; bottom: 1rem; right: 1rem; z-index: 300; display: flex; flex-direction: column; gap: 0.4rem; }
.toast {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 0.6rem 1rem; font-weight: 600; font-size: 0.8rem;
    box-shadow: var(--shadow-md); max-width: 300px;
}
@media (prefers-reduced-motion: no-preference) {
    .toast { animation: slideToast 0.3s var(--easing); }
}
@keyframes slideToast { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 4px solid var(--accent); }
.toast.error { border-left: 4px solid #ef4444; color: #ef4444; }

/* ========== SECCIONES ========== */
.eggs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.timeline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.timeline-date { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-bottom: 0.5rem; }
.timeline-items { list-style: none; padding: 0; }
.timeline-items li { padding: 0.25rem 0; font-size: 0.8rem; color: var(--text-main); border-bottom: 1px solid var(--border); }

/* ========== FOOTER ========== */
.footer {
    background: #0f172a; color: #e2e8f0; padding: 2rem 0 0; margin-top: auto; border-top: 1px solid #1e293b;
}
.footer__grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem;
    padding-bottom: 1.5rem; border-bottom: 1px solid #1e293b;
}
.footer__col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #94a3b8; margin-bottom: 0.5rem; }
.footer__col ul { list-style: none; padding: 0; }
.footer__col ul li { margin-bottom: 0.3rem; }
.footer__col a, .footer__col p { color: #cbd5e1; text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.2s; }
.footer__col a:hover { color: var(--accent); }
.footer__tagline { margin-bottom: 0.3rem; }
.footer__disclaimer { font-size: 0.75rem; color: #64748b; }
.footer__bottom { text-align: center; padding: 1rem 0; font-size: 0.8rem; color: #64748b; }

/* ========== COOKIE BANNER ========== */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px); border-top: 1px solid #1e293b; padding: 0.8rem 0; z-index: 9999;
}
@media (prefers-reduced-motion: no-preference) {
    .cookie-banner { animation: slideUp 0.4s var(--easing); }
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cookie-banner__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; }
.cookie-banner__inner p { flex: 1; min-width: 200px; font-size: 0.85rem; color: #cbd5e1; }
.cookie-banner__inner a { color: var(--accent); text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ========== BOTONES ========== */
.btn {
    padding: 0.4rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.8rem;
    border: none; cursor: pointer; font-family: var(--font); transition: 0.2s;
    min-height: var(--touch-min);
    touch-action: manipulation;
}
.btn--primary { background: var(--accent); color: white; }
.btn--primary:hover { background: #059669; }
.btn--secondary { background: transparent; border: 1px solid #334155; color: #cbd5e1; }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn--accent {
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white; border: none; font-weight: 700; padding: 0.6rem 1rem;
    border-radius: 10px; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4); }

/* ========== PÁGINAS LEGALES ========== */
.legal-page {
    max-width: 800px; margin: 2rem auto; padding: 1.5rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.legal-page h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 1rem; }
.legal-page h2 { font-size: 1.2rem; font-weight: 700; margin: 1.2rem 0 0.6rem; }
.legal-page p, .legal-page li { color: var(--text-muted); line-height: 1.6; margin-bottom: 0.6rem; }
.legal-page ul { padding-left: 1.5rem; margin-bottom: 0.8rem; }
.legal-page a { color: var(--accent); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }

/* ========== VARIOS ========== */
.seo-title { font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 900; margin-bottom: 0.8rem; letter-spacing: -0.5px; }

.settings-section { margin-bottom: 1.5rem; }
.settings-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--text-main); }
.settings-group { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; color: var(--text-muted); }
.settings-group label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: 500; }
.settings-group small { display: block; color: var(--text-soft); margin-left: auto; }

.custom-select { position: relative; width: 180px; font-family: var(--font); }
.custom-select__trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.8rem; background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 10px; cursor: pointer; color: var(--text-main); font-weight: 600;
    transition: border-color 0.2s; min-height: var(--touch-min);
    touch-action: manipulation;
}
.custom-select__trigger:hover { border-color: var(--accent); }
.custom-select__options {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 10px; overflow: hidden; z-index: 10; display: none; box-shadow: var(--shadow-lg);
}
.custom-select.open .custom-select__options { display: block; }
.custom-option {
    padding: 0.5rem 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
    font-weight: 500; transition: background 0.2s; min-height: var(--touch-min);
    touch-action: manipulation;
}
.custom-option:hover { background: var(--bg-card-hover); }
.custom-option.active { background: var(--accent); color: white; }

.layout-editor { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.layout-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.5rem 0.8rem; user-select: none;
}
.layout-item span { font-weight: 600; color: var(--text-main); }
.layout-actions { display: flex; gap: 0.3rem; }
.layout-actions button {
    background: transparent; border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-muted); padding: 0.2rem 0.5rem; cursor: pointer; font-size: 0.8rem;
    min-width: var(--touch-min); min-height: var(--touch-min);
    touch-action: manipulation;
}
.layout-actions button:hover { border-color: var(--accent); color: var(--accent); }

.rarity-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 0.2rem; overflow: hidden; }
.rarity-fill { height: 100%; background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444); border-radius: 3px; }

#marketPulse div { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }

.img-placeholder {
    width: 32px; height: 32px; border-radius: 6px; background: var(--border);
    display: none;
}

/* ========== HIDE THUMBNAILS (funcional con imágenes oficiales) ========== */
body.hide-thumbs .thumb-cell img,
body.hide-thumbs .modal-thumb img {
    display: none !important;
}
body.hide-thumbs .thumb-cell img + span,
body.hide-thumbs .modal-thumb img + span {
    display: inline-block !important;
}

/* ========== MÓVIL (≤768px) ========== */
@media (max-width: 768px) {
    .header { padding: 0.5rem 0; }
    .nav { top: 50px; padding: 0.3rem 0; }
    .nav__btn { font-size: 0.8rem; padding: 0.45rem 0.9rem; }
    .main { padding: 1rem 12px; }
    .wrapper { padding: 0 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .card { padding: 1rem; border-radius: var(--radius-md); }
    .card .value { font-size: 1.4rem; }
    .chart-wrap { height: 220px; }
    .charts-row { grid-template-columns: 1fr; }
    .tier-rates-row { grid-template-columns: 1fr; }
    .seo-title { font-size: 1.3rem; }
    .table th, .table td { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
    .modal { padding: 1.2rem; border-radius: var(--radius-md); }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .cookie-banner__inner { flex-direction: column; align-items: flex-start; }
    .table-wrap { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
}

/* ========== MÓVIL PEQUEÑO (≤480px) ========== */
@media (max-width: 480px) {
    .logo__icon { font-size: 1.5rem; }
    .logo__text { font-size: 1.1rem; }
    .nav__btn { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .card .value { font-size: 1.3rem; }
    .chart-wrap { height: 200px; }
    .timeframe-selector button { font-size: 0.65rem; padding: 0.25rem 0.55rem; }
    .filter-chip { font-size: 0.75rem; padding: 0.4rem 0.9rem; }
    .footer__grid { grid-template-columns: 1fr; }
    .legal-page { margin: 1rem; padding: 1rem; }
}

/* El dashboard siempre 2x2 incluso en pantallas muy pequeñas */
@media (max-width: 480px) {
    #dashboardStats.stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== ACCESIBILIDAD — Movimiento reducido ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}