/* ===================================================
   UI ENHANCEMENTS — animations, hamburger, footer,
   streak, share, confetti, hover effects
   =================================================== */

/* ---- Animated ambient orbs background ---- */
.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.06;
    animation: orbFloat linear infinite;
}

.orb-1 { width: 560px; height: 560px; background: #6366F1; top: -160px; left: -140px; animation-duration: 24s; }
.orb-2 { width: 440px; height: 440px; background: #F4C96B; bottom: -110px; right: -90px; animation-duration: 30s; animation-delay: -9s; }
.orb-3 { width: 320px; height: 320px; background: #A78BFA; top: 38%; left: 52%; animation-duration: 19s; animation-delay: -5s; }
.orb-4 { width: 260px; height: 260px; background: #E8922A; bottom: 22%; left: 8%; animation-duration: 26s; animation-delay: -13s; }

@keyframes orbFloat {
    0%   { transform: translate(0,0) scale(1); }
    25%  { transform: translate(30px, -40px) scale(1.05); }
    50%  { transform: translate(-20px, 30px) scale(0.95); }
    75%  { transform: translate(40px, 20px) scale(1.03); }
    100% { transform: translate(0,0) scale(1); }
}

/* Ensure content sits above ambient bg */
.navbar, .container, main, .visualization-main,
.dwf-ticker, .footer {
    position: relative;
    z-index: 1;
}

/* ---- Hamburger nav ---- */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    padding: 2px 0;
    background: none;
    border: none;
    z-index: 300;
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Navbar improvements */
.navbar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(9,13,23,0.96) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 200;
    transition: box-shadow 0.3s;
    /* Ensure text is always visible regardless of canvas behind */
    color: rgba(255,255,255,0.85);
}

.navbar.scrolled {
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 0;
    flex-wrap: nowrap;
}

/* Brand: logo img + text */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.nav-logo { font-size: 1.3rem; }

.nav-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    background: linear-gradient(90deg, #E8922A, #F4C96B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Nav links */
.nav-menu {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0;
    margin: 0;
}

.nav-menu::-webkit-scrollbar { display: none; }

.nav-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.72) !important;
    -webkit-text-fill-color: rgba(255,255,255,0.72) !important;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 7px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: rgba(255,255,255,0.07);
}

.nav-link.active {
    color: #E8922A;
    background: rgba(232,146,42,0.1);
    font-weight: 700;
}

/* Streak badge in nav */
.nav-streak {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(244,201,107,0.12);
    border: 1px solid rgba(244,201,107,0.25);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #F4C96B;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: default;
    position: relative;
}

.nav-streak .streak-fire { font-size: 0.9rem; }

.nav-streak-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(18,24,36,0.97);
    border: 1px solid rgba(244,201,107,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 999;
}

.nav-streak:hover .nav-streak-tooltip { opacity: 1; }

/* ---- Site Footer ---- */
.footer {
    background: rgba(8,11,20,0.95);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 40px 24px 60px;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand .footer-logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-brand .footer-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.footer-brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(90deg, #E8922A, #F4C96B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
    max-width: 260px;
    margin-bottom: 16px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    color: rgba(255,255,255,0.6);
    transition: background 0.2s, color 0.2s;
}

.footer-social a:hover {
    background: rgba(232,146,42,0.15);
    color: #E8922A;
}

.footer-col h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col ul a {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul a:hover { color: #E8922A; }

.footer-bottom {
    max-width: 1100px;
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-copyright {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.25);
}

.footer-badges {
    display: flex;
    gap: 8px;
}

.footer-badge {
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
}

/* ---- FAQ accordion ---- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
    background: rgba(18,24,36,0.85);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.faq-item[open] { border-color: rgba(47,214,200,0.35); }

.faq-q {
    padding: 18px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    gap: 12px;
    user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
    content: '+';
    font-size: 1.3rem;
    color: #2FD6C8;
    flex-shrink: 0;
    transition: transform 0.25s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); }

.faq-a {
    padding: 0 22px 18px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.72);
}

/* ---- Social share buttons ---- */
.share-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity 0.2s, transform 0.15s;
}

.share-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.share-btn-twitter {
    background: #1DA1F2;
    color: #fff;
}

.share-btn-copy {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}

.share-btn-whatsapp {
    background: #25D366;
    color: #fff;
}

/* ---- Confetti canvas ---- */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

/* ════════════════════════════════════════════════════
   GLOBAL CARD + WIDGET COLOR SYSTEM — Rich Premium Palette
   Indigo-violet borders · Gold hover · Deep gradient card bg
════════════════════════════════════════════════════ */

/* Universal card base */
.data-card,
.intro-card,
.method-card,
.limitation-card,
.accuracy-card,
.update-card,
.insight-card,
.explanation-card,
.level-card,
.quiz-question-card,
.journal-add-card,
.journal-chart-card,
.journal-entries-card,
.journal-planner-card,
.journal-share-section,
.twin-input-card,
.twin-result-card,
.goal-input-card,
.goal-milestone-card,
.wem-score-bar,
.lb-submit-card,
.lb-table-card,
.life-input-card,
.compare-create-card,
.col-input-card,
.col-summary-card,
.col-insight-card,
.whatif-input-card,
.retire-input-card,
.hourly-input-card,
.remit-input-card {
    background: linear-gradient(145deg, rgba(10,13,26,0.95) 0%, rgba(14,18,34,0.90) 100%) !important;
    border: 1px solid rgba(99,102,241,0.16) !important;
    border-radius: 18px !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow:
        0 4px 28px rgba(0,0,0,0.36),
        0 1px 0 rgba(255,255,255,0.035) inset,
        0 0 0 1px rgba(99,102,241,0.04);
}

.data-card:hover,
.method-card:hover,
.limitation-card:hover,
.insight-card:hover,
.explanation-card:hover,
.journal-add-card:hover,
.journal-chart-card:hover,
.goal-milestone-card:hover,
.quiz-question-card:hover,
.col-insight-card:hover,
.twin-result-card:hover,
.life-input-card:hover,
.col-summary-card:hover {
    border-color: rgba(244,201,107,0.32) !important;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.48),
        0 0 32px rgba(244,201,107,0.08),
        0 0 0 1px rgba(244,201,107,0.10);
    transform: translateY(-3px);
}

/* ── Consistent heading accent — gold→amber (works on dark & light bg) ── */
.other-page h1,
.other-page h2:not(.nav-title) {
    background: linear-gradient(120deg, #F4C96B 0%, #E8922A 50%, #C4721A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Input / select focus ring — indigo glow ── */
.other-page input:focus,
.other-page select:focus,
.other-page textarea:focus {
    outline: none !important;
    border-color: rgba(99,102,241,0.55) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}

/* ── Number/value displays — gold accent ── */
.rank-number,
.historical-percentile,
.goal-pct,
.lb-rank,
.life-age-val,
.col-result-pct,
.wem-score-val,
.twin-tier-badge,
.journal-summary-val {
    color: var(--wp-gold, #F4C96B) !important;
}

/* ── Primary action buttons — indigo→teal gradient ── */
.other-page button[onclick*="calculate"],
.other-page button[onclick*="Calculate"],
.other-page .calculate-btn,
.other-page .col-calc-btn,
.other-page .lb-submit-btn,
.other-page .whatif-calc-btn,
.journal-add-btn,
.journal-share-btn {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 45%, #E8922A 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 20px rgba(99,102,241,0.32) !important;
    border-radius: 11px !important;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s !important;
}

.other-page button[onclick*="calculate"]:hover,
.other-page button[onclick*="Calculate"]:hover,
.other-page .calculate-btn:hover,
.other-page .col-calc-btn:hover,
.other-page .lb-submit-btn:hover,
.journal-add-btn:hover,
.journal-share-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(99,102,241,0.45), 0 0 20px rgba(244,201,107,0.12) !important;
    filter: brightness(1.08) !important;
}

/* ── Quiz score bar ── */
.quiz-score-bar {
    background: linear-gradient(145deg, rgba(10,13,26,0.92), rgba(14,18,34,0.88)) !important;
    border: 1px solid rgba(99,102,241,0.16) !important;
    border-radius: 14px !important;
}

/* ── Slider thumb — gold ── */
.other-page input[type=range]::-webkit-slider-thumb,
#guess-slider::-webkit-slider-thumb {
    background: var(--wp-gold, #F4C96B) !important;
    box-shadow: 0 0 8px rgba(244,201,107,0.55) !important;
}

.other-page input[type=range]::-moz-range-thumb,
#guess-slider::-moz-range-thumb {
    background: var(--wp-gold, #F4C96B) !important;
}

/* ── Slider track fill (quiz) ── */
#guess-slider {
    accent-color: var(--wp-gold, #F4C96B);
}

/* ── Answer panel bars — violet / gold ── */
#bar-correct { background: linear-gradient(90deg, #6366F1, #A78BFA) !important; }
#bar-guess   { background: var(--wp-gold, #F4C96B) !important; }

/* ── Card hover micro-animations (legacy selectors) ── */

/* ---- Pulse animation for CTA buttons ---- */
@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232,146,42,0.4); }
    50%       { box-shadow: 0 0 0 10px rgba(232,146,42,0); }
}

#calculate-btn {
    animation: ctaPulse 2.5s ease infinite;
}

/* ---- Page entrance animations ---- */
@keyframes pageEntrance {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.container > header,
.container > main > section:first-child,
.container > main > div:first-child {
    animation: pageEntrance 0.5s ease both;
}

/* ---- Results panel number counter animation ---- */
@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

.rank-number.animating {
    animation: countUp 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ---- Intro hero stats bar ---- */
.hero-stats-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0 0;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: #E8922A;
    display: block;
    line-height: 1;
}

.hero-stat-lbl {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
    display: block;
}

/* ---- Watermark / branding on result ---- */
.result-watermark {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.2);
    text-align: right;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

.result-watermark a {
    color: rgba(232,146,42,0.4);
    text-decoration: none;
}

/* ---- Back-to-top button ---- */
.back-to-top {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(232,146,42,0.15);
    border: 1px solid rgba(232,146,42,0.3);
    color: #E8922A;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 150;
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(232,146,42,0.3);
}

/* ---- Mobile responsive updates ---- */
@media (max-width: 900px) {
    .nav-hamburger { display: flex; }

    .nav-menu {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0;
        bottom: 0;
        background: rgba(7,10,20,0.99) !important;
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 2px;
        z-index: 9999 !important;
        padding: 70px 16px 40px;
        overflow-y: auto;
    }

    .nav-menu.open,
    .nav-menu.nav-menu-open {
        display: flex;
    }

    .nav-link {
        font-size: 1rem;
        padding: 12px 24px;
        text-align: center;
        border-radius: 10px;
        width: 100%;
        max-width: 300px;
    }

    .nav-streak { font-size: 0.68rem; padding: 3px 8px; }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .hero-stat-num { font-size: 1.2rem; }
}

/* =====================================================
   DARK / LIGHT MODE TOGGLE
   ===================================================== */

/* Toggle button in navbar */
.theme-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.2);
}

/* Light mode overrides */
:root.light-mode {
    --bg-primary: #f4f6fb;
    --bg-secondary: #e8ecf5;
    --text-primary: #0f1923;
    --text-muted: rgba(15,25,35,0.55);
}

.light-mode body {
    background: linear-gradient(135deg, #e8ecf5 0%, #d8dff0 100%) !important;
    color: #0f1923;
}

/* ── The main page wrapper must be light — this is the root of all dark-bg-in-light-mode ── */
.light-mode .container {
    background: linear-gradient(135deg, rgba(248,249,252,0.98) 0%, rgba(240,244,255,0.95) 100%) !important;
    box-shadow: 0 4px 32px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.9) inset !important;
}

.light-mode .navbar {
    background: rgba(240,244,255,0.94) !important;
    border-bottom-color: rgba(0,0,0,0.08);
}

.light-mode .nav-link { color: rgba(15,25,35,0.65) !important; -webkit-text-fill-color: rgba(15,25,35,0.65) !important; }
.light-mode .nav-link:hover { color: #0f1923 !important; -webkit-text-fill-color: #0f1923 !important; background: rgba(0,0,0,0.05); }
.light-mode .nav-link.active { color: #C4721A !important; -webkit-text-fill-color: #C4721A !important; background: rgba(232,146,42,0.12); }
.light-mode .nav-dropbtn { color: rgba(15,25,35,0.65) !important; -webkit-text-fill-color: rgba(15,25,35,0.65) !important; }
.light-mode .nav-dropbtn:hover { color: #C4721A !important; -webkit-text-fill-color: #C4721A !important; background: rgba(0,0,0,0.05) !important; }
.light-mode .nav-title { background: linear-gradient(90deg, #C4721A, #c9a040); -webkit-background-clip: text; -webkit-text-fill-color: transparent !important; background-clip: text; }

.light-mode .input-panel,
.light-mode .data-card,
.light-mode .intro-card,
.light-mode .insight-card,
.light-mode .explanation-card,
.light-mode .level-card,
.light-mode .method-card,
.light-mode .limitation-card,
.light-mode .quiz-question-card,
.light-mode .journal-add-card,
.light-mode .journal-chart-card,
.light-mode .journal-entries-card,
.light-mode .twin-input-card,
.light-mode .twin-result-card,
.light-mode .goal-input-card,
.light-mode .goal-milestone-card,
.light-mode .wem-score-bar,
.light-mode .lb-submit-card,
.light-mode .lb-table-card,
.light-mode .life-input-card,
.light-mode .compare-create-card,
.light-mode .results-panel {
    background: rgba(255,255,255,0.92) !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: #0f1923;
}

.light-mode .footer {
    background: rgba(220,226,240,0.95);
    border-top-color: rgba(0,0,0,0.08);
}
.light-mode .footer-copyright,
.light-mode .footer-tagline { color: rgba(15,25,35,0.5); }
.light-mode .footer-col h4 { color: rgba(15,25,35,0.4); }
.light-mode .footer-col ul a { color: rgba(15,25,35,0.6); }

.light-mode .orb { opacity: 0.04; }
.light-mode .dwf-ticker { background: rgba(240,244,255,0.95); border-top-color: rgba(0,0,0,0.08); }
.light-mode .theme-toggle { border-color: rgba(0,0,0,0.12); }

/* =====================================================
   COMPREHENSIVE LIGHT MODE CONTRAST SYSTEM
   Thumb rule: any text must contrast its background.
   Light cards → dark text. Dark panels keep white text.
   ===================================================== */

/* CSS token flip — elements using css variables auto-fix */
.light-mode {
    --wp-text-dim: rgba(15,25,35,0.45);
    --wp-text-mid: rgba(15,25,35,0.70);
}

/* ── Expand card/panel whitening to all pages ── */
.light-mode [class*="-input-card"],
.light-mode [class*="-result-card"],
.light-mode [class*="-form-card"],
.light-mode [class*="-summary-card"],
.light-mode [class*="-chart-card"],
.light-mode [class*="-entries-card"],
.light-mode [class*="-table-card"],
.light-mode [class*="-score-card"],
.light-mode [class*="-info-card"],
.light-mode .wem-card,
.light-mode .life-event-card,
.light-mode .goal-gap-card,
.light-mode .compare-result-card,
.light-mode .blog-highlight-box,
.light-mode .blog-faq-item,
.light-mode .blog-cta-box,
.light-mode .map-controls,
.light-mode .map-legend {
    background: rgba(255,255,255,0.88) !important;
    border-color: rgba(0,0,0,0.08) !important;
}

/* ── Labels / meta / captions → dim dark ── */
.light-mode [class*="-label"],
.light-mode [class*="-meta"],
.light-mode [class*="-caption"],
.light-mode [class*="-hint"],
.light-mode [class*="-prompt"],
.light-mode [class*="-disclaimer"],
.light-mode [class*="-note"],
.light-mode [class*="-year"] {
    color: rgba(15,25,35,0.5) !important;
}

/* ── Values / numbers / stats → near-black ── */
.light-mode [class*="-value"],
.light-mode [class*="-stat"],
.light-mode [class*="-count"],
.light-mode [class*="-number"],
.light-mode [class*="-total"],
.light-mode [class*="-amount"] {
    color: #1a2332 !important;
}

/* ── Titles / names / headings → near-black ── */
.light-mode [class*="-title"]:not(.nav-title),
.light-mode [class*="-name"]:not([class*="nav-"]):not([class*="brand"]),
.light-mode [class*="-heading"] {
    color: #1a2332 !important;
}

/* ── Descriptions / details / body copy → dark medium ── */
.light-mode [class*="-desc"],
.light-mode [class*="-detail"],
.light-mode [class*="-context"],
.light-mode [class*="-text"]:not([class*="nav-"]):not(.back-to-top-text):not([class*="btn-"]),
.light-mode [class*="-info"]:not([class*="-icon"]) {
    color: rgba(15,25,35,0.68) !important;
}

/* ── Generic headings and body text in page containers ── */
.light-mode .container h2,
.light-mode .container h3 {
    /* amber gradient stays — just use a darker variant readable on light bg */
    background: linear-gradient(120deg, #8A4E10 0%, #C4721A 55%, #8A4E10 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: #8A4E10 !important;
}
.light-mode .container p,
.light-mode .container li,
.light-mode .container td,
.light-mode .container th,
.light-mode .container span:not([class*="tag"]):not([class*="badge"]):not([class*="flag"]):not([class*="accent"]):not([class*="pct"]) {
    color: #1a2332 !important;
}
.light-mode .subtitle {
    color: rgba(15,25,35,0.6) !important;
    -webkit-text-fill-color: rgba(15,25,35,0.6) !important;
}

/* ── PRESERVE: header always keeps dark bg — restore white text in light mode ── */
/* The page <header> has a permanent dark gradient — must override the broad light rules */
.light-mode .container header p,
.light-mode .container header .subtitle {
    color: rgba(255,255,255,0.82) !important;
    -webkit-text-fill-color: rgba(255,255,255,0.82) !important;
}
.light-mode .container header h1,
.light-mode .container header h2,
.light-mode .container header h3 {
    /* Keep the amber gradient — visible on dark header bg */
    background: linear-gradient(135deg, #E8922A 0%, #F4C96B 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
.light-mode .container header .breadcrumb,
.light-mode .container header .breadcrumb a,
.light-mode .container header .blog-article-meta,
.light-mode .container header .blog-tag,
.light-mode .container header .blog-date,
.light-mode .container header span {
    color: rgba(255,255,255,0.55) !important;
    -webkit-text-fill-color: rgba(255,255,255,0.55) !important;
}
.light-mode .container header .blog-tag {
    color: #F4C96B !important;
    -webkit-text-fill-color: #F4C96B !important;
    background: rgba(244,201,107,0.15) !important;
}

/* ── Big number highlights → dark amber (brand + readable) ── */
.light-mode .income-display,
.light-mode .breakdown-value,
.light-mode [class*="-big"],
.light-mode .wi-slider-val,
.light-mode .col-summary-big,
.light-mode .life-event-stat {
    color: #8A4E10 !important;
}

/* ── Blog article body ── */
.light-mode .blog-article-body h2,
.light-mode .blog-article-body h3,
.light-mode .blog-article-body p,
.light-mode .blog-article-body li,
.light-mode .blog-article-body td,
.light-mode .blog-article-body th {
    color: #1a2332 !important;
}
.light-mode .blog-tag { color: #8A4E10 !important; background: rgba(232,146,42,0.12) !important; }
.light-mode .blog-table th { color: rgba(15,25,35,0.5) !important; border-color: rgba(0,0,0,0.1) !important; }
.light-mode .blog-table td { border-color: rgba(0,0,0,0.05) !important; }
.light-mode .blog-table { background: rgba(255,255,255,0.9) !important; }
.light-mode .blog-caption { color: rgba(15,25,35,0.4) !important; }

/* ── History slider era section ── */
.light-mode .event-name,
.light-mode .event-year,
.light-mode .era-desc { color: rgba(15,25,35,0.7) !important; }

/* ── Global-ladder cards (explanation/level/insight/data) were designed
   for light bg — override back to dark text in light mode ── */
.light-mode .explanation-card h4,
.light-mode .level-header h3,
.light-mode .insight-card h3,
.light-mode .data-card h3,
.light-mode .intro-card h2,
.light-mode .method-card h3,
.light-mode .limitation-card h3 {
    color: #1a2332 !important;
    -webkit-text-fill-color: #1a2332 !important;
    background: none !important;
}
.light-mode .explanation-card p,
.light-mode .level-description,
.light-mode .insight-card p,
.light-mode .data-card p,
.light-mode .method-card p,
.light-mode .limitation-card p,
.light-mode .intro-card p { color: rgba(15,25,35,0.68) !important; }
.light-mode .income-amount { color: rgba(15,25,35,0.55) !important; }
.light-mode .population { color: rgba(15,25,35,0.45) !important; }

/* ── PRESERVE: answer-panel keeps dark gradient bg → white text ── */
.light-mode .answer-panel { color: rgba(255,255,255,0.9) !important; }
.light-mode .answer-panel [class*="-label"],
.light-mode .answer-panel [class*="-meta"],
.light-mode .answer-panel [class*="-caption"],
.light-mode .answer-panel [class*="-hint"],
.light-mode .answer-panel [class*="-prompt"] { color: rgba(255,255,255,0.45) !important; }
.light-mode .answer-panel [class*="-value"],
.light-mode .answer-panel [class*="-stat"],
.light-mode .answer-panel [class*="-name"],
.light-mode .answer-panel [class*="-title"],
.light-mode .answer-panel p,
.light-mode .answer-panel h2,
.light-mode .answer-panel h3,
.light-mode .answer-panel li,
.light-mode .answer-panel td,
.light-mode .answer-panel th { color: rgba(255,255,255,0.9) !important; }

/* =====================================================
   VISITED PAGE INDICATORS
   ===================================================== */

.nav-link-visited::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #E8922A;
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.7;
}

/* =====================================================
   RELATED TOOLS SECTION
   ===================================================== */

.related-tools {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.light-mode .related-tools {
    border-top-color: rgba(0,0,0,0.08);
}

.related-tools-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.55);
    margin-bottom: 16px;
}

.related-tools-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.related-tool-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.related-tool-card:hover {
    background: rgba(232,146,42,0.1);
    border-color: rgba(232,146,42,0.25);
    color: #E8922A;
    transform: translateY(-2px);
}

.light-mode .related-tool-card {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
    color: rgba(15,25,35,0.65);
}

/* =====================================================
   BREADCRUMB
   ===================================================== */

.breadcrumb {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,0.55); text-decoration: none; }
.breadcrumb a:hover { color: #E8922A; }
.breadcrumb span { opacity: 0.55; }
.light-mode .breadcrumb,
.light-mode .breadcrumb a { color: rgba(15,25,35,0.35); }

/* =====================================================
   GRADIENT TEXT ON HEADLINES (improvement #4)
   ===================================================== */
header h1 {
    background: linear-gradient(135deg, #E8922A 0%, #F4C96B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =====================================================
   CUSTOM SCROLLBAR (improvement #5)
   ===================================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0B0F1A; }
::-webkit-scrollbar-thumb { background: #E8922A; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #F4C96B; }

/* =====================================================
   INPUT FOCUS GLOW (improvement #6)
   ===================================================== */
input:focus, select:focus {
    outline: none;
    border-color: #E8922A !important;
    box-shadow: 0 0 0 3px rgba(232,146,42,0.15), 0 0 12px rgba(232,146,42,0.1) !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* =====================================================
   BUTTON RIPPLE EFFECT (improvement #7)
   ===================================================== */
.ripple-effect {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: rgba(255,255,255,0.25); transform: scale(0);
    animation: ripple-anim 0.6s linear;
}
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* =====================================================
   SCROLL-REVEAL ANIMATIONS (improvement #8)
   ===================================================== */
.reveal-ready { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-ready.revealed { opacity: 1; transform: translateY(0); }

/* =====================================================
   CARD DEPTH / GLASSMORPHISM REFINEMENT (improvement #9)
   ===================================================== */
.card, .col-input-card, .col-summary-card, .col-insight-card {
    box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.06) inset !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}
.card:hover, .col-summary-card:hover {
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.1) inset, 0 0 0 1px rgba(232,146,42,0.15) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* =====================================================
   PAGE TRANSITION (improvement #11)
   ===================================================== */
body { animation: pageEnter 0.35s ease forwards; }
/* No transform on body — body transforms create a containing block that breaks position:fixed children */
@keyframes pageEnter { from { opacity: 0; } to { opacity: 1; } }
.page-exit { animation: pageExit 0.28s ease forwards !important; }
@keyframes pageExit { to { opacity: 0; } }

.save-profile-btn { background:rgba(244,201,107,0.1); border:1px solid rgba(244,201,107,0.25); color:#F4C96B; padding:9px 20px; border-radius:10px; cursor:pointer; font-size:0.85rem; font-weight:600; margin-left:10px; transition:all 0.2s; }
.save-profile-btn:hover { background:rgba(244,201,107,0.2); }
.wp-toast { position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px); background:rgba(18,24,36,0.97); border:1px solid rgba(232,146,42,0.3); color:#fff; padding:12px 24px; border-radius:12px; font-size:0.88rem; font-weight:500; z-index:9999; opacity:0; transition:all 0.3s ease; white-space:nowrap; box-shadow:0 8px 32px rgba(0,0,0,0.4); }
.wp-toast.wp-toast-show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ================================================================
   ANIMATED MESH BACKGROUND
   ================================================================ */

/* Drifting orb layer */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(232,146,42,0.11) 0%, transparent 55%),
    radial-gradient(ellipse 55% 70% at 88% 12%, rgba(123,143,255,0.09) 0%, transparent 52%),
    radial-gradient(ellipse 65% 50% at 55% 88%, rgba(90,60,200,0.08) 0%, transparent 58%);
  animation: meshOrbs 22s ease-in-out infinite alternate;
}

@keyframes meshOrbs {
  0%   { opacity: 1;    filter: blur(0px); }
  40%  { opacity: 0.82; }
  70%  { opacity: 1;    }
  100% { opacity: 0.88; filter: blur(1px); }
}

/* Dot-grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 0);
  background-size: 30px 30px;
}

/* Edge vignette to focus center content */
.vignette-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 88% at 50% 44%, transparent 38%, rgba(5,7,16,0.5) 100%);
}

/* ================================================================
   IRIDESCENT / GRADIENT CARD BORDERS
   ================================================================ */

/* Cards and panels get prismatic borders */
.card,
.col-input-card,
.col-summary-card,
.insight-card,
.historical-panel,
.input-panel,
.blog-fact-card,
.archetype-card,
.pq-card,
.viz-card {
  background:
    linear-gradient(rgba(18,26,44,0.97), rgba(10,14,28,0.98)) padding-box,
    linear-gradient(135deg, rgba(232,146,42,0.38) 0%, rgba(123,143,255,0.28) 45%, rgba(244,201,107,0.32) 100%) border-box;
  border: 1.5px solid transparent !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover,
.col-input-card:hover,
.col-summary-card:hover,
.insight-card:hover,
.viz-card:hover {
  transform: translateY(-3px) scale(1.002);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.45),
    0 0 0 1px rgba(232,146,42,0.12),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ================================================================
   VISUALIZATIONS SECTION
   ================================================================ */

.viz-section {
  padding: 48px 0 32px;
}

.viz-section-header {
  text-align: center;
  margin-bottom: 32px;
}

.viz-section-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  background: linear-gradient(135deg, #E8922A 0%, #B8A0FF 55%, #F4C96B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px;
}

.viz-section-sub {
  color: rgba(255,255,255,0.45);
  font-size: 0.9rem;
  margin: 0;
}

.viz-card {
  border-radius: 18px;
  padding: 28px 24px;
  margin-bottom: 20px;
}

.viz-card-header {
  margin-bottom: 20px;
}

.viz-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.viz-card-header p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

/* Pyramid SVG container */
#viz-pyramid {
  overflow: hidden;
  border-radius: 10px;
}

.pyramid-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Curve canvas label strip */
.curve-axis-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.03em;
}

/* Neural canvas */
#viz-neural {
  display: block;
  width: 100%;
  border-radius: 10px;
}

/* YOU label tooltip on pyramid */
.pyramid-you-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,146,42,0.15);
  border: 1px solid rgba(232,146,42,0.35);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #E8922A;
  margin-top: 12px;
}

/* ════════════════════════════════════════════════════════
   WP ADVISOR — Floating AI Chat Widget
   ════════════════════════════════════════════════════════ */
#wp-advisor {
    position: fixed !important;
    bottom: 24px !important;
    right: 80px !important;
    left: auto !important;
    z-index: 99999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
}
.wpa-toggle-btn {
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 60%, #E8922A 100%);
    border: 2px solid rgba(255,255,255,0.15); cursor: pointer;
    display: flex !important; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 4px 24px rgba(99,102,241,0.55), 0 2px 8px rgba(0,0,0,0.55);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    animation: wpaPulse 3s ease-in-out 1.5s 3;
    visibility: visible !important;
    opacity: 1 !important;
}
@keyframes wpaPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(99,102,241,0.42), 0 2px 8px rgba(0,0,0,0.45); }
    50% { box-shadow: 0 4px 28px rgba(99,102,241,0.70), 0 0 0 8px rgba(99,102,241,0.14), 0 2px 8px rgba(0,0,0,0.45); }
}
.wpa-toggle-btn:hover { transform: scale(1.10); box-shadow: 0 6px 30px rgba(99,102,241,0.58), 0 2px 8px rgba(0,0,0,0.5); }
#wp-advisor.wpa-open .wpa-toggle-btn { background: linear-gradient(135deg, #F4C96B 0%, #C8962A 100%); color: #0A0E18; }
.wpa-badge {
    position: absolute; top: -2px; right: -2px;
    background: #F4C96B; color: #0A0E18;
    font-size: 7.5px; font-weight: 900; letter-spacing: 0.04em;
    padding: 2px 5px; border-radius: 6px; line-height: 1.1;
}
.wpa-panel {
    position: absolute; bottom: 62px; right: 0; left: auto;
    width: 368px; max-height: 530px;
    background: rgba(9,13,23,0.97);
    border: 1px solid rgba(232,146,42,0.20);
    border-radius: 20px; overflow: hidden;
    display: flex; flex-direction: column;
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.65), 0 0 0 1px rgba(232,146,42,0.06), inset 0 1px 0 rgba(255,255,255,0.04);
    opacity: 0; transform: translateY(14px) scale(0.96);
    pointer-events: none; transition: opacity 0.26s ease, transform 0.26s ease;
}
#wp-advisor.wpa-open .wpa-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.wpa-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 15px; border-bottom: 1px solid rgba(232,146,42,0.09);
    background: linear-gradient(180deg, rgba(20,30,50,0.9) 0%, rgba(12,18,32,0.7) 100%);
    flex-shrink: 0;
}
.wpa-header-left { display: flex; align-items: center; gap: 10px; }
.wpa-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(232,146,42,0.18), rgba(232,146,42,0.04));
    border: 1px solid rgba(232,146,42,0.28);
    display: flex; align-items: center; justify-content: center;
    color: #E8922A; flex-shrink: 0;
}
.wpa-name { font-size: 12.5px; font-weight: 700; color: #fff; line-height: 1.2; letter-spacing: 0.01em; }
.wpa-status { font-size: 9.5px; color: rgba(232,146,42,0.65); letter-spacing: 0.05em; text-transform: uppercase; }
.wpa-header-btns { display: flex; gap: 2px; }
.wpa-icon-btn {
    width: 27px; height: 27px; border-radius: 8px;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.38);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.wpa-icon-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.78); }
.wpa-setup {
    display: flex; flex-direction: column; align-items: center;
    padding: 26px 22px; text-align: center; gap: 11px; flex: 1;
}
.wpa-setup-icon { font-size: 38px; line-height: 1; }
.wpa-setup h3 { font-size: 14.5px; font-weight: 700; color: #fff; margin: 0; }
.wpa-setup p { font-size: 11.5px; color: rgba(255,255,255,0.50); margin: 0; line-height: 1.55; max-width: 290px; }
.wpa-setup input {
    width: 100%; padding: 10px 13px; border-radius: 10px;
    background: rgba(255,255,255,0.055); border: 1px solid rgba(232,146,42,0.18);
    color: #fff; font-size: 11.5px; font-family: 'SF Mono', Consolas, monospace;
    outline: none; box-sizing: border-box; transition: border-color 0.15s;
}
.wpa-setup input:focus { border-color: rgba(232,146,42,0.44); }
.wpa-save-btn {
    width: 100%; padding: 10px; border-radius: 10px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 55%, #E8922A 100%);
    border: none; cursor: pointer; color: #fff;
    font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
    transition: opacity 0.15s, transform 0.15s;
}
.wpa-save-btn:hover { opacity: 0.87; transform: translateY(-1px); }
.wpa-note { font-size: 10px; color: rgba(255,255,255,0.26); margin: 0; line-height: 1.5; }
.wpa-get-key { font-size: 11px; color: #E8922A; text-decoration: none; opacity: 0.75; transition: opacity 0.15s; }
.wpa-get-key:hover { opacity: 1; }
.wpa-model-row { width: 100%; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.wpa-model-label { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.wpa-model-select {
    width: 100%; padding: 9px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.055); border: 1px solid rgba(232,146,42,0.18);
    color: #fff; font-size: 13px; font-family: inherit;
    outline: none; cursor: pointer; transition: border-color 0.15s;
}
.wpa-model-select:focus { border-color: rgba(232,146,42,0.44); }
.wpa-model-select option { background: #1a2332; color: #fff; }
.wpa-key-meta { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#wpa-key-hint { font-size: 10.5px; color: rgba(255,255,255,0.32); }
#wpa-key-link { font-size: 10.5px; color: #E8922A; text-decoration: none; white-space: nowrap; }
#wpa-key-link:hover { text-decoration: underline; }
.wpa-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wpa-messages {
    flex: 1; overflow-y: auto; padding: 14px 14px 6px;
    display: flex; flex-direction: column; gap: 10px;
    max-height: 316px;
    scrollbar-width: thin; scrollbar-color: rgba(232,146,42,0.18) transparent;
}
.wpa-messages::-webkit-scrollbar { width: 4px; }
.wpa-messages::-webkit-scrollbar-thumb { background: rgba(232,146,42,0.18); border-radius: 2px; }
.wpa-msg { display: flex; }
.wpa-msg-user  { justify-content: flex-end; }
.wpa-msg-assistant { justify-content: flex-start; }
.wpa-msg-content {
    max-width: 88%; padding: 9px 13px; border-radius: 14px;
    font-size: 12px; line-height: 1.58; word-break: break-word;
}
.wpa-msg-user .wpa-msg-content {
    background: linear-gradient(135deg, rgba(232,146,42,0.20), rgba(232,146,42,0.09));
    border: 1px solid rgba(232,146,42,0.22); color: rgba(255,255,255,0.92);
    border-bottom-right-radius: 4px;
}
.wpa-msg-assistant .wpa-msg-content {
    background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.065);
    color: rgba(255,255,255,0.84); border-bottom-left-radius: 4px;
}
.wpa-msg-content p { margin: 0 0 5px; }
.wpa-msg-content p:last-child { margin-bottom: 0; }
.wpa-msg-content strong { color: #E8922A; font-weight: 600; }
.wpa-msg-content em { color: #F4C96B; font-style: normal; }
.wpa-msg-content code { background: rgba(232,146,42,0.10); padding: 1px 5px; border-radius: 4px; font-size: 10.5px; font-family: monospace; color: #E8922A; }
.wpa-err { color: #ff6b6b; font-size: 11px; }
.wpa-cursor {
    display: inline-block; width: 5px; height: 12px;
    background: #E8922A; margin-left: 2px; vertical-align: text-bottom;
    border-radius: 1px; animation: wpaBlink 0.85s step-end infinite;
}
@keyframes wpaBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.wpa-quick-prompts { padding: 0 10px 7px; display: flex; flex-wrap: wrap; gap: 5px; flex-shrink: 0; }
.wpa-qp {
    padding: 4px 10px; background: rgba(232,146,42,0.07);
    border: 1px solid rgba(232,146,42,0.15); border-radius: 20px;
    font-size: 10px; color: rgba(255,255,255,0.62); cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap;
}
.wpa-qp:hover { background: rgba(232,146,42,0.16); border-color: rgba(232,146,42,0.30); color: #fff; }
.wpa-input-row {
    padding: 7px 10px 11px; display: flex; align-items: flex-end; gap: 7px;
    border-top: 1px solid rgba(255,255,255,0.055); flex-shrink: 0;
}
.wpa-input-row textarea {
    flex: 1; padding: 8px 11px;
    background: rgba(255,255,255,0.055); border: 1px solid rgba(232,146,42,0.13);
    border-radius: 11px; color: rgba(255,255,255,0.9); font-size: 11.5px;
    resize: none; outline: none; font-family: inherit; line-height: 1.45;
    transition: border-color 0.15s; max-height: 100px; overflow-y: auto;
}
.wpa-input-row textarea:focus { border-color: rgba(232,146,42,0.36); }
.wpa-input-row textarea::placeholder { color: rgba(255,255,255,0.28); }
.wpa-send-btn {
    width: 33px; height: 33px; border-radius: 10px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border: none; cursor: pointer; color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: opacity 0.15s, transform 0.15s;
}
.wpa-send-btn:hover { opacity: 0.84; transform: scale(1.06); }
.wpa-send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
@media (max-width: 500px) {
    #wp-advisor { left: 12px; bottom: 72px; }
    .wpa-panel { width: calc(100vw - 28px); max-height: 80vh; }
}

/* ════════════════════════════════════════════════════════
   GLOBAL CARD UPGRADES — premium violet-gold palette
   ════════════════════════════════════════════════════════ */
.card, .twin-result-card, .goal-milestone, .journal-entry-card,
.wem-card, .lb-row, .quiz-question-card, .life-card, .col-summary-card {
    position: relative;
}
/* Shimmer line: violet→gold across card top */
.card::before, .twin-result-card::before, .goal-milestone::before,
.journal-entry-card::before, .quiz-question-card::before,
.life-card::before, .col-summary-card::before {
    content: '';
    display: block; position: absolute;
    top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167,139,250,0.50), rgba(244,201,107,0.40), transparent);
    pointer-events: none;
}
/* Hover: gold glow */
.card:hover, .twin-result-card:hover, .goal-milestone:hover,
.life-card:hover, .col-summary-card:hover {
    border-color: rgba(244,201,107,0.32) !important;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.5),
        0 0 32px rgba(244,201,107,0.08),
        0 0 0 1px rgba(244,201,107,0.10) !important;
    transform: translateY(-2px);
}
/* Number values — richer gold */
.result-big-num, .rank-number, .quiz-result-score,
.lb-pct, .life-stat-val, .col-rank-num,
.journal-summary-val, .goal-gap-val, .twin-pct {
    background: linear-gradient(135deg, #FFE08A 0%, #F4C96B 50%, #E8A820 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Input/select focus — indigo */
.other-page input[type="number"]:focus,
.other-page input[type="text"]:focus,
.other-page select:focus,
.other-page textarea:focus {
    border-color: rgba(99,102,241,0.55) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
    outline: none;
}
/* Primary buttons — indigo→teal gradient */
.other-page .calculate-btn, .other-page .col-calc-btn,
.other-page .wem-btn, .other-page .quiz-submit-btn,
.other-page .lb-submit-btn, .other-page .goal-calc-btn,
.other-page .journal-add-btn, .other-page .life-calc-btn,
.other-page .twin-submit-btn, .other-page .compare-calc-btn {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 50%, #E8922A 100%) !important;
    color: #fff !important; border: none !important;
    font-weight: 700; letter-spacing: 0.03em;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s !important;
}
.other-page .calculate-btn:hover, .other-page .col-calc-btn:hover,
.other-page .wem-btn:hover, .other-page .quiz-submit-btn:hover,
.other-page .lb-submit-btn:hover, .other-page .goal-calc-btn:hover,
.other-page .journal-add-btn:hover, .other-page .life-calc-btn:hover,
.other-page .twin-submit-btn:hover, .other-page .compare-calc-btn:hover {
    opacity: 0.90 !important; transform: translateY(-1px) !important;
    box-shadow: 0 8px 28px rgba(99,102,241,0.40) !important;
}

/* ── Game result share buttons (quiz, wem) ────────── */
.final-share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 18px 0 6px;
}
.quiz-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, color 0.18s ease;
}
.quiz-share-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}
.quiz-share-x    { border-color: rgba(255,255,255,0.2); }
.quiz-share-x:hover  { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); }
.quiz-share-wa   { border-color: rgba(37,211,102,0.3); }
.quiz-share-wa:hover { background: rgba(37,211,102,0.12); border-color: rgba(37,211,102,0.5); color: #25d366; }
.quiz-share-copy { border-color: rgba(47,214,200,0.3); }
.quiz-share-copy:hover { background: rgba(47,214,200,0.1); border-color: rgba(47,214,200,0.5); color: #2FD6C8; }

@media (max-width: 480px) {
    .final-share-row { gap: 8px; }
    .quiz-share-btn  { padding: 9px 14px; font-size: 0.78rem; }
}

/* ── Mobile nav cleanup ── */
@media (max-width: 900px) {
    /* Hide theme toggle from top bar on mobile — too cramped */
    .theme-toggle { display: none !important; }
    /* Nav items in mobile overlay should be full-width left-aligned */
    .nav-item { width: 100%; max-width: none; }
    .nav-link { text-align: left; max-width: none; font-size: 0.95rem; }
}
