/* RESET & SYSTEM FONTS */
        :root {
            --bg: #050505;
            --bg-secondary: #0a0a0a;
            --text-main: #ffffff;
            --text-muted: #888888;
            --border: #1a1a1a;
            --glass: rgba(10, 10, 10, 0.6);
            --card-bg: rgba(15, 15, 15, 0.4);
            --input-bg: rgba(255,255,255,0.03);
            --overlay-bg: rgba(0, 0, 0, 0.85);
            --shadow-color: rgba(0,0,0,0.6);
        }

        [data-theme="light"] {
            --bg: #ffffff;
            --bg-secondary: #f7f7f7;
            --text-main: #111111;
            --text-muted: #6b6b6b;
            --border: #e4e4e4;
            --glass: rgba(255, 255, 255, 0.75);
            --card-bg: rgba(0, 0, 0, 0.03);
            --input-bg: rgba(0,0,0,0.03);
            --overlay-bg: rgba(255, 255, 255, 0.85);
            --shadow-color: rgba(0,0,0,0.08);
        }
/* ICON THEME ADAPTATION - works for any img-based SVG icon */
img.theme-icon {
    filter: invert(1) brightness(2);
    transition: filter 0.3s ease;
}

[data-theme="light"] img.theme-icon {
    filter: invert(0) brightness(1);
}
        html, body {
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        body {
            background-color: var(--bg);
            color: var(--text-main);
            overflow-x: hidden;
            line-height: 1.6;
        }
        a {
            color: inherit;
            text-decoration: none;
        }

        /* LENIS SMOOTH SCROLL */
        html.lenis { height: auto; }
        .lenis.lenis-smooth { scroll-behavior: auto !important; }
        .lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
        .lenis.lenis-stopped { overflow: hidden; }
        .lenis.lenis-scrolling iframe { pointer-events: none; }

        /* NAVIGATION */
        nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 4rem;
    display: flex;
    justify-content: flex-start;
    gap: 2rem;
    align-items: center;
    z-index: 100;
    clip-path: inset(0 0 -1000px 0);
    transition: background 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}
        nav.scrolled {
            padding: 0.7rem 4rem;
            background: var(--glass);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border);
        }
        .logo {
            font-size: 1.2rem;
            font-weight: 600;
            letter-spacing: 2px;
        }
        .logo-icon-wrap {
            display: inline-block;
            overflow: hidden;
            width: 0;
            opacity: 0;
            transform: scale(0.5);
            transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                        opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                        margin-right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }
        nav.scrolled .logo-icon-wrap {
            width: 24px;
            opacity: 1;
            transform: scale(1);
            margin-right: 0.5rem;
        }
        .logo-mark-wrap {
            display: inline-block;
            overflow: hidden;
            white-space: nowrap;
            width: 245px;
            opacity: 1;
            transition: width 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                        opacity 0.3s ease;
        }
        nav.scrolled .logo-mark-wrap {
            width: 0;
            opacity: 0;
            transition: width 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                        opacity 0.25s ease;
        }
        .nav-links {
            display: flex;
            gap: 2.5rem;
        }
        .nav-links a {
            font-size: 0.85rem;
            color: var(--text-muted);
            text-transform: none;
            font-weight: 500;
            letter-spacing: 1px;
            transition: color 0.3s ease;
        }
        .nav-links a:hover {
            color: var(--text-main);
        }
.nav-links a.active {
    color: var(--text-main);
}
        /* BUTTONS */
        .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    font-weight: 500;
}
        .btn:hover {
            background: var(--text-main);
            color: var(--bg);
        }
.btn-insights {
    background: var(--text-main);
    color: var(--bg);
}
        .btn span {
            font-size: 1.1rem;
            line-height: 1;
        }
.btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
        /* COMING SOON - GOTO PILLS */
        .cs-goto-row {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: center;
            margin-top: 1rem;
        }
        .cs-goto-pill {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.8rem 1.4rem;
            border: 1.5px solid #2f88ff;
            border-radius: 999px;
            background: transparent;
            color: var(--text-main);
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.25s ease, color 0.25s ease;
        }
        .cs-goto-pill svg {
            width: 16px;
            height: 16px;
            color: var(--text-muted);
            flex-shrink: 0;
        }
        .cs-goto-pill:hover {
            background: #2f88ff;
            color: #fff;
        }
        .cs-goto-pill:hover svg {
            color: #fff;
        }

        /* HERO SECTION */
        .hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 10vw 4rem;
    position: relative;
}
        .hero h1 {
            font-size: clamp(3rem, 8vw, 8rem);
            font-weight: 500;
            letter-spacing: -2px;
            line-height: 1.1;
            margin-bottom: 1rem;
            opacity: 0;
            transform: translateY(30px);
        }
        .hero h2 {
            font-weight: 400;
            margin-bottom: 0.4rem;
            opacity: 0;
            transform: translateY(30px);
        }
        .hero-headline {
    font-size: clamp(1.2rem, 2.4vw, 1.9rem);
    color: color-mix(in srgb, var(--text-main) 85%, transparent);
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.3px;
    max-width: 900px;
}
        .hero-tagline {
            font-size: clamp(1.8rem, 3.4vw, 2.9rem);
            color: var(--text-main);
            font-weight: 400;
            line-height: 1.4;
            letter-spacing: -0.3px;
            max-width: 900px;
            margin-bottom: 0.4rem;
            opacity: 0;
            transform: translateY(30px);
        }
        .hero-divider {
    width: 100%;
    max-width: 1200px;
    height: 1px;
    background: var(--border);
    margin-top: 2rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
}
        .hero-intro {
            max-width: 600px;
            font-size: 1.45rem;
            font-weight: 340;
            color: #9d9db8;
            margin-bottom: 0.8rem;
            opacity: 0;
            transform: translateY(30px);
        }
        .hero-intro p { margin-bottom: 1rem; }
        .hero-btns {
            display: flex;
            gap: 1.5rem;
            opacity: 0;
            transform: translateY(30px);
        }

        /* STORYTELLING SECTIONS */
        .story-section {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            text-align: center;
            padding: 0 2rem;
            overflow: hidden;
        }
        .huge-text {
            font-size: clamp(2rem, 5vw, 5rem);
            font-weight: 300;
            letter-spacing: -1px;
        }
        #canvas-container-1, #canvas-container-2 {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            pointer-events: none;
        }

        /* SECTION 4 - WORD BY WORD */
        .word-reveal {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            font-size: clamp(3rem, 6vw, 6rem);
            font-weight: 400;
        }
        .word { opacity: 0.1; }

        /* ABOUT */
        .standard-section {
    --section-pad-x: 10vw;
    padding: 10vh var(--section-pad-x);
    max-width: 100%;
    margin: 0;
}
        .section-title {
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0px;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}
        .about-text {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    max-width: 900px;
    color: #9d9db8;
    line-height: 1.5;
}
.about-text span { color: var(--text-main); }

        /* JOIN CARD */
        .join-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4vh 2rem; /* 10vh → 4vh */
}
        .join-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 4rem;
            text-align: center;
            max-width: 700px;
            backdrop-filter: blur(10px);
        }
        .join-card h3 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            font-weight: 400;
        }
        .join-card p {
            color: var(--text-muted);
            margin-bottom: 2.5rem;
            font-size: 1.1rem;
        }
        .join-card .disclaimer {
            display: block;
            margin-top: 1.5rem;
            font-size: 0.8rem;
            color: #555;
        }
.join-content {
    max-width: 640px;
    margin-bottom: 1rem;
}
.join-subheading {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0;   /* gap between heading and paragraph below it removed */
    margin-top: 0.2rem;   /* controls gap above "Become Part of the Journey" */
}
.join-desc {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;   /* restored — keeps gap before "Join now" button */
}
.join-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--bg);
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 500;
    text-decoration: none;
    background: var(--text-main);
    transition: all 0.3s ease;
}
.join-now-btn svg {
    width: 16px;
    height: 16px;
    color: var(--bg);
    flex-shrink: 0;
    transition: color 0.25s ease;
}
.join-now-btn:hover {
    background: var(--text-main);
    color: var(--bg);
}
.join-now-btn:hover svg {
    color: var(--bg);
}
.join-why-heading {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 1.2rem;
}
.join-grid-scroll {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.join-grid-scroll::-webkit-scrollbar {
    height: 6px;
}
.join-grid-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
.join-grid-scroll .join-card-item {
    flex: 0 0 280px;
    scroll-snap-align: start;
}
@media (max-width: 600px) {
    .join-grid-scroll {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }
    .join-grid-scroll .join-card-item {
        flex: 0 0 90%;
    }
}
.join-card-item {
    background: #29292c;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
}
[data-theme="light"] .join-card-item {
    background: #f0f0f2;
}
.join-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-bottom: 0.6rem;
    display: block;
}
.join-card-item h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}
.join-card-item p {
    font-size: 0.88rem;
    color: #a8a8ad;
    line-height: 1.5;
    margin: 0;
}
[data-theme="light"] .join-card-item p {
    color: var(--text-muted);
}
/* ===== JOIN HERO (xAI-inspired) ===== */
.join-hero {
    display: flex;
    gap: 4rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 2rem;
}
.join-hero-left {
    flex: 1 1 420px;
    min-width: 300px;
}
.join-eyebrow {
    color: #999;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.8rem;
}
.join-hero-title {
    font-size: clamp(1.9rem, 3.8vw, 2.9rem);
    line-height: 1.05;
    font-weight: 500;
    color: var(--text-main);
    margin: 0 0 1.2rem 0;
}
.join-hero-title-muted {
    color: #9d9db8;
}
.join-hero-desc {
    color: #9d9db8;
    opacity: 1;
    max-width: 460px;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1.6rem;
}
.join-hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}
.join-hero-btn-primary {
    background: var(--text-main);
    color: var(--bg);
    padding: 0.42rem 1.05rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8rem;
    transition: opacity 0.2s ease;
}
.join-hero-btn-primary:hover { opacity: 0.85; }
.join-hero-btn-secondary {
    border: 1px solid rgba(153,153,153,0.5);
    color: var(--text-main);
    padding: 0.42rem 1.05rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.join-hero-btn-secondary:hover {
    border-color: var(--text-main);
    background: rgba(153,153,153,0.08);
}
.join-hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.join-hero-stat-num {
    font-size: 0.88rem;
    font-weight: 500;
    color: #b0b0b0;
    opacity: 1;
}
.join-hero-stat-label {
    color: #999;
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

/* Right — MacBook code-window panel */
.join-hero-right {
    flex: 1 1 420px;
    min-width: 300px;
}
.join-mac-window {
    max-width: 480px;
    margin-left: auto;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
[data-theme="light"] .join-mac-window {
    background: #111111;
    border-color: rgba(0,0,0,0.1);
}
.join-mac-titlebar {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.join-mac-dots { display: flex; gap: 0.5rem; }
.join-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.join-dot-red { background: #ff5f56; }
.join-dot-yellow { background: #ffbd2e; }
.join-dot-green { background: #27c93f; }

.join-mac-screen {
    position: relative;
    padding: 1.6rem 1.5rem;
    min-height: 220px;
}
.join-mac-panel {
    display: none;
    animation: joinFadeIn 0.25s ease;
}
.join-mac-panel.active { display: block; }
@keyframes joinFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.join-mac-brand {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 1.4rem;
}
.join-mac-panel-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.join-mac-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.8rem 0;
}
.join-mac-list li {
    color: #ccc;
    font-size: 0.92rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.join-mac-footer {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
}
.jn-testi-outer {
    background: #161616;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 2.2rem 2.2rem 0;
    max-width: 480px;
    margin: 0 0 2rem auto;
}
.jn-testi-outer-title { color: #fff; font-size: 1.4rem; font-weight: 700; margin-bottom: 0.3rem; }
.jn-testi-outer-sub { color: #999; font-size: 0.92rem; line-height: 1.5; margin-bottom: 1.1rem; }

.jn-testi-window {
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}
.jn-testi-titlebar {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.jn-testi-dots { display: flex; gap: 0.4rem; }
.jn-testi-dots span { width: 9px; height: 9px; border-radius: 50%; background: #555; display: inline-block; }
.jn-testi-titlebar-label { flex: 1; text-align: center; color: #888; font-size: 0.85rem; }
.jn-testi-badge {
    background: rgba(139,124,246,0.15);
    color: #a89bfa;
    font-size: 0.72rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
}

.jn-testi-screen {
    padding: 1.2rem 1.6rem 0.6rem;
    display: flex;
    flex-direction: column;
}
.jn-testi-card {
    display: flex;
    flex-direction: column;
    animation: joinFadeIn 0.3s ease;
}
.jn-testi-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}
.jn-testi-avatar {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b7cf6, #6d5bd0);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.95rem;
}
.jn-testi-headtext { display: flex; flex-direction: column; }
.jn-testi-name { color: #fff; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.jn-testi-tag { color: #888; font-size: 0.78rem; line-height: 1.3; }

.jn-testi-quote {
    color: #ccc;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
    height: calc(1.6em * 4);
    overflow-y: auto;
    padding-right: 8px;
}
.jn-testi-quote::-webkit-scrollbar { width: 5px; }
.jn-testi-quote::-webkit-scrollbar-track { background: transparent; }
.jn-testi-quote::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 10px; }
.jn-testi-quote::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

.jn-testi-controls {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
    padding: 0.8rem 1.6rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.jn-testi-controls button {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: #aaa;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.jn-testi-controls button:hover { background: rgba(255,255,255,0.06); color: #fff; }

@media (max-width: 900px) {
    .jn-testi-outer { max-width: 100%; margin: 0 0 2rem 0; }
}
.join-mac-tabs {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.2rem;
    max-width: 480px;
    margin-left: auto;
    justify-content: flex-start;
}
.join-mac-tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.join-mac-tab.active {
    background: #1c1c1c;
    color: #fff;
}
.join-mac-tab:not(.active):hover {
    color: #ccc;
}

@media (max-width: 768px) {
    .join-hero { gap: 2.5rem; }
    .join-hero-stats { gap: 0.9rem; flex-wrap: nowrap; }
    .join-hero-stat-num { font-size: 0.78rem; }
    .join-hero-stat-label { font-size: 0.68rem; }
    .join-mac-screen { padding: 1.8rem 1.4rem; min-height: 260px; }
}
        /* INSIGHTS LIST */
.insights-list {
    display: flex;
    flex-direction: column;
    max-width: 600px;
}
.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    transition: color 0.3s ease;
    cursor: pointer;
}
.insight-item:first-child {
    border-top: 1px solid var(--border);
}
.insight-item:hover {
    color: var(--text-main);
}
.insight-item span {
    font-size: 1rem;
    letter-spacing: 0.5px;
}
.insight-item svg {
    width: 18px;
    height: 18px;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.insight-item:hover svg {
    opacity: 1;
}

        /* FEEDBACK FORM */
        .feedback-form {
            max-width: 600px;
            display: flex;
            flex-direction: column;
             gap: 0.65rem;
        }
        .input-group input, .input-group textarea {
            width: 100%;
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--border);
            padding: 0.5rem 0;
            color: var(--text-main);
            font-size: 1rem;
            transition: border-color 0.3s ease;
        }
        .input-group input::placeholder, .input-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}
        .input-group input:focus, .input-group textarea:focus {
            outline: none;
            border-bottom-color: var(--text-muted);
        }
        .input-group textarea {
            resize: none;
            height: 100px;
        }
/* SHARE FEEDBACK BUTTON */
.share-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--bg);
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 500;
    cursor: pointer;
    background: var(--text-main);
    transition: all 0.3s ease;
}
.share-feedback-btn svg {
    width: 16px;
    height: 16px;
    color: var(--bg);
    flex-shrink: 0;
    transition: color 0.25s ease;
}
.share-feedback-btn:hover {
    background: var(--text-main);
    color: var(--bg);
}
/* FEEDBACK MODAL OVERLAY */
.feedback-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(12px);
    z-index: 600;
    justify-content: center;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    padding: 4vh 1rem;
}
.feedback-modal-overlay.open {
    opacity: 1;
}
.feedback-modal {
    background: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 92%;
    max-width: 460px;
    padding: 1.4rem 1.6rem 1.8rem;
    position: relative;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    margin: auto;
}
.feedback-modal-overlay.open .feedback-modal {
    transform: translateY(0) scale(1);
}
.feedback-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}
.feedback-modal-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 0.6rem;
}
.feedback-modal-illustration img {
    width: 90px;
    height: auto;
}
.feedback-modal-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.6rem;
}
.feedback-modal-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}
.feedback-input-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.25rem 1rem;
}
.feedback-input-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}
.feedback-input-group input,
.feedback-input-group textarea {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.95rem;
    line-height: 18px;
    color: var(--text-main);
}
.feedback-input-group input::placeholder,
.feedback-input-group textarea::placeholder {
    color: var(--text-muted);
}
.feedback-textarea-group {
    align-items: flex-start;
}
.feedback-textarea-group .feedback-input-icon {
    margin-top: 2px;
}
.feedback-textarea-group textarea {
    margin-top: -6px;
}
.feedback-textarea-group textarea {
    resize: none;
    height: 75px;
}
.feedback-star-row {
    display: flex;
    gap: 0.6rem;
    margin: 0;
}
.feedback-rate-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}
.feedback-rate-status {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: -0.4rem 0 0;
    min-height: 1em;
    transition: opacity 0.2s ease;
}
.feedback-star-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.feedback-star-btn img {
    width: 20px;
    height: 20px;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}
.feedback-star-btn.active img {
    opacity: 1;
}
.feedback-star-btn.active {
    border-color: #ffb020;
    background: rgba(255, 176, 32, 0.08);
}
.feedback-submit-btn {
    width: 100%;
    padding: 0.6rem 1.3rem;
    border: none;
    border-radius: 8px;
    background: #2f88ff;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.25s ease;
}
.feedback-submit-btn:hover {
    background: #2374e0;
}
        /* CONNECT LIST */
.connect-grid {
    display: flex;
    flex-direction: column;
    max-width: 600px;
}
.connect-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    transition: color 0.3s ease;
}
.connect-link:first-child {
    border-top: 1px solid var(--border);
}
.connect-link:hover {
    color: var(--text-main);
    background: transparent;
    border-color: var(--border);
}
.connect-link .connect-icon {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
        .connect-link img.theme-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.3s ease, filter 0.3s ease;
    display: block;
}
.connect-link span:last-child {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}
.connect-link span:last-child svg {
    width: 16px;
    height: 16px;
    opacity: 1;
}
.connect-link:hover span:last-child {
    opacity: 1;
}
.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.insight-item .insight-icon {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.insight-item img.theme-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.3s ease, filter 0.3s ease;
    display: block;
}
.insight-item:hover img.theme-icon {
    opacity: 1;
}
.insight-item .insight-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}
.insight-item .insight-arrow svg {
    width: 16px;
    height: 16px;
}
.insight-item:hover .insight-arrow {
    opacity: 1;
}
        /* ============================================
   BOOKS LIBRARY SYSTEM
   ============================================ */

/* PAGE OVERLAY BASE */
.library-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 500;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.library-page.active {
    display: block;
}
.library-page.visible {
    opacity: 1;
    transform: translateX(0);
}
.library-page.slide-out {
    opacity: 0;
    transform: translateX(-40px);
}

/* LIBRARY HEADER */
.library-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1rem 1.5rem 0.8rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.library-header.scrolled {
    border-bottom-color: var(--border);
}
.library-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.3rem 0;
    margin-bottom: 0.1rem;
    transition: color 0.25s ease;
    letter-spacing: 0.3px;
}
.library-back-btn.sub-grid-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;              
    font-weight: 600;
    color: var(--text-main);               
    cursor: pointer;
    letter-spacing: 0.2px;
}
.sub-grid-back-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-main);
}
.item-detail-body .sub-grid-back-btn {
    display: flex;
    text-align: left;
    margin-left: 0;
    margin-right: auto;
}
.library-back-btn:hover {
    color: var(--text-main);
}
.library-back-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.library-page-title {
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-main);
    line-height: 1.1;
    padding: 0.2rem 0 1.2rem;
}

/* ---- COLLECTIONS PAGE ---- */
.collections-list {
    padding: 0 1.5rem;
}
.collection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.collection-item::after {
    content: "";
    position: absolute;
    left: 2.3rem;
    right: 0;
    bottom: 0;
    border-bottom: 1px solid var(--border);
}
.collection-item:first-child {
    padding-top: 0;
}
.collection-item-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.collection-item-name {
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 400;
    letter-spacing: 0.1px;
}
.collection-item-count {
    font-size: 1rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}
.collection-item-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.collection-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.collection-chevron {
    width: 14px;
    height: 14px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    transition: stroke 0.2s ease;
}
.collection-item:active {
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
}
.collection-item:hover .collection-chevron {
    stroke: var(--text-main);
}
.collection-item:hover .collection-item-name {
    color: #ffffff;
}

/* ---- BOOKS GRID PAGE ---- */
.books-grid-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem 0.8rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.books-grid-header.scrolled {
    border-bottom-color: var(--border);
}
.books-grid-header .library-back-btn {
    margin-bottom: 0;
    font-size: 0.9rem;
}
.books-grid-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.3px;
}
        .library-search-wrapper {
    margin: 1rem 1.5rem 0;
}
.library-search-input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 3.1rem;
    border-radius: 14px;
    border: none;
    background-color: rgba(255,255,255,0.08);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239a9a9a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7.5"></circle><line x1="21.5" y1="21.5" x2="16" y2="16"></line></svg>');
    background-repeat: no-repeat;
    background-position: 1.1rem center;
    background-size: 19px 19px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: background-color 0.25s ease;
}
[data-theme="light"] .library-search-input {
    background-color: rgba(0,0,0,0.06);
}
.library-search-input::placeholder {
    color: var(--text-muted);
}
.library-search-input:focus {
    background-color: rgba(255,255,255,0.1);
}
[data-theme="light"] .library-search-input:focus {
    background-color: rgba(0,0,0,0.08);
}
@media (min-width: 900px) {
    .library-search-wrapper { margin: 1.2rem 3rem 0; }
}
.books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.2rem;
    padding: 2rem 1.5rem 4rem;
}
@media (min-width: 600px) {
    .books-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .books-grid { grid-template-columns: repeat(4, 1fr); gap: 2.5rem 1.8rem; padding: 2.5rem 3rem 5rem; }
}
@media (min-width: 1200px) {
    .books-grid { grid-template-columns: repeat(5, 1fr); }
}

/* BOOK CARD */
.book-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    cursor: default;
    animation: bookFadeIn 0.5s ease both;
    align-items: stretch;
}
@keyframes bookFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 2px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 8px 24px var(--shadow-color),
                0 2px 6px var(--shadow-color);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.3s ease;
}
.book-cover-wrapper:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0,0,0,0.7),
                0 4px 10px rgba(0,0,0,0.5);
}
.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-secondary);
    text-align: center;
    gap: 0.5rem;
}
.book-cover-placeholder span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    line-height: 1.3;
}
.book-info {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    flex: 1;
    justify-content: flex-start;
}
.book-card {
    min-width: 0; 
}
.book-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    height: 1.15em;
    margin-bottom: 0.15rem;
}
.book-author {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 1.2em;
}
.book-read-btn {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    background: #2a2a2e;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.25s ease,
                border-color 0.25s ease,
                color 0.25s ease;
    width: fit-content;
    text-decoration: none;
}
button.book-read-btn {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    box-sizing: border-box;
    font-family: inherit;
    line-height: inherit;
}
.book-read-btn:hover {
    background: #3a3a3e;
    color: var(--text-main);
    border-color: var(--border);
}
[data-theme="light"] .book-read-btn {
    background: #ececee;
    color: #000;
}
[data-theme="light"] .book-read-btn:hover {
    background: #dfdfe2;
    color: #000;
}
.featured-section {
    position: relative;
    overflow: hidden;
}
.featured-bg {
    position: absolute;
    top: 3rem;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.14), rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 0;
}
[data-theme="light"] .featured-bg {
    background: linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0) 100%);
}
.featured-section > *:not(.featured-bg) {
    position: relative;
    z-index: 1;
}
.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.2rem;
    margin-top: 1rem;
}
.featured-scroll-row {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 1rem;
    margin-left: calc(var(--section-pad-x, 10vw) * -1);
    margin-right: calc(var(--section-pad-x, 10vw) * -1);
    padding-left: var(--section-pad-x, 10vw);
    padding-right: var(--section-pad-x, 10vw);
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.featured-scroll-row::-webkit-scrollbar {
    display: none;
}
.featured-scroll-row .book-card {
    flex: 0 0 auto;
    width: 150px;
}
@media (min-width: 600px) {
    .featured-scroll-row .book-card {
        width: 180px;
    }
}
@media (min-width: 600px) {
    .featured-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .featured-grid { grid-template-columns: repeat(4, 1fr); gap: 2.5rem 1.8rem; }
}
#all-time-favorites-collection {
    margin-top: -11vh;
}
/* BOOKMARK / SHARE ICON BUTTONS */
.book-actions-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.book-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.25s ease;
}
.book-icon-btn:hover {
    background: var(--card-bg);
}
.book-icon-btn img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}
.book-icon-btn.active {
    border-color: #2f88ff;
    background: rgba(47, 136, 255, 0.12);
}
.book-icon-btn.active img {
    filter: invert(37%) sepia(84%) saturate(1988%) hue-rotate(199deg) brightness(101%) contrast(101%);
}
[data-theme="light"] .book-icon-btn:not(.active) img {
    filter: invert(1) brightness(0.4);
}
/* EMPTY STATE */
.books-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
    font-size: 1rem;
}

/* STAGGER ANIMATION DELAYS */
.book-card:nth-child(1)  { animation-delay: 0.03s; }
.book-card:nth-child(2)  { animation-delay: 0.06s; }
.book-card:nth-child(3)  { animation-delay: 0.09s; }
.book-card:nth-child(4)  { animation-delay: 0.12s; }
.book-card:nth-child(5)  { animation-delay: 0.15s; }
.book-card:nth-child(6)  { animation-delay: 0.18s; }
.book-card:nth-child(7)  { animation-delay: 0.21s; }
.book-card:nth-child(8)  { animation-delay: 0.24s; }
.book-card:nth-child(9)  { animation-delay: 0.27s; }
.book-card:nth-child(10) { animation-delay: 0.30s; }
        
        /* FOOTER — xAI STYLE */
.site-footer {
    padding: 6vh 10vw 4vh;
    border-top: none;
}
.footer-columns {
    display: grid;
    grid-template-columns: 1.4fr 150px repeat(5, 1fr);
    gap: 1.8rem;
    margin-bottom: 1rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
.footer-col-divider {
    background: none;
    width: 0;
    height: 100%;
    margin-left: 60px;
    border-left: 2px dotted var(--border);
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.footer-col-brand {
    gap: 1rem;
    display: flex;
    flex-direction: column;
}
.footer-col-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    color: var(--text-main);
    opacity: 0.8;
    margin-bottom: 0.4rem;
    text-align: left;
}
.footer-col-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
    width: fit-content;
}
.footer-col-link:hover {
    color: var(--text-main);
}
.footer-copyright {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: -0.4rem;
    margin-left: 0;
    padding-left: 0;
    text-align: left;
    width: 100%;
}
.footer-bottom-appearance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.footer-bottom-line {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1.5rem;
    }
    .footer-col-brand, .footer-col-divider {
        grid-column: 1 / -1;
    }
    .footer-col-divider {
        height: 1px;
        width: 100%;
        margin-left: 0;
    }
}
@media (max-width: 480px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 2rem;
    }
}
@media (max-width: 900px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1.5rem;
    }
    .footer-col-brand {
        grid-column: 1 / -1;
    }
}
@media (max-width: 480px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 2rem;
    }
}
        /* RESPONSIVE */
        @media (max-width: 768px) {
    nav {
        padding: 0.55rem 1.5rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: var(--bg);
    }
    nav.scrolled { padding: 0.4rem 1.5rem; }
    .nav-links { display: none; }
    .join-card { padding: 2rem 1.5rem; }
    .join-card h3 { font-size: 1.8rem; line-height: 1.25; margin-bottom: 0.8rem; }
    .join-card p { font-size: 1rem; margin-bottom: 1.8rem; }
    footer { flex-direction: column; gap: 1rem; text-align: center; }
                footer {
        padding-left: 5vw !important;
        padding-right: 5vw !important;
    }
    .hero { padding: 6rem 5vw 4rem; height: auto; min-height: 100vh; justify-content: flex-start; padding-top: 8rem; }
.hero h1 {
    font-size: clamp(2.2rem, 11vw, 4rem);
    line-height: 1.2;
}
.hero-trust-row {
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start;
    gap: 0;
    text-align: left;
    margin-top: -0.6rem;
}
.hero-trust-row span:last-child {
    margin-top: -1.2rem;
}
.hero-trust-row span {
    line-height: 0.6;
    margin: 0;
}
.hero-divider {
    margin-bottom: 0.5rem;
}
.logo span {
    font-size: 0.95rem;
    white-space: nowrap;
}
                .standard-section {
        --section-pad-x: 5vw;
        padding-left: 5vw !important;
        padding-right: 5vw !important;
    }
    #foundation-sticky {
        padding-left: 5vw !important;
        padding-right: 5vw !important;
    }
    .story-section {
        padding-left: 5vw !important;
        padding-right: 5vw !important;
    }
    #scroll-reveal-text {
        left: 5vw !important;
        right: 5vw !important;
        max-width: none !important;
    }
}
        /* HAMBURGER BUTTON */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text-main);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.hamburger.open span:nth-child(1) {
    transform: translateY(3.25px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    transform: translateY(-3.25px) rotate(-45deg);
}

/* MOBILE MENU OVERLAY */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 150;
    flex-direction: column;
    align-items: stretch;
    padding: 5.5rem 6vw 2rem;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    overflow-y: auto;
}
.mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
#mobile-menu-close {
    position: absolute;
    top: 1.3rem;
    right: 6vw;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.mobile-menu-list {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.mobile-accordion {
    border-bottom: 1px solid var(--border);
}
.mobile-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 400;
    display: flex;
    justify-content: space-between;
    justify-content: space-between !important;
    text-align: left !important;
    align-items: center;
    padding: 1.1rem 0;
    cursor: pointer;
}
.mobile-accordion-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}
.mobile-accordion.open .mobile-accordion-chevron {
    transform: rotate(180deg);
}
.mobile-accordion-panel {
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: max-height 0.35s ease;
}
.mobile-accordion.open .mobile-accordion-panel {
    max-height: 600px;
}
.mobile-nav-link {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.7rem 0 0.7rem 0.5rem;
    transition: color 0.2s ease;
}
.mobile-nav-link:hover {
    color: var(--text-main);
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
}
        /* TWINKLING STARS */
.stars-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.star {
    position: absolute;
    background: var(--text-main);
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    opacity: 0;
}
@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: var(--max-opacity); transform: scale(1.2); }
}

/* Make hero and about position relative */
.hero, #about {
    position: relative;
}
.hero > *:not(.stars-bg),
#about > *:not(.stars-bg) {
    position: relative;
    z-index: 1;
}

.sincerity-bg-mobile {
    display: none;
}
@media (max-width: 768px) {
    #knowledge-satellite-sticky > div {
        gap: 3vw !important;
    }
    #knowledge-satellite-sticky > div > div {
        min-width: 0 !important;
        flex: 1 1 0;
    }
    #knowledge-satellite-sticky {
        height: 68vh !important;
    }
    #knowledge-satellite-sticky > div > div > div {
        padding: 0.35rem 0 !important;
    }
    #knowledge-satellite-sticky p {
        margin-bottom: 0.4rem !important;
        font-size: 0.62rem !important;
        letter-spacing: 1px !important;
    }
    #knowledge-satellite-sticky .ks-word,
    #knowledge-satellite-sticky > div > div > div span {
        font-size: 0.8rem !important;
    }
        #knowledge-satellite-sticky > div > div:nth-child(2) * {
        text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.7);
    }
    .sincerity-section {
        height: auto;
        padding: 8rem 5vw 5rem;
    }
    .sincerity-bg-img {
        display: none;
    }
    .sincerity-bg-mobile {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('sincerity-bg-mobile.jpg.png');
        background-size: cover;
        background-position: center 50%;
        background-repeat: no-repeat;
    }
}
        /* LEGAL MODALS */
.legal-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(12px);
    z-index: 600;
    justify-content: center;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.legal-modal-overlay.open {
    opacity: 1;
}
.legal-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 780px;
    max-height: 88vh;
    margin-top: 6vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.legal-modal-overlay.open .legal-modal {
    transform: translateY(0) scale(1);
}
.legal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.legal-modal-header span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}
.legal-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    padding: 0.2rem 0.5rem;
}
.legal-modal-close:hover {
    color: var(--text-main);
}
.legal-modal-body {
    overflow-y: auto;
    padding: 2rem 1.8rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}
.legal-modal-body h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
}
.legal-modal-body .legal-meta {
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 0.5rem;
}
.legal-modal-body p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.75;
}
.legal-modal-body h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.2px;
}
.legal-modal-body ul {
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.legal-modal-body ul li {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}
/* FOOTER LEGAL LINKS */
.footer-legal {
    width: 100%;
    text-align: center;
    padding-top: 1.2rem;
    margin-top: 1.2rem;
    border-top: 1px solid #111;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.footer-legal a {
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    letter-spacing: 0.3px;
}
.footer-legal a:hover {
    color: var(--text-main);
}
/* THEME TOGGLE BUTTON */
#theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}
#theme-toggle:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    transform: scale(1.06);
}
#theme-toggle svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
        /* COMING SOON PAGE */
.coming-soon-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 500;
    overflow-y: auto;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    flex-direction: column;
}
.coming-soon-page.active { display: flex; }
.coming-soon-page.visible {
    opacity: 1;
    transform: translateX(0);
}
.coming-soon-page.slide-out {
    opacity: 0;
    transform: translateX(-40px);
}
        .reveal-word {
    color: #5d5d75;
    transition: color 0.1s ease;
    display: inline-block;
}
        @font-face {
    font-family: 'Tone';
    src: url('Tone.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Tone2';
    src: url('Tone2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
.hero-trust-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
}
.hero-trust-row span {
    font-family: 'Tone2', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.9;
    white-space: nowrap;
}
.i-tight {
    margin-left: -0.5px;
    margin-right: -0.5px;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    -webkit-text-stroke: 0.2px var(--text-muted);
    opacity: 0.9;
}
.logo-text {
    font-family: 'Tone', sans-serif !important;
    letter-spacing: 2px;
}
/* ITEM DETAIL PAGE */
.item-detail-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem 1.5rem;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}
.item-detail-body:has(.item-detail-embed-wrapper.ratio-9-16) {
    max-width: 1200px;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}
.item-detail-cover {
    width: 100%;
    max-width: 230px;
    aspect-ratio: 2 / 3;
    border-radius: 2px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 12px 32px var(--shadow-color),
                0 4px 10px var(--shadow-color);
    margin-bottom: 0.6rem;
}
.item-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.item-detail-title {
    font-size: clamp(1.2rem, 3.2vw, 1.5rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: -0.3rem;
}
.item-detail-author {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}
.item-detail-read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 2.2rem;
    border-radius: 999px;
    background: #2f88ff;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.25s ease;
    outline: none;
    border: none;                          /* new */
    -webkit-appearance: none;              /* new */
    appearance: none;                      /* new */
    -webkit-tap-highlight-color: transparent;
}
.item-detail-read-btn:hover {
    background: #2374e0;
}
.item-detail-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}
.item-detail-actions-row .book-icon-btn {
    width: 40px;
    height: 40px;
}
.item-detail-actions-row .book-icon-btn img {
    width: 17px;
    height: 17px;
}
.item-detail-embed-wrapper {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    margin: 0 0 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.item-detail-embed-wrapper.ratio-16-9,
.item-detail-embed-wrapper:not(.ratio-9-16):not(.ratio-folder) {
    aspect-ratio: 16 / 9;
}
.item-detail-embed-wrapper.drive-video-embed {
    aspect-ratio: 16 / 10.2;
    overflow: visible;
    background: #000;
    border-radius: 14px;
}
.item-detail-embed-wrapper.drive-video-embed iframe {
    border-radius: 14px;
}
@media (max-width: 480px) {
    .item-detail-embed-wrapper.drive-video-embed {
        aspect-ratio: 16 / 12;
    }
}
.item-detail-embed-wrapper.ratio-9-16 {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 90vh;
    margin-left: 0;
    margin-right: 0;
}
@media (min-width: 700px) {
    .item-detail-embed-wrapper.ratio-9-16 {
        max-width: min(70vw, 900px);
        max-height: 85vh;
    }
}
@media (min-width: 1200px) {
    .item-detail-embed-wrapper.ratio-9-16 {
        max-width: min(60vw, 1100px);
        max-height: 88vh;
    }
}
.item-detail-embed-wrapper.ratio-folder {
    width: 100%;
    max-width: 480px;
    aspect-ratio: auto;
    height: 60vh;
    max-height: 420px;
}
@media (min-width: 700px) {
    .item-detail-embed-wrapper.ratio-folder {
        max-width: 560px;
        max-height: 480px;
    }
}
.video-facade {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    margin: 1.25rem 0;
}
.video-facade-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #fff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.video-facade-play svg {
    width: 28px;
    height: 28px;
    margin-left: 3px;
}
.video-facade:hover .video-facade-play {
    background: rgba(0, 0, 0, 0.85);
    transform: translate(-50%, -50%) scale(1.08);
}
.item-detail-embed-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.item-detail-body:has(.quran-surah-grid) {
    max-width: 1400px;
    width: 100%;
}
.item-detail-body:has(.video-episodes-grid) {
    max-width: 1400px;
    width: 100%;
}
.quran-surah-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
    width: 100%;
    padding: 0;
}

.surah-cover-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
}

.surah-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.quran-surah-grid .book-info {
    text-align: left;
}
@media (max-width: 900px) {
    .quran-surah-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .quran-surah-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
    }
}
@media (max-width: 768px) {
    .kaabah-door-img {
        height: 72vh !important;
        max-width: 85% !important;
        opacity: 1 !important;
        top: auto !important;
        bottom: 0 !important;
        transform: none !important;
    }
}
@media (min-width: 769px) {
    .kaabah-door-img {
        right: 8vw !important;
    }
}
[data-theme="light"] .kaabah-door-img {
    display: none !important;
}
/* KNOWLEDGE SATELLITE SECTION */
.ks-word {
    color: #5d5d75;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.1s linear;
}
#knowledge-satellite-sticky p {
    color: #999;
}
#knowledge-satellite-sticky > div {
    font-size: 1rem;
}
.footer-about-wrap {
    width: 100%;
}
.footer-about-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
}
.footer-about-toggle:hover {
    color: var(--text-main);
}
.footer-about-chevron {
    display: inline-flex;
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}
.footer-about-chevron svg {
    width: 100%;
    height: 100%;
}
.footer-about-toggle.open .footer-about-chevron {
    transform: rotate(180deg);
}
.footer-about-content {
    max-height: 0;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s ease;
}
.footer-about-content.open {
    max-height: none;
}
.footer-about-inner {
    position: relative;
    padding: 0.8rem 0;
    text-align: left;
}
.footer-about-inner > *:not(.stars-bg) {
    position: relative;
    z-index: 1;
}
.featured-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
}
.featured-title-arrow {
    width: 22px;
    height: 22px;
    color: var(--text-main);
    opacity: 0.85;
    stroke-width: 3;
    transition: opacity 0.3s ease;
}
.featured-title-row:hover .featured-title-arrow {
    opacity: 1;
}
.featured-title-flex-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}
.featured-title-flex-row .featured-title-row {
    margin: 0;
}
.insights-goto-btn {
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #2f88ff;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}
.insights-goto-btn:hover {
    text-decoration: underline;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem 0.6rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
}
.nav-dropdown-toggle:hover {
    background: rgba(128,128,128,0.1);
}
.nav-dropdown-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}
.nav-dropdown:hover .nav-dropdown-chevron {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 200px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 250;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu a {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-menu a:hover {
    background: rgba(128,128,128,0.1);
    color: var(--text-main);
}
@media (max-width: 768px) {
    .nav-links { display: none; }
}
.nav-dropdown-toggle {
    opacity: 0.5;
}
.nav-dropdown-toggle:hover {
    opacity: 1;
}
.nav-dropdown-toggle {
    transition: background 0.2s ease, opacity 0.2s ease;
}
.stats-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 70px 70px;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: radial-gradient(ellipse 75% 90% at center, black 25%, transparent 95%);
    mask-image: radial-gradient(ellipse 75% 90% at center, black 25%, transparent 95%);
}

.stats-sweep-line {
    position: absolute;
    top: 50%;
    left: -30%;
    width: 30%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,60,60,0.55), transparent);
    animation: sweepAcross 4s ease-in-out infinite;
}
.stats-sweep-line:nth-child(2) {
    top: 35%;
    background: linear-gradient(to right, transparent, rgba(120,150,255,0.5), transparent);
    animation-delay: 0.4s;
}
.stats-sweep-line:nth-child(3) {
    top: 65%;
    background: linear-gradient(to right, transparent, rgba(180,255,220,0.5), transparent);
    animation-delay: 0.8s;
}
.stats-sweep-line:nth-child(4) {
    top: 80%;
    background: linear-gradient(to right, transparent, rgba(255,220,140,0.5), transparent);
    animation-delay: 1.2s;
}

@keyframes sweepAcross {
    0%   { left: -30%; }
    40%  { left: 110%; }
    100% { left: 110%; }
}

.stat-number {
    font-size: clamp(3.2rem, 7vw, 4.8rem);
    font-weight: 450;
    font-style: normal;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.6rem;
}
.stat-label {
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
    white-space: nowrap;
    max-width: none;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .stat-label {
        white-space: normal;
        font-size: 0.85rem;
    }
}
.stats-section {
    position: relative;
    overflow: hidden;
    padding: 7rem 1.5rem;
    text-align: center;
}
.stats-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-item {
    flex: 1 1 200px;
    min-width: 180px;
}
[data-theme="light"] .stats-grid-bg {
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px);
}
.stat-number {
    display: inline-flex;
    justify-content: center;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.digit-reel {
    position: relative;
    height: 1em;
    width: 0.62em;
    overflow: hidden;
    display: inline-block;
}

.digit-reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.digit-reel-strip span {
    height: 1em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.stat-symbol {
    display: inline-block;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
}

.nav-support-btn {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(128,128,128,0.4);
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    white-space: nowrap;
    transition: border-color 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    box-sizing: border-box;
}
.nav-support-btn:hover {
    border-color: rgba(128,128,128,0.8);
    background: rgba(128,128,128,0.08);
}

.nav-join-btn {
    background: var(--text-main);
    color: var(--bg);
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    box-sizing: border-box;
}
.nav-join-btn:hover {
    opacity: 0.85;
}

@media (max-width: 768px) {
    .nav-actions {
        display: none;
    }
}
.mobile-join-btn {
    display: none;
    background: var(--text-main);
    color: var(--bg);
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    margin-right: 0.6rem;
}
@media (max-width: 768px) {
    nav.scrolled .mobile-join-btn {
        display: inline-flex;
        align-items: center;
    }
}

.mobile-menu-join-btn {
    display: block;
    width: 100%;
    background: var(--text-main);
    color: var(--bg);
    border: none;
    border-radius: 999px;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: auto 0 1.5rem;
}
.mobile-nav-right {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.mobile-menu-logo {
    position: absolute;
    top: 1.5rem;
    left: 6vw;
}
.mobile-menu-logo .logo-mark {
    font-size: 0.95rem;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.idx-faq-divider {
    margin: 2.4rem 0 0;
    border-top: 1px solid var(--border);
}
.idx-faq-row {
    margin: 0;
    padding: 1.6rem 0 0.5rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.idx-faq-heading {
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}
.idx-faq-heading span {
    color: #9d9db8;
}
.idx-faq-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(128,128,128,0.4);
    border-radius: 999px;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.idx-faq-btn:hover {
    border-color: rgba(128,128,128,0.8);
    background: rgba(128,128,128,0.08);
}
@media (max-width: 700px) {
    .idx-faq-row {
        padding: 1.4rem 0 0.5rem;
    }
}
/* SERIES / EPISODE GRID — YouTube-style 16:9 layout */
.video-episodes-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem 1.2rem;
}
@media (min-width: 700px) {
    .video-episodes-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
    .video-episodes-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1400px) {
    .video-episodes-grid { grid-template-columns: repeat(3, 1fr); }
}
.video-episode-card .book-cover-wrapper {
    aspect-ratio: 16 / 9;
}
.video-episodes-grid .book-info {
    text-align: left;
}
.video-episodes-grid .book-author {
    height: 1.4em;
    line-height: 1.4;
}
#item-detail-back-btn {
    color: var(--text-main);
}
#item-detail-back-btn:hover {
    opacity: 0.8;
}

/* Related Items (Item Detail Page) */
.item-detail-related {
    padding: 0 5vw 3rem;
    max-width: 900px;
    margin: 0 auto;
}
.related-items-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}
.related-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}
.related-item-card {
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.related-item-card:hover {
    opacity: 0.75;
}
.related-item-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--border);
}
.related-item-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.related-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border);
    margin-bottom: 0.6rem;
}
.related-items-header .related-items-title {
    padding-top: 0;
    border-top: none;
    margin-bottom: 0;
}
.related-see-all-btn {
    background: none;
    border: none;
    color: #2f88ff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.related-see-all-btn:hover {
    text-decoration: underline;
}

/* Navbar Sign In / User Badge */
.nav-signin-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.25s ease;
}
.nav-signin-btn:hover {
    border-color: var(--text-muted);
}
.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-user-badge img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-user-badge span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-signout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: underline;
    cursor: pointer;
}
.nav-profile-badge {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent, #555);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-profile-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mobile-menu-profile-row {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    margin-top: auto;
}
#mobile-menu-profile-name {
    flex: 1;
    text-align: left;
}
.mobile-menu-profile-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}
.mobile-menu-profile-row {
    background: rgba(255,255,255,0.12);
}
[data-theme="light"] .mobile-menu-profile-row {
    background: rgba(0,0,0,0.06);
}
.mobile-menu-profile-row img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.mobile-menu-profile-row span#mobile-menu-profile-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent, #555);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}
.mobile-menu-profile-row span#mobile-menu-profile-name {
    font-size: 0.95rem;
    font-weight: 500;
}
.video-beta-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}
.video-beta-card {
    background: var(--bg-secondary, #1c1c1e);
    color: var(--text-main, #fff);
    border-radius: 14px;
    padding: 1.5rem;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.video-beta-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.video-beta-text {
    font-size: 0.9rem;
    color: var(--text-muted, #aaa);
    line-height: 1.4;
    margin-bottom: 1.2rem;
}
.video-beta-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
}
.video-beta-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}
.video-beta-btn-secondary {
    background: var(--bg-tertiary, #2c2c2e);
    color: var(--text-main, #fff);
}
.video-beta-btn-primary {
    background: #2f88ff;
    color: #fff;
}
/* ---- MOCK TESTS PAGE ---- */
#tests-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 1.5rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}
@media (min-width: 900px) {
    #tests-grid { padding: 2rem 3rem 5rem; }
}

.test-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem 1.4rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.25s ease, transform 0.25s ease;
    animation: bookFadeIn 0.4s ease both;
}
.test-card:hover {
    border-color: rgba(255,255,255,0.18);
}
[data-theme="light"] .test-card:hover {
    border-color: rgba(0,0,0,0.18);
}

.test-card-status {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
}
.test-status-live {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}
.test-status-upcoming {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}
.test-status-closed {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.test-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}
.test-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.test-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.test-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.test-card-btn {
    padding: 0.55rem 1.3rem;
    border-radius: 10px;
    border: none;
    background: #ffffff;
    color: #000000;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
[data-theme="light"] .test-card-btn {
    background: #111111;
    color: #ffffff;
}
.test-card-btn:hover {
    opacity: 0.85;
}
.test-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* ---- TEST ATTEMPT PAGE ---- */
.test-attempt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.test-attempt-timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}
.test-attempt-body {
    padding: 1.5rem 1.5rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}
.test-question-card {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}
.test-question-card:first-child {
    padding-top: 0.5rem;
}
.test-question-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.test-question-topic {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
}
.test-question-text {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 1.2rem;
}
.test-question-options {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.test-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.test-option:hover {
    border-color: rgba(255,255,255,0.25);
}
[data-theme="light"] .test-option:hover {
    border-color: rgba(0,0,0,0.25);
}
.test-option input[type="radio"] {
    accent-color: var(--text-main);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.test-option span {
    font-size: 0.95rem;
    color: var(--text-main);
}
/* ---- TEST ATTEMPT LAYOUT (PW STYLE) ---- */
.test-attempt-main {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 1.5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    align-items: flex-start;
}
.test-attempt-body {
    flex: 1;
    min-width: 0;
}
.test-attempt-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: none;
}
@media (min-width: 900px) {
    .test-attempt-sidebar { display: block; }
}

.test-sidebar-stats {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}
.test-sidebar-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-radius: 20px;
    background: var(--input-bg);
    border: 1px solid var(--border);
}
.test-sidebar-stat-answered .test-sidebar-stat-num {
    background: #3b82f6;
    color: #ffffff;
}
.test-sidebar-stat-unanswered .test-sidebar-stat-num {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.test-sidebar-stat-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.test-sidebar-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.test-palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}
.test-palette-btn {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.test-palette-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
}
.test-palette-btn.answered {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--text-main);
}
.test-palette-btn.answered .test-palette-dot {
    background: #3b82f6;
}
.test-palette-btn.current {
    border-color: #3b82f6;
    border-width: 2px;
    background: rgba(59, 130, 246, 0.08);
}

.test-attempt-footer {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0 1.5rem 0.5rem;
    max-width: 1100px;
    margin: -3rem auto 0;
    position: relative;
    z-index: 5;
}
.test-nav-btn {
    padding: 0.7rem 1.6rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.test-nav-btn:hover {
    border-color: rgba(255,255,255,0.3);
}
[data-theme="light"] .test-nav-btn:hover {
    border-color: rgba(0,0,0,0.3);
}
.test-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.test-tabs, .test-subtabs {
    display: flex;
    gap: 0.6rem;
    padding: 1rem 1.5rem 0;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}
@media (min-width: 900px) {
    .test-tabs, .test-subtabs { padding: 1rem 3rem 0; }
}
.test-tab {
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.test-tab.active {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
}
.test-subtab {
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.test-subtab.active {
    color: var(--text-main);
    border-bottom-color: #3b82f6;
    font-weight: 600;
}
.test-status-missed {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}
.test-submit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1.5rem;
}
.test-submit-modal {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.8rem 1.8rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
}
.test-submit-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}
.test-submit-close:hover {
    color: var(--text-main);
}
.test-submit-modal h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}
.test-submit-modal p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
}
.test-submit-stats {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    text-align: left;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.test-submit-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-main);
}
.test-submit-stat-row span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}
.test-submit-stat-row strong {
    font-size: 0.95rem;
    color: var(--text-main);
}
.test-submit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.test-submit-dot-answered { background: #3b82f6; }
.test-submit-dot-unanswered { background: var(--text-muted); }

.test-submit-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1.4rem;
    line-height: 1.4;
}
.test-submit-actions {
    display: flex;
    gap: 0.8rem;
}
.test-submit-resume-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.test-submit-resume-btn:hover {
    border-color: rgba(255,255,255,0.3);
}
[data-theme="light"] .test-submit-resume-btn:hover {
    border-color: rgba(0,0,0,0.3);
}
.test-submit-confirm-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 10px;
    border: none;
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.test-submit-confirm-btn:hover {
    opacity: 0.85;
}
.test-result-card {
    text-align: center;
    padding: 3rem 1.5rem;
}
.test-result-card h2 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}
.test-result-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-main);
}
.test-result-score span {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 500;
}
.test-result-percent {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0.3rem 0 0;
}
.test-result-breakdown {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}
.test-result-breakdown div {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.test-result-breakdown strong {
    font-size: 1.3rem;
    color: var(--text-main);
}
.test-result-breakdown span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
/* ---- TEST RESULT PAGE (PW STYLE) ---- */
.test-result-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(139,92,246,0.08));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.6rem;
    text-align: left;
}
.test-result-hero-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    color: var(--text-muted);
}
.test-result-hero-deco svg {
    position: absolute;
    width: 34px;
    height: 34px;
}
.test-result-hero-deco .deco-1 { top: 14px; right: 90px; }
.test-result-hero-deco .deco-2 { bottom: 18px; right: 30px; width: 44px; height: 44px; }
.test-result-hero-deco .deco-3 { top: 50%; right: 150px; width: 26px; height: 26px; }
.test-result-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
}
.test-result-hero-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    position: relative;
    z-index: 1;
}
.test-result-hero-actions {
    position: relative;
    z-index: 1;
}
.test-result-hero-actions .test-result-solutions-btn {
    width: auto;
    padding: 0.75rem 1.6rem;
}
.test-result-summary-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: left;
    margin: 0 0 0.9rem;
}
.test-result-scorecard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.8rem 1.5rem;
    margin-bottom: 1.8rem;
    text-align: left;
}
.test-result-scorecard-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: block;
    margin-bottom: 0.4rem;
}
.test-result-scorecard-icon svg {
    width: 46px;
    height: 46px;
}
.test-result-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-bottom: 2rem;
}
.test-result-pcard {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    text-align: left;
}
.test-result-pcard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.test-result-pcard-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
    font-weight: 500;
}
.test-result-pcard-value {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.test-result-pcard-stat {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.test-result-pcard-bignum {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}
.test-result-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.test-result-progress-fill {
    height: 100%;
    border-radius: 999px;
}
.test-result-progress-fill.correct { background: #2ecc71; }
.test-result-progress-fill.wrong { background: #e74c3c; }
.test-result-progress-fill.skipped { background: var(--text-muted); }
.test-result-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.test-result-dot.correct { background: #2ecc71; }
.test-result-dot.wrong { background: #e74c3c; }
.test-result-dot.skipped { background: var(--text-muted); }
@media (max-width: 640px) {
    .test-result-progress-grid { grid-template-columns: repeat(2, 1fr); }
    .test-result-hero-deco { display: none; }
}
.test-result-solutions-btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: 10px;
    border: none;
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.test-result-solutions-btn:hover {
    opacity: 0.85;
}
/* ---- TEST FEEDBACK POPUP ---- */
.test-feedback-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 600;
    overflow-y: auto;
    padding: 3rem 1.5rem;
}
.test-feedback-modal {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    text-align: center;
    margin: auto;
}
.test-feedback-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.test-feedback-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
}
.test-feedback-subtitle .highlight {
    color: #f5a623;
    font-weight: 600;
}
.test-feedback-stars {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.test-feedback-stars svg {
    width: 34px;
    height: 34px;
    fill: var(--border);
    cursor: pointer;
    transition: fill 0.15s ease, transform 0.15s ease;
}
.test-feedback-stars svg:hover {
    transform: scale(1.1);
}
.test-feedback-stars svg.filled {
    fill: #a89bfa;
}
.test-feedback-skip-link {
    display: inline-block;
    font-size: 0.88rem;
    color: #3b82f6;
    text-decoration: underline;
    margin-bottom: 0.5rem;
}
.test-feedback-expand {
    text-align: left;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
}
.test-feedback-section {
    text-align: left;
    margin-bottom: 1.2rem;
}
.test-feedback-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    text-align: left;
}
.test-feedback-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.test-feedback-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}
.test-feedback-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--text-main);
    cursor: pointer;
}
.test-feedback-textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem;
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    font-family: inherit;
}
.test-feedback-textarea::placeholder {
    color: var(--text-muted);
}
.test-feedback-submit-btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: 10px;
    border: none;
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.test-feedback-submit-btn:hover {
    opacity: 0.85;
}
/* ---- TEST SOLUTIONS PAGE (PW STYLE) ---- */
.solutions-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}
.solutions-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.solutions-tab.active {
    border-color: var(--text-main);
    color: var(--text-main);
}
.solutions-tab-count {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: var(--text-muted);
}
.solutions-tab-count-correct { background: #2ecc71; }
.solutions-tab-count-incorrect { background: #e74c3c; }
.solutions-tab-count-skipped { background: var(--text-muted); }
.solutions-tab-count-all { background: var(--text-main); color: var(--bg); }

.solutions-meta-row {
    display: flex;
    gap: 0.8rem;
    margin: 1rem 0 1.4rem;
    flex-wrap: wrap;
}
.solutions-meta-box {
    flex: 1;
    min-width: 140px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.solutions-meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.solutions-meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}
.solutions-meta-value.status-correct { color: #2ecc71; }
.solutions-meta-value.status-incorrect { color: #e74c3c; }
.solutions-meta-value.status-skipped { color: var(--text-muted); }

.test-palette-btn.sol-palette-correct {
    background: rgba(46, 204, 113, 0.15);
    border-color: #2ecc71;
    color: #2ecc71;
}
.test-palette-btn.sol-palette-incorrect {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    color: #e74c3c;
}
.test-palette-btn.sol-palette-skipped {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text-muted);
}

.sol-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: default;
}
.sol-option-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: inline-block;
}
.sol-option.sol-correct {
    background: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
}
.sol-option.sol-correct .sol-option-marker {
    background: #2ecc71;
    border-color: #2ecc71;
}
.sol-option.sol-wrong {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}
.sol-option.sol-wrong .sol-option-marker {
    background: #e74c3c;
    border-color: #e74c3c;
}
.feed-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 5px;
    z-index: 2;
    text-transform: uppercase;
}
.book-cover-wrapper {
    position: relative;
}
/* FOR YOU FEED — filter chips */
.feed-filter-chips {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 51px;
    z-index: 10;
    background: var(--bg);
}
.feed-filter-chips::-webkit-scrollbar { display: none; }
.feed-chip {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.feed-chip.active {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
}

/* FOR YOU FEED — colored badges */
.feed-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 3px 9px;
    border-radius: 999px;
    z-index: 2;
    text-transform: uppercase;
}
.feed-type-badge.badge-book { background: #d97706; }
.feed-type-badge.badge-article { background: #2563eb; }
.feed-type-badge.badge-video { background: #dc2626; }

/* FOR YOU FEED — hover zoom */
.feed-card .book-cover-wrapper {
    overflow: hidden;
}
.feed-card .book-cover-img {
    transition: transform 0.35s ease;
}
.feed-card:hover .book-cover-img {
    transform: scale(1.05);
}

/* FOR YOU FEED — minimal action row */
.feed-card .book-actions-row {
    gap: 0.6rem;
}

/* FOR YOU FEED — load more button */
.feed-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0 2.5rem;
    grid-column: 1 / -1;
}
.feed-load-more-btn {
    padding: 0.7rem 1.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.feed-load-more-btn:hover {
    background: rgba(128,128,128,0.1);
}
/* GLOBAL SMART SEARCH */
.books-grid-header .global-search-trigger-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.global-search-trigger-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.global-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.global-search-overlay.active {
    display: block;
}
.global-search-overlay.visible {
    opacity: 1;
}
.global-search-topbar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem 0.6rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.global-search-close-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(128,128,128,0.2);
    padding: 0;
    cursor: pointer;
}
.global-search-close-btn svg { width: 20px; height: 20px; }
.global-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    background-color: rgba(255,255,255,0.08);
}
[data-theme="light"] .global-search-input-wrap {
    background-color: rgba(0,0,0,0.06);
}
.global-search-input-wrap svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    flex-shrink: 0;
}
.global-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
}
.global-search-input::placeholder { color: var(--text-muted); }
.global-search-filter-chips {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem 0.2rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.global-search-filter-chips::-webkit-scrollbar { display: none; }
.global-search-empty-state {
    padding: 0 1.5rem 4rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: -1.5rem 0 0;
}
.global-search-trending-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin-bottom: 0.6rem;
}
.global-search-trending-list {
    display: flex;
    flex-direction: column;
}
.global-search-trending-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.95rem 0;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
}
.global-search-trending-item::after {
    content: "";
    position: absolute;
    left: 1.9rem;
    right: 0;
    bottom: 0;
    border-bottom: 1px solid var(--border);
}
.global-search-trending-item:last-child::after {
    display: none;
}
.global-search-trending-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

/* input icon — same size/color as before, just svg → img */
.global-search-input-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}
@media (min-width: 900px) {
    .global-search-topbar { padding: 1.2rem 3rem 0.6rem; }
    .global-search-filter-chips { padding: 1rem 3rem 0.2rem; }
}
