/* ============================================
   NOTYBOOK - Futuristic + Indigenous Design
   ============================================ */

:root {
    /* Nature & Life Colors */
    --jade: #00A86B;
    --jade-dark: #007A4D;
    --jade-glow: #00E89040;
    --turquoise: #40E0D0;
    --gold-inca: #D4A017;
    --gold-light: #F4D03F;
    --terracotta: #C1440E;
    --earth: #5C4033;
    --obsidian: #0A0A0F;
    --night: #0D1117;
    --deep: #161B22;
    --surface: #1C2333;
    --surface-light: #242D3D;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #6E7681;
    --forest: #1B4332;
    --emerald: #2D6A4F;
    --sky: #48CAE4;
    --coral: #E07A5F;
    --violet: #7B2FBE;
    --red-war: #D32F2F;
    --red-soft: #FF6B6B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--night);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   AZTEC/INCA DECORATIVE BORDERS
   ============================================ */

.aztec-border-top,
.aztec-border-bottom {
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold-inca) 0px,
        var(--gold-inca) 20px,
        var(--terracotta) 20px,
        var(--terracotta) 40px,
        var(--jade) 40px,
        var(--jade) 60px,
        var(--turquoise) 60px,
        var(--turquoise) 80px
    );
    position: relative;
}

.aztec-border-top::after,
.aztec-border-bottom::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 8px,
        var(--gold-light) 8px,
        var(--gold-light) 12px
    );
}

.aztec-border-top::after {
    bottom: -2px;
}

.aztec-border-bottom::before {
    top: -2px;
}

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

.header {
    background: linear-gradient(180deg, var(--obsidian) 0%, var(--night) 100%);
    border-bottom: 1px solid rgba(212, 160, 23, 0.2);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 0 10px rgba(64, 224, 208, 0.4));
    animation: logo-pulse 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.1);
}

@keyframes logo-pulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(64, 224, 208, 0.3)); }
    50% { filter: drop-shadow(0 0 18px rgba(64, 224, 208, 0.6)); }
}

.site-title {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 6px;
    background: linear-gradient(135deg, var(--gold-inca), var(--gold-light), var(--turquoise));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-ia {
    font-size: 0.45em;
    letter-spacing: 2px;
    position: relative;
    top: -0.9em;
    margin-left: 2px;
    -webkit-text-fill-color: rgba(64, 224, 208, 0.15);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    animation: ia-blink 3s ease-in-out infinite;
}

@keyframes ia-blink {
    0%, 100% {
        -webkit-text-fill-color: rgba(64, 224, 208, 0.1);
        text-shadow:
            0 0 2px rgba(64, 224, 208, 0.1);
        opacity: 0.3;
    }
    15% {
        -webkit-text-fill-color: rgba(64, 224, 208, 0.9);
        text-shadow:
            0 0 10px rgba(64, 224, 208, 0.8),
            0 0 25px rgba(64, 224, 208, 0.5),
            0 0 50px rgba(64, 224, 208, 0.3);
        opacity: 1;
    }
    20% {
        -webkit-text-fill-color: rgba(64, 224, 208, 0.2);
        text-shadow:
            0 0 2px rgba(64, 224, 208, 0.1);
        opacity: 0.35;
    }
    35% {
        -webkit-text-fill-color: #40E0D0;
        text-shadow:
            0 0 10px rgba(64, 224, 208, 1),
            0 0 30px rgba(64, 224, 208, 0.7),
            0 0 60px rgba(64, 224, 208, 0.4),
            0 0 100px rgba(64, 224, 208, 0.2);
        opacity: 1;
    }
    55% {
        -webkit-text-fill-color: #40E0D0;
        text-shadow:
            0 0 10px rgba(64, 224, 208, 1),
            0 0 30px rgba(64, 224, 208, 0.7),
            0 0 60px rgba(64, 224, 208, 0.4),
            0 0 100px rgba(64, 224, 208, 0.2);
        opacity: 1;
    }
    75% {
        -webkit-text-fill-color: rgba(64, 224, 208, 0.4);
        text-shadow:
            0 0 4px rgba(64, 224, 208, 0.2);
        opacity: 0.5;
    }
    85% {
        -webkit-text-fill-color: rgba(64, 224, 208, 0.15);
        text-shadow:
            0 0 2px rgba(64, 224, 208, 0.05);
        opacity: 0.3;
    }
}

.site-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-inca), var(--turquoise));
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--gold-light);
}

.nav-links a:hover::after {
    width: 100%;
}

.header-date {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* ============================================
   STOCK TICKER
   ============================================ */

.ticker-bar {
    background: var(--obsidian);
    border-bottom: 1px solid rgba(0, 168, 107, 0.2);
    overflow: hidden;
    padding: 0.6rem 0;
    position: relative;
}

.ticker-bar::before,
.ticker-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.ticker-bar::before {
    left: 0;
    background: linear-gradient(90deg, var(--obsidian), transparent);
}

.ticker-bar::after {
    right: 0;
    background: linear-gradient(90deg, transparent, var(--obsidian));
}

.ticker-track {
    display: flex;
    gap: 3rem;
    animation: ticker-scroll 30s linear infinite;
    white-space: nowrap;
    width: max-content;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
}

.ticker-symbol {
    color: var(--gold-inca);
    font-weight: 700;
}

.ticker-price {
    color: var(--text-primary);
}

.ticker-change {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
}

.ticker-up {
    color: #00E890;
    background: rgba(0, 232, 144, 0.1);
}

.ticker-down {
    color: #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.ticker-loading {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    padding: 5rem 2rem;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(170deg, var(--forest) 0%, var(--night) 50%, var(--deep) 100%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 40px, var(--gold-inca) 40px, var(--gold-inca) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, var(--gold-inca) 40px, var(--gold-inca) 41px);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.highlight {
    background: linear-gradient(135deg, var(--jade), var(--turquoise));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 300;
}

.inca-sun {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.15) 0%, transparent 70%);
    border: 2px solid rgba(212, 160, 23, 0.1);
    animation: rotate-sun 60s linear infinite;
}

.inca-sun::before {
    content: '';
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    border: 1px dashed rgba(212, 160, 23, 0.2);
}

.inca-sun::after {
    content: '';
    position: absolute;
    inset: 50px;
    border-radius: 50%;
    border: 1px solid rgba(212, 160, 23, 0.15);
    background: radial-gradient(circle, rgba(212, 160, 23, 0.1) 0%, transparent 70%);
}

@keyframes rotate-sun {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-dark {
    max-width: 100%;
    background: linear-gradient(180deg, var(--deep) 0%, rgba(211, 47, 47, 0.03) 50%, var(--deep) 100%);
    border-top: 1px solid rgba(211, 47, 47, 0.1);
    border-bottom: 1px solid rgba(211, 47, 47, 0.1);
}

.section-dark .news-grid {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.glyph-decoration {
    font-size: 1.5rem;
    color: var(--gold-inca);
    opacity: 0.6;
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: center;
    background: linear-gradient(90deg, var(--text-primary), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
    margin-top: 0.5rem;
}

.ai-disclaimer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
    opacity: 0.7;
    font-style: italic;
}

.section-disclaimer {
    text-align: center;
    color: var(--coral);
    font-size: 0.8rem;
    margin-bottom: 2rem;
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.8;
}

/* ============================================
   NEWS CARDS
   ============================================ */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

#mainNewsGrid {
    grid-template-columns: repeat(4, 1fr);
}

.news-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-politica::before {
    background: linear-gradient(90deg, var(--violet), var(--sky));
    opacity: 1;
}

.card-economia::before {
    background: linear-gradient(90deg, var(--jade), var(--turquoise));
    opacity: 1;
}

.card-tech::before {
    background: linear-gradient(90deg, var(--sky), var(--gold-inca));
    opacity: 1;
}

.card-deportes::before {
    background: linear-gradient(90deg, var(--emerald), var(--gold-inca));
    opacity: 1;
}

.card-war::before {
    background: linear-gradient(90deg, var(--terracotta), var(--coral));
    opacity: 1;
}

.news-card:hover {
    transform: translateY(-6px);
    border-color: rgba(212, 160, 23, 0.2);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--jade-glow);
}

.card-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
}

.card-politica .card-tag {
    background: rgba(123, 47, 190, 0.8);
    color: #E0C3FC;
}

.card-economia .card-tag {
    background: rgba(0, 168, 107, 0.8);
    color: #A7F3D0;
}

.card-tech .card-tag {
    background: rgba(72, 202, 228, 0.8);
    color: #E0F7FA;
}

.card-deportes .card-tag {
    background: rgba(45, 106, 79, 0.85);
    color: #A7F3D0;
}

.tag-war {
    background: rgba(211, 47, 47, 0.8) !important;
    color: #FFCDD2 !important;
}

.card-image {
    width: 100%;
    height: 220px;
    background: var(--surface-light);
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--surface));
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-source {
    font-weight: 600;
    color: var(--jade);
}

/* Skeleton loading */
.skeleton-img {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--surface) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-text {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--surface) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    min-height: 1em;
    min-width: 80%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   MARKETS DASHBOARD
   ============================================ */

.section-dashboard {
    max-width: 100%;
    background: linear-gradient(180deg, var(--night) 0%, rgba(0, 168, 107, 0.03) 50%, var(--night) 100%);
    border-top: 1px solid rgba(212, 160, 23, 0.1);
    border-bottom: 1px solid rgba(212, 160, 23, 0.1);
}

.dashboard-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* --- Main Chart --- */
.dash-main-chart {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.dash-chart-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dash-chart-info {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.dash-chart-symbol {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold-inca);
    letter-spacing: 3px;
}

.dash-chart-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dash-chart-price-area {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-left: auto;
}

.dash-chart-price {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-chart-change {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.dash-chart-change.up {
    color: #00E890;
    background: rgba(0, 232, 144, 0.1);
}

.dash-chart-change.down {
    color: #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.dash-chart-periods {
    display: flex;
    gap: 0.25rem;
    background: var(--deep);
    border-radius: 8px;
    padding: 3px;
}

.period-btn {
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 1px;
}

.period-btn:hover {
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--jade-dark);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 168, 107, 0.3);
}

.dash-chart-canvas-wrapper {
    flex: 1;
    min-height: 280px;
    position: relative;
}

.dash-chart-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.dash-chart-footer {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.dash-chart-footer strong {
    color: var(--text-secondary);
    font-family: 'Orbitron', monospace;
    font-size: 0.72rem;
}

/* --- Side Panel Cards --- */
.dash-side-panel {
    display: flex;
    flex-direction: column;
}

.dash-side-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    max-height: 520px;
    padding-right: 4px;
}

.dash-side-scroll::-webkit-scrollbar {
    width: 3px;
}

.dash-side-scroll::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 2px;
}

.dash-mini-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: 1fr 90px;
    grid-template-rows: auto auto;
    gap: 0.2rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dash-mini-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
}

.dash-mini-card.up::before { background: var(--jade); }
.dash-mini-card.down::before { background: var(--red-soft); }

.dash-mini-card:hover {
    border-color: rgba(212, 160, 23, 0.25);
    background: var(--surface-light);
    transform: translateX(-4px);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.dash-mini-card.selected {
    border-color: var(--gold-inca);
    background: rgba(212, 160, 23, 0.05);
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.1);
}

.mini-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-column: 1;
}

.mini-card-symbol {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-inca);
    letter-spacing: 2px;
}

.mini-card-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-card-bottom {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    grid-column: 1;
}

.mini-card-price {
    font-family: 'Orbitron', monospace;
    font-size: 0.95rem;
    font-weight: 700;
}

.dash-mini-card.up .mini-card-price { color: #00E890; }
.dash-mini-card.down .mini-card-price { color: #FF6B6B; }

.mini-card-change {
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    font-weight: 600;
}

.dash-mini-card.up .mini-card-change { color: #00E890; }
.dash-mini-card.down .mini-card-change { color: #FF6B6B; }

.mini-sparkline {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-sparkline canvas {
    width: 90px !important;
    height: 40px !important;
}

/* --- Dashboard Bottom Row --- */
.dashboard-bottom {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
}

.dash-bottom-card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem;
}

.dash-card-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.dash-bottom-canvas-wrapper {
    position: relative;
    height: 220px;
}

.dash-bottom-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* --- Responsive Dashboard --- */
@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dash-side-panel {
        max-height: none;
    }

    .dash-side-scroll {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        max-height: none;
        overflow: visible;
    }

    .dashboard-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dash-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dash-chart-price-area {
        margin-left: 0;
    }

    .dash-chart-footer {
        gap: 1rem;
    }

    .dash-side-scroll {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CHAT / AI ASSISTANT
   ============================================ */

.section-assistant {
    background: linear-gradient(180deg, var(--night) 0%, var(--forest) 50%, var(--night) 100%);
    max-width: 100%;
    border-top: 1px solid rgba(0, 168, 107, 0.15);
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid rgba(212, 160, 23, 0.15);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 2px;
}

.chat-msg {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 85%;
    animation: msg-appear 0.3s ease-out;
}

@keyframes msg-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-msg {
    align-self: flex-start;
}

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bot-msg .msg-avatar {
    background: linear-gradient(135deg, var(--jade-dark), var(--jade));
    color: var(--gold-light);
    box-shadow: 0 0 15px rgba(0, 168, 107, 0.3);
}

.user-msg .msg-avatar {
    background: linear-gradient(135deg, var(--gold-inca), var(--terracotta));
    color: white;
    font-size: 0.8rem;
}

.msg-bubble {
    padding: 0.85rem 1.2rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.bot-msg .msg-bubble {
    background: var(--surface-light);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

/* --- Chat formatted content --- */
.bot-msg .msg-bubble p {
    margin: 0 0 0.5rem 0;
    line-height: 1.65;
}

.bot-msg .msg-bubble p:last-child {
    margin-bottom: 0;
}

.bot-msg .msg-bubble .chat-h2 {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gold-inca);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 160, 23, 0.2);
    text-transform: uppercase;
}

.bot-msg .msg-bubble .chat-h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--turquoise);
    margin: 0.85rem 0 0.4rem 0;
    letter-spacing: 0.5px;
}

.bot-msg .msg-bubble strong {
    color: #fff;
    font-weight: 600;
}

.bot-msg .msg-bubble em {
    color: var(--text-secondary);
    font-style: italic;
}

.bot-msg .msg-bubble .chat-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.bot-msg .msg-bubble .chat-list li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.bot-msg .msg-bubble .chat-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--jade);
    box-shadow: 0 0 4px rgba(0, 168, 107, 0.4);
}

.bot-msg .msg-bubble .chat-list li strong {
    color: var(--text-primary);
}

.bot-msg .msg-bubble .chat-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.25), transparent);
    margin: 0.75rem 0;
}

.user-msg .msg-bubble {
    background: linear-gradient(135deg, var(--jade-dark), var(--emerald));
    border-bottom-right-radius: 4px;
    color: white;
}

.chat-input-area {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--deep);
}

.chat-input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send {
    padding: 1.2rem 1.8rem;
    background: linear-gradient(135deg, var(--jade), var(--jade-dark));
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.chat-send:hover {
    background: linear-gradient(135deg, var(--turquoise), var(--jade));
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.85rem 1.2rem;
    background: var(--surface-light);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing-bounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

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

.footer {
    background: var(--obsidian);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gold-inca);
    letter-spacing: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 8px rgba(64, 224, 208, 0.4));
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.footer-pattern {
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 10px,
        var(--gold-inca) 10px,
        var(--gold-inca) 20px,
        transparent 20px,
        transparent 30px,
        var(--terracotta) 30px,
        var(--terracotta) 40px
    );
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-powered {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    letter-spacing: 1px;
}

.footer-powered a {
    color: var(--gold-inca);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-powered a:hover {
    color: var(--gold-light);
    text-shadow: 0 0 8px rgba(212, 160, 23, 0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    #mainNewsGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links {
        gap: 1rem;
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .header-date {
        order: 2;
    }

    .hero-title {
        font-size: 2rem;
    }

    .news-grid,
    #mainNewsGrid {
        grid-template-columns: 1fr;
    }

    .markets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-title {
        font-size: 1.3rem;
    }

    .inca-sun {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .section {
        padding: 2.5rem 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .markets-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .market-card {
        padding: 1rem;
    }

    .chat-messages {
        height: 300px;
    }

    .nav-links a {
        font-size: 0.7rem;
    }
}

/* ============================================
   INCA GEOMETRIC PATTERNS (SVG-like with CSS)
   ============================================ */

.news-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    opacity: 0.03;
    background:
        linear-gradient(45deg, var(--gold-inca) 25%, transparent 25%),
        linear-gradient(-45deg, var(--gold-inca) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--gold-inca) 75%),
        linear-gradient(-45deg, transparent 75%, var(--gold-inca) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    transition: opacity 0.3s ease;
}

.news-card:hover::after {
    opacity: 0.08;
}

/* Warning message style */
.warning-msg .msg-bubble {
    background: rgba(211, 47, 47, 0.15) !important;
    border: 1px solid rgba(211, 47, 47, 0.3);
    color: var(--red-soft) !important;
}
