/* ==========================================================================
   app.css — APP-ONLY STYLES
   --------------------------------------------------------------------------
   This file contains styles used ONLY by the mobile app version
   (the Play Store app). It is loaded after style.css, so rules here
   override the website styles where they overlap.

   Rule: do NOT put website styles here. All shared/website styles stay
   in style.css.
   ========================================================================== */
/* ── APP BOTTOM NAV ── */
body { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

.app-tabbar {
    position: fixed;
    top: auto;
    left: 22px;
    right: 22px;
    bottom: max(calc(env(safe-area-inset-bottom, 0px) - 11px), 23px);
    width: auto;
    height: auto;
    min-height: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: none;
    clip-path: none;
    pointer-events: none;
}

.app-tabbar-pill,
.app-tab-search {
    pointer-events: auto;
    position: relative;
    background: rgba(24, 26, 30, 0.16);
    border: 0.5px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 10px 32px rgba(0, 0, 0, 0.25),
        inset 1.5px 1.5px 0.5px rgba(255, 255, 255, 0.42),
        inset -1.5px -1.5px 0.5px rgba(255, 255, 255, 0.22),
        inset 0 0 22px rgba(255, 255, 255, 0.08);
    color: #fff;
}
.app-tabbar-pill::before,
.app-tab-search::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
    -webkit-backdrop-filter: blur(4px) saturate(180%) brightness(1.08);
    backdrop-filter: blur(4px) saturate(180%) brightness(1.08);
}

.app-tabbar-pill::after,
.app-tab-search::after,
.gs-home-btn::after,
.gs-bar .global-search-input-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 2;
    pointer-events: none;
    padding: 1.5px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.65) 0%,
        rgba(255, 255, 255, 0.08) 28%,
        rgba(255, 255, 255, 0.02) 55%,
        rgba(255, 255, 255, 0.10) 78%,
        rgba(255, 255, 255, 0.45) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.app-tabbar-pill {
    display: flex;
    flex: 1;
    max-width: 360px;
    height: 62px;
    padding: 4px 13px;
    border-radius: 999px;
}

.app-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 5px 4px 4px;
    background: none;
    border: 0;
    border-radius: 999px;
    color: inherit;
    opacity: 0.95;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
    font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.app-tab.active {
    background: transparent;
    color: #2aa4ff;
    opacity: 1;
    font-weight: 600;
}

.app-tab-search {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.app-tab-search .tab-ico { position: relative; z-index: 1; }

.app-tab-lens {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 0;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    background: rgba(99, 99, 102, 0.55);
    border: 0;
    box-shadow: none;
    transform: translateX(0);
    transition:
        transform 0.45s cubic-bezier(0.32, 1.25, 0.4, 1),
        width 0.45s cubic-bezier(0.32, 1.25, 0.4, 1);
}
.app-tab-lens.no-anim { transition: none; }
.app-tab-lens.dragging { transition: none; transform-origin: center; will-change: transform; }
.app-tab-lens.pressed {
    background: rgba(255, 255, 255, 0.10);
    border: 0.5px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(1px) saturate(190%) brightness(1.15);
    backdrop-filter: blur(1px) saturate(190%) brightness(1.15);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        inset 0 -1px 1px rgba(255, 255, 255, 0.2),
        0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Light theme */
:root[data-theme="light"] .app-tabbar-pill,
:root[data-theme="light"] .app-tab-search {
    background: rgba(255, 255, 255, 0.72);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.12),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    color: #111;
}
:root[data-theme="light"] .app-tab-lens {
    background: rgba(120, 120, 128, 0.18);
    border: 0;
    box-shadow: none;
}

.app-tabbar-pill { touch-action: none; user-select: none; -webkit-user-select: none; }
.app-tab.drag-hover { color: #2aa4ff; opacity: 1; }

.tab-ico {
    width: 28px;
    height: 28px;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}
.app-tab .tab-ico { margin-bottom: 1px; }
.tab-ico-b { display: none; }

.app-tab.active .tab-ico-n,
.app-tab.drag-hover .tab-ico-n,
.app-tab-search:active .tab-ico-n { display: none; }
.app-tab.active .tab-ico-b,
.app-tab.drag-hover .tab-ico-b,
.app-tab-search:active .tab-ico-b { display: block; }

/* dark theme: black icon ko white dikhao */
.tab-ico-n { filter: invert(1) brightness(2); }
:root[data-theme="light"] .tab-ico-n { filter: none; }

.app-tabbar-pill:has(.app-tab.drag-hover) .app-tab.active:not(.drag-hover) .tab-ico-n { display: block; }
.app-tabbar-pill:has(.app-tab.drag-hover) .app-tab.active:not(.drag-hover) .tab-ico-b { display: none; }
.app-tabbar-pill:has(.app-tab.drag-hover) .app-tab.active:not(.drag-hover) { color: inherit; }


.app-tab-search.active .tab-ico-n { display: none; }
.app-tab-search.active .tab-ico-b { display: block; }

.hero-anim {
    opacity: 1 !important;
    transform: none !important;
}

/* Hide tab bar on test attempt / solutions pages (it covers Previous/Next buttons) */
body.tabbar-hidden .app-tabbar { display: none; }

/* ── HOME HEADER (Apple Books style) ── */
.home-title { display: none; }

#featured-collection { padding-top: 7rem; }

@media all {
    /* logo hata ke "Home" title */
     nav > .logo { display: none !important; }

    /* header page ke saath scroll hoga (fixed nahi), bilkul Apple Books jaisa */
    nav,
    nav.scrolled {
        position: absolute;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-bottom: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 0.1rem) 1rem 0.5rem 1.5rem;
    }

    .home-title {
        display: block;
        font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
        font-size: 2.2rem;
        font-weight: 700;
        letter-spacing: -0.01em;
        line-height: 1.1;
        color: var(--text-main);
    }

    /* Courses / Tests / Insights: Home jaisa title, back arrow nahi */
#courses-grid-header .library-back-btn,
#tests-grid-header .library-back-btn,
#insights-header .library-back-btn {
    display: none !important;
}

#courses-grid-header,
#tests-grid-header,
#insights-header {
    padding: calc(env(safe-area-inset-top, 0px) + 0.1rem) 1.5rem 0.5rem;
}

#courses-grid-header .books-grid-category-title,
#tests-grid-header .books-grid-category-title,
#insights-header .library-page-title {
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--text-main);
}

    /* profile photo thodi badi, Apple jaisi */
    .acct-trigger .acct-avatar { width: 42px; height: 42px; }

    nav > .mobile-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

    /* Featured Collection header ke neeche se shuru */
    #featured-collection {
        padding-top: calc(env(safe-area-inset-top, 0px) + 5rem);
    }
    #featured-collection .featured-bg {
    top: calc(env(safe-area-inset-top, 0px) + 4.3rem);           /* pehle 3rem, ab text ke saath move hoga */
}
}

/* ── BOOKMARKS PAGE (same look as website profile) ── */
.pf-bm-tabbar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.pf-bm-tabbar::-webkit-scrollbar { display: none; }
#acct-notif-tabbar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
#acct-notif-body { padding-left: 0; padding-right: 0; }
.pf-bm-tab {
    flex-shrink: 0;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pf-bm-tab.active {
    background: #2f88ff;
    border-color: #2f88ff;
    color: #fff;
}
.pf-bm-body { padding: 1.5rem 1.5rem 4rem; }
.pf-bm-empty { color: var(--text-muted); font-size: 0.9rem; }
.pf-bm-section { margin-bottom: 1.75rem; }
.pf-bm-section-label {
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    padding: 0 0.2rem 0.5rem;
}
.pf-bm-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.pf-bm-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.pf-bm-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.pf-bm-row:hover { background: rgba(127,127,127,0.07); }
.pf-bm-thumb {
    width: 42px; height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border);
}
.pf-bm-thumb-fallback {
    width: 42px; height: 42px;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--border);
    display: flex; align-items: center; justify-content: center;
}
.pf-bm-thumb-fallback img { width: 18px; height: 18px; opacity: 0.6; }
.pf-bm-thumb-fallback.pf-nt-ic { background: rgba(10, 132, 255, 0.14); color: #0a84ff; border-radius: 10px; }
.pf-bm-info { min-width: 0; flex: 1; }
.pf-bm-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pf-bm-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pf-bm-chevron { color: var(--text-muted); flex-shrink: 0; }
@media (min-width: 900px) {
    .pf-bm-tabbar, .pf-bm-body { padding-left: 3rem; padding-right: 3rem; }
}

/* ── HOME HERO (Apple TV style) ── */
.home-hero {
    position: relative;
    width: 100%;
    height: 78svh;
    min-height: 480px;
    max-height: 720px;
    overflow: hidden;
    background: var(--bg);
}
.home-hero-track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.home-hero-track::-webkit-scrollbar { display: none; }

.home-hero-slide {
    position: relative;
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.home-hero-img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center top;
    will-change: transform;
}
.home-hero-shade {
    position: absolute;
    inset: 0;
    --tint: 0, 0, 0;
    background: linear-gradient(
        to bottom,
        rgba(var(--tint), 0.35) 0%,
        rgba(var(--tint), 0) 20%,
        rgba(var(--tint), 0) 30%,
        rgba(var(--tint), 0.55) 45%,
        rgba(var(--tint), 0.85) 60%,
        rgba(var(--tint), 0.96) 78%,
        rgba(var(--tint), 1) 100%
    );
}
.home-hero-content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0 1.5rem 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
}
.home-hero-badge {
    padding: 1px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(0,0,0,0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
}
.home-hero-title {
    font-size: clamp(2rem, 9vw, 2.9rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 0.6rem;
    text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.home-hero-meta {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.92;
    margin-bottom: 1.1rem;
}
.home-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(76%, 300px);
}
.home-hero-cta {
    flex: 1;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: #f2f2f7;
    color: #000;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.home-hero-cta:active { opacity: 0.8; }
.home-hero-plus {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 0;
    background: rgba(60,60,67,0.7);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.home-hero-plus svg {
    position: absolute;
    top: 50%; left: 50%;
    width: 24px; height: 24px;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, transform 0.25s ease;
}
.home-hero-plus .hh-check { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
.home-hero-plus.active .hh-plus { opacity: 0; transform: translate(-50%, -50%) rotate(90deg) scale(0.5); }
.home-hero-plus.active .hh-check { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.home-hero-sub {
    margin-top: 0.7rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
}

/* bottom fade into page background */
.home-hero-fade {
    display: none;
}

/* pagination dots */
.home-hero-dots {
    position: absolute;
    left: 0; right: 0;
    bottom: 34px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.home-hero-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: width 0.35s cubic-bezier(0.32, 1.25, 0.4, 1), background 0.3s ease;
}
.home-hero-dot.active { width: 34px; background: #fff; }

/* App-only (mobile) layout tweaks */
@media all {
    body.has-hero .home-title,
    body.has-hero .acct-trigger {
        color: #fff;
        text-shadow: 0 1px 8px rgba(0,0,0,0.45);
    }
    body.has-hero #featured-collection {
        padding-top: 1.5rem;
    }
    body.has-hero #featured-collection .featured-bg {
        top: 1rem;
    }
}

/* ── Hero ke neeche ka gap hatao ── */
.home-hero-fade { display: none !important; }

body.has-hero .home-hero {
    margin-bottom: 0;
    background: transparent;
}

body.has-hero #featured-collection {
    padding-top: 0.6rem !important;
}
body.has-hero #featured-collection .featured-bg {
    top: 0 !important;
}

.home-hero-title.is-logo {
    margin: 0 0 0.8rem;
    text-shadow: none;
    line-height: 0;
}
.home-hero-title.is-logo img {
    display: block;
    width: auto;
    max-width: min(82vw, 340px);
    max-height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.45));
}
.home-hero-badge {
    margin-bottom: 0.35rem;
    padding: 3px 11px;
    font-size: 0.9rem;
}
.home-hero-title.is-logo {
    margin: 0 0 0.3rem;
    line-height: 0;
}
.home-hero-title.is-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(82vw, 340px);
    max-height: 120px;
    object-fit: contain;
}
.home-hero-meta {
    margin-bottom: 0.9rem;
    line-height: 1.2;
}
.home-hero-sub {
    margin-top: 0.55rem;
}

/* ── Signed-out account button: sirf icon (Apple Books style) ── */
@media all {
    .acct-trigger:not(.signed-in) {
        gap: 0;
        padding: 0;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .acct-trigger:not(.signed-in) .acct-avatar {
        width: 50px;
        height: 50px;
        background: transparent;
    }
    .acct-trigger:not(.signed-in) .acct-avatar .acct-person-icon {
        width: 100%;
        height: 100%;
        margin-top: 0;
    }
    .acct-trigger:not(.signed-in) .acct-trigger-label {
        display: none;
    }
}

/* Icon follows the same color as "Sign in" text */
.acct-trigger-svg { filter: invert(1) brightness(2); }                          /* dark theme: white */
:root[data-theme="light"] .acct-trigger-svg { filter: none; }                   /* light theme: black */
@media all {
    body.has-hero .acct-trigger-svg,
    :root[data-theme="light"] body.has-hero .acct-trigger-svg { filter: invert(1) brightness(2); } /* over hero image: white, same as text */
}

@media all {
    .home-title,
    #courses-grid-header .books-grid-category-title,
    #tests-grid-header .books-grid-category-title,
    #insights-header .library-page-title {
        font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif !important;
        font-size: 34px !important;
        font-weight: 700 !important;
        letter-spacing: 0.4px !important;
        line-height: 1.2 !important;
    }
}

#support-sheet { --acct-bg: var(--bg); }
.sheet-frame {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100% - 76px);
    border: 0;
    background: transparent;
}

#acct-profile-card::after {
    content: "";
    margin-left: auto;
    flex-shrink: 0;
    width: 9px;
    height: 15px;
    background: var(--acct-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 15'%3E%3Cpath d='M1.5 1.5l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 15'%3E%3Cpath d='M1.5 1.5l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.acct-panel {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: var(--acct-bg);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.4s;
}
.acct-panel.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
}
.acct-back { right: auto; left: 16px; }
.acct-row-value { color: var(--acct-muted); font-size: 1.05rem; }

.acct-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}
.acct-stat {
    padding: 16px 18px 18px;
    background: var(--acct-card);
    border-radius: 22px;
}
.acct-stat-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}
.acct-stat-head svg { width: 18px; height: 18px; flex-shrink: 0; }
.acct-tint-level { color: #ff9f0a; }
.acct-tint-xp { color: #0a84ff; }
.acct-stat-num {
    margin-top: 10px;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

/* ── SIGN-IN POPUP (Apple style centered card) ── */
#support-sheet.is-popup {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(88vw, 340px);
    height: 340px;
    margin: 0;
    border-radius: 28px;
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, visibility 0s linear 0.35s;
}
#support-sheet.is-popup.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, visibility 0s;
}
#support-sheet.is-popup .acct-header { display: none; }
#support-sheet.is-popup .sheet-frame {
       top: 0;
    height: 100%;
}


.popup-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}
#support-sheet.is-popup .popup-close { display: flex; }

#support-sheet.is-popup {
    z-index: 9700;
    background: rgba(40, 42, 48, 0.55);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1.5px 0 rgba(255,255,255,0.35);
}
:root[data-theme="light"] #support-sheet.is-popup {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

.acct-role-badge {
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0a84ff;
    background: rgba(10, 132, 255, 0.14);
}
.acct-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.acct-name-row .acct-role-badge {
    margin-top: 0;
    align-self: center;
    flex-shrink: 0;
}

/* ── LEARNING GOAL RING (Apple Books style) ── */
.lg-ring { display: none; }
@media all {
    .lg-ring {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #1c1c1e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    :root[data-theme="light"] .lg-ring { background: #fff; }
    .lg-ring svg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        transform: rotate(135deg);
    }
    .lg-ring-track,
    .lg-ring-fill {
        fill: none;
        stroke-width: 4.4;
        stroke-linecap: round;
    }
    .lg-ring-track { stroke-dasharray: 84.8 113.1; }
    .lg-ring-track { stroke: rgba(255, 255, 255, 0.16); }
    :root[data-theme="light"] .lg-ring-track { stroke: #dff1fa; }
    .lg-ring-fill {
        stroke: #2fe0f5;
        stroke-linecap: round;
        stroke-dasharray: 84.8 113.1;
        stroke-dashoffset: 84.8;
        transition: stroke-dashoffset 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    }
    .lg-ring-text {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 1;
    }
    .lg-ring-text b {
        font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
        font-size: 17px;
        font-weight: 800;
        color: #1aaee8;
        -webkit-text-stroke: 0.4px #1aaee8;
        margin-top: -1px;
    }
    .lg-ring-text i {
        position: absolute;
        bottom: -11px;
        font-style: normal;
        font-size: 9px;
        font-weight: 700;
        color: var(--text-main);
    }
}

/* ── LEARNING GOALS SECTION (Home, Apple Books style) ── */
.lg-section {
    margin: 1.5rem 1.5rem 0;
    padding: 2.2rem 0 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.lg-sec-title {
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
}
.lg-sec-sub {
    margin: 0.4rem auto 0;
    max-width: 320px;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-muted);
}
.lg-arc-wrap {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 1.6rem auto 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lg-arc { display: block; width: 100%; height: auto; }
.lg-arc-track,
.lg-arc-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}
.lg-arc-track { stroke: rgba(255, 255, 255, 0.1); }
:root[data-theme="light"] .lg-arc-track { stroke: #f1f1f6; }
.lg-arc-fill {
    stroke: #0a9bdc;
    stroke-dasharray: 424.1;
    stroke-dashoffset: 424.1;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
.lg-arc-center {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lg-arc-label {
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}
.lg-arc-time {
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 4.2rem;
    font-weight: 400;
    line-height: 1.05;
    color: var(--text-main);
}
#lg-pg-time { font-size: 4.9rem; }
.lg-arc-goal {
    font-size: 0.95rem;
    color: var(--text-main);
}
.lg-continue {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 360px;
    margin: 1.4rem auto 0;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--text-main);
    color: var(--bg);
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lg-continue b { font-size: 1.05rem; font-weight: 600; }
.lg-continue span {
    max-width: 100%;
    font-size: 0.82rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lg-continue span:empty { display: none; }

.lg-continue { background: #2c2c2e; color: #fff; }
:root[data-theme="light"] .lg-continue { background: #111; color: #fff; }
.lg-chev {
    width: 8px;
    height: 13px;
    margin-left: 6px;
    vertical-align: -1px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── LEARNING PAGE (full screen) ── */
.lg-page {
    position: fixed;
    inset: 0;
    z-index: 9800;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text-main);
    opacity: 0;
    visibility: hidden;
    transform: translateY(28px);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.4s;
}
.lg-page.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
}
.lg-page-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    right: 16px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #2c2c2e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
:root[data-theme="light"] .lg-page-close { background: #fff; color: #000; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
.lg-page-close svg { width: 18px; height: 18px; }
.lg-page-body {
    flex: 1;
    overflow-y: auto;
    padding: calc(env(safe-area-inset-top, 0px) + 110px) 1.5rem 1rem;
    text-align: center;
}
.lg-pg-line { height: 1px; background: var(--border); margin: 1.6rem 0 1.4rem; }
.lg-pg-title {
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
}
.lg-pg-togo {
    margin-top: 0.2rem;
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 1.5rem;
    color: #0a9bdc;
}
.lg-pg-msg {
    margin: 0.7rem auto 0;
    max-width: 260px;
    font-size: 1.05rem;
    line-height: 1.4;
}
.lg-page-actions {
    padding: 0 1.5rem calc(env(safe-area-inset-bottom, 0px) + 28px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
}
.lg-share {
    width: 194px;
    height: 51px;
    border: 0;
    border-radius: 999px;
    background: #2c2c2e;
    color: #fff;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}
:root[data-theme="light"] .lg-share { background: #000; }
.lg-adjust {
    border: 0;
    background: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.lg-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lg-page.picker-open .lg-picker-backdrop { opacity: 1; pointer-events: auto; }
.lg-picker {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1c1c1e;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
:root[data-theme="light"] .lg-picker { background: #f9f9f9; }
.lg-page.picker-open .lg-picker { transform: none; }
.lg-picker-head {
    position: relative;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}
.lg-picker-head span {
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
}
.lg-picker-head button {
    position: absolute;
    right: 16px;
    border: 0;
    background: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}
.lg-wheel-wrap {
    position: relative;
    height: 220px;
    margin-bottom: env(safe-area-inset-bottom, 0px);
}
.lg-wheel-band {
    position: absolute;
    top: 88px;
    left: 12px;
    right: 12px;
    height: 44px;
    border-radius: 12px;
    background: rgba(128, 128, 128, 0.16);
    pointer-events: none;
}
.lg-wheel {
    position: relative;
    height: 220px;
    padding: 88px 0;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    text-align: center;
}
.lg-wheel::-webkit-scrollbar { display: none; }
.lg-wheel {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.lg-wheel div { font-size: 1.6rem; }
.lg-wheel-band { border-radius: 14px; background: rgba(128, 128, 128, 0.2); }
.lg-wheel div {
    height: 44px;
    line-height: 44px;
    font-size: 1.5rem;
    scroll-snap-align: center;
    color: var(--text-main);
}
.lg-wheel-unit {
    position: absolute;
    top: 88px;
    left: calc(50% + 40px);
    line-height: 44px;
    font-size: 1.05rem;
    font-weight: 600;
    pointer-events: none;
}

/* Account Info: Learning Goals card */
.acct-lg-slot .lg-section {
    margin: 12px 0 0;
    padding: 1.6rem 1rem 1.2rem;
    border-top: 0;
    background: var(--acct-card);
    border-radius: 22px;
}
.acct-lg-slot .lg-continue { background: #fff; color: #000; }
:root[data-theme="light"] .acct-lg-slot .lg-continue { background: #111; color: #fff; }

.acct-sheet .acct-label{
  font-family:-apple-system,"SF Pro Display",BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
  font-size:17px;
  font-weight:600;
  letter-spacing:0;
  text-transform:none;
  line-height:1.2;
  color:rgba(235,235,245,0.68);
  padding:0 4px;
  margin:26px 0 10px 12px;
}
:root[data-theme="light"] .acct-sheet .acct-label{color:rgba(60,60,67,0.6);}
#acct-info-panel .acct-lg-slot .lg-section{margin:0;}
#acct-about-version::after,
#acct-about-version::before { display: none !important; }

/* ── NOTIFICATION SETTINGS ── */
#ns-clear-btn .acct-row-text { color: #ff3b30; }
#acct-auth-btn.is-signout .acct-row-text { color: #ff3b30; }
#acct-auth-btn:not(.is-signout) .acct-row-text { color: #0a84ff; }
.ns-value { color: var(--acct-muted); font-size: 1.05rem; flex-shrink: 0; }
.acct-row[data-slot]::after,
#acct-appearance-btn::after {
    width: 10px;
    height: 17px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 17'%3E%3Cpath d='M1.5 6.5L5 3l3.5 3.5M1.5 10.5L5 14l3.5-3.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 17'%3E%3Cpath d='M1.5 6.5L5 3l3.5 3.5M1.5 10.5L5 14l3.5-3.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.acct-row:has(.ns-switch)::after { display: none; }
.ns-switch {
    position: relative;
    flex-shrink: 0;
    width: 51px;
    height: 31px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(120, 120, 128, 0.32);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease;
}
.ns-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.ns-switch[aria-checked="true"] { background: #34c759; }
.ns-switch[aria-checked="true"]::before { transform: translateX(20px); }

/* ── NOTIFICATION TIME PICKER (Apple Edit Alarm style) ── */
.ns-tp-backdrop {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.ns-tp-backdrop.open { opacity: 1; pointer-events: auto; }
.ns-tp {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    background: var(--acct-bg);
    border-radius: 38px 38px 0 0;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.4s;
}
.ns-tp.open {
    transform: none;
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
}
.ns-tp-head {
    position: relative;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ns-tp-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--acct-text);
}
.ns-tp-btn { top: 16px; }
#ns-tp-cancel { left: 16px; right: auto; }
#ns-tp-done { right: 16px; left: auto; }
.ns-tp-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 28px;
    height: 220px;
    margin: 8px 16px 0;
}
.ns-tp-band {
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    height: 44px;
    border-radius: 14px;
    background: rgba(128, 128, 128, 0.2);
    pointer-events: none;
}
.ns-wheel {
    position: relative;
    width: 70px;
    height: 220px;
    padding: 88px 0;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    text-align: center;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.ns-wheel::-webkit-scrollbar { display: none; }
.ns-wheel div {
    height: 44px;
    line-height: 44px;
    font-size: 1.6rem;
    scroll-snap-align: center;
    color: var(--acct-text);
}

/* ── APPEARANCE POPUP (System / Light / Dark) ── */
.ap-menu {
    position: absolute;
    z-index: 7;
    min-width: 200px;
    padding: 6px;
    border-radius: 26px;
    background: rgba(34, 36, 40, 0.82);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.86);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.32s cubic-bezier(0.32, 1.25, 0.4, 1), visibility 0s linear 0.32s;
}
.ap-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity 0.18s ease, transform 0.32s cubic-bezier(0.32, 1.25, 0.4, 1), visibility 0s;
}
:root[data-theme="light"] .ap-menu {
    background: rgba(246, 246, 248, 0.85);
    border-color: rgba(0, 0, 0, 0.06);
}
.ap-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: none;
    border: 0;
    border-radius: 18px;
    color: var(--acct-text);
    font-family: inherit;
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
}
.ap-item:active { background: var(--acct-press); }
.ap-check {
    width: 18px;
    flex-shrink: 0;
    font-size: 1.05rem;
    font-weight: 600;
    visibility: hidden;
}
.ap-item.selected .ap-check { visibility: visible; }

/* ── HEADER MENUS (Courses / Tests / Insights) ── */
.hm-btn { display: none; }
@media all {
    .hm-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        height: 44px;
        min-width: 44px;
        margin: -2px 0;
        padding: 0;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(44, 44, 46, 0.55);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 16px rgba(0, 0, 0, 0.25);
        color: var(--text-main);
        font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
        font-size: 17px;
        font-weight: 400;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: opacity 0.2s ease;
    }
    .hm-btn:active { opacity: 0.7; }
    .hm-btn svg { width: 22px; height: 22px; }
    .hm-pill { padding: 0 20px; }
    :root[data-theme="light"] .hm-btn {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 #fff;
    }
    #insights-header { display: flex; align-items: flex-start; justify-content: space-between; }
    #insights-header .hm-btn { margin-top: 0.1rem; }
}

.hm-popup { min-width: 250px; max-height: min(72vh, 560px); overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.hm-popup::-webkit-scrollbar { display: none; }
.hm-popup .cm-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.hm-popup .cm-item svg.hm-chk { width: 18px; height: 18px; margin-right: -4px; visibility: hidden; }
.hm-popup .cm-item.selected svg.hm-chk { visibility: visible; }
.hm-label { padding: 10px 14px 4px; font-size: 0.95rem; color: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .hm-label { color: rgba(60, 60, 67, 0.6); }
.courses-more-coming-note { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); margin-bottom: 120px; }

/* ── INSIGHTS FOOTER ── */
#insights-list .collection-item:last-child::after { display: none; }
.insights-footer { display: none; }
@media all {
    .insights-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        margin: 2.5rem 1.5rem calc(130px + env(safe-area-inset-bottom, 0px));
        padding-top: 1.4rem;
        border-top: 1px solid var(--border);
    }
    .insights-footer img { width: 68px; height: 68px; object-fit: contain; }
    .insights-footer span { font-size: 0.8rem; color: #8e8e93; margin: 0.1rem 0 -0.35rem; }
    .insights-footer b {
        font-family: 'Tone2', sans-serif;
        font-size: 0.66rem;
        font-weight: 400;
        letter-spacing: 2px;
        white-space: nowrap;
        color: #1c1c1e;
        -webkit-text-stroke: 0;
    }
.insights-footer .i-tight {
    display: inline-block;
    width: 1px;
    height: 0.6em;
    margin: 0 1px;
    background: #6b6b6b;
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0;
    overflow: hidden;
    vertical-align: baseline;
}
:root:not([data-theme="light"]) .insights-footer b { color: #f2f2f7; }
:root[data-theme="light"] .insights-footer b { color: #1c1c1e; }
:root:not([data-theme="light"]) .insights-footer .i-tight { background: #f2f2f7; }
:root[data-theme="light"] .insights-footer .i-tight { background: #1c1c1e; }
.insights-footer { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#acct-about-panel .insights-footer { border-top: 1px solid rgba(128, 128, 128, 0.35); }
}

/* ── UNIVERSAL SEARCH (Apple Books style) ── */
.global-search-overlay { z-index: 9100; overflow: hidden; }
.gs-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: calc(env(safe-area-inset-top, 0px) + 0.6rem) 1.5rem calc(150px + env(safe-area-inset-bottom, 0px));
}
.gs-title {
    font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.2;
    color: var(--text-main);
    margin: 0.4rem 0 1.2rem;
}
.gs-sec {
    font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 1.4rem 0 0.4rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border);
}
.global-search-empty-state { padding: 0; margin: 0; }
.global-search-trending-title { font-size: 1.6rem; }
.global-search-trending-item { font-size: 1.15rem; padding: 1.05rem 0; }
.global-search-trending-item::after { left: 2.4rem; }
#gs-suggestions .global-search-trending-item { font-size: 1.15rem; }
#gs-suggestions .global-search-trending-item b { font-weight: 400; color: var(--text-main); }
#gs-suggestions .global-search-trending-item span { color: var(--text-muted); }
.gs-scroll .atv-list-rows { padding: 0; }

/* chips (shown only after a search is entered) */
.gs-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -1.5rem 0.6rem;
    padding: 0.2rem 1.5rem 0.4rem;
}
.gs-chips::-webkit-scrollbar { display: none; }
.gs-chip {
    flex-shrink: 0;
    padding: 0.5rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}
.gs-chip.active { background: var(--text-main); color: var(--bg); }

/* bottom bar: Home button + search field */
.gs-bar {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: max(calc(env(safe-area-inset-bottom, 0px) - 11px), 23px);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: bottom 0.25s ease;
}
.gs-home-btn,
.gs-bar .global-search-input-wrap {
    position: relative;
    height: 68px;
    background: rgba(24, 26, 30, 0.16);
    border: 0.5px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 10px 32px rgba(0, 0, 0, 0.25),
        inset 1.5px 1.5px 0.5px rgba(255, 255, 255, 0.42),
        inset -1.5px -1.5px 0.5px rgba(255, 255, 255, 0.22),
        inset 0 0 22px rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(4px) saturate(180%) brightness(1.08);
    backdrop-filter: blur(4px) saturate(180%) brightness(1.08);
    color: var(--text-main);
}
:root[data-theme="light"] .gs-home-btn,
:root[data-theme="light"] .gs-bar .global-search-input-wrap {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}
.gs-home-btn {
    width: 68px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.gs-home-btn svg { width: 30px; height: 30px; }
.gs-bar .global-search-input-wrap {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    padding: 0 1.2rem;
    gap: 0.7rem;
}
.gs-bar .global-search-input { font-size: 1.15rem; min-width: 0; width: 100%; text-overflow: ellipsis; }
.gs-clear-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    padding: 5px;
    border: 0;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.45);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.gs-clear-btn svg { width: 100%; height: 100%; }
.gs-bar.is-typing { bottom: 12px; }
body.search-open .app-tabbar { display: none; }

.gs-bar { align-items: center; }
.gs-bar .global-search-input-wrap {
    height: 52px;
    padding: 0 1rem;
    gap: 0.6rem;
}
.gs-bar .global-search-input { font-size: 1.05rem; }
.gs-home-btn { width: 52px; height: 52px; }
.gs-home-btn svg { width: 26px; height: 26px; }

/* ── SCHOLARS RAIL ── */
.sc-home { position: relative; z-index: 2; padding: 0 0 40px; margin-top: -3.6rem; }
#home-scholars .featured-bg { top: 0; }
#home-scholars { padding-top: max(0px, calc(8vh - 3rem)); margin-top: calc(-0.6rem - 8vh); }
.sc-rail { margin: 0 0 8px; }
.sc-head { display: flex; align-items: center; gap: 0.4rem; padding: 0 1.5rem; color: var(--text-main); }
.sc-head h3 { margin: 0; font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; }
.sc-sub { margin: 4px 1.5rem 12px; font-size: .95rem; line-height: 1.35; color: var(--text-muted); }
.sc-scroll {
    display: flex; gap: 12px; padding: 0 1.5rem; scroll-padding-left: 1.5rem;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.sc-scroll::-webkit-scrollbar { display: none; }
.sc-card {
    position: relative; flex: 0 0 calc(100% - 1.2rem); aspect-ratio: 9 / 3.5;
    min-height: 142px; border-radius: 20px; overflow: hidden; padding: 0;
    border: none; background: #111; cursor: pointer; text-align: left;
    scroll-snap-align: start; -webkit-tap-highlight-color: transparent;
}
.sc-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.sc-card::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 75%);
}
.sc-card-text { position: absolute; z-index: 1; left: 16px; top: 14px; width: 52%; color: #fff; }
.sc-card-name { font-size: 1.05rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.sc-card-line {
    margin-top: 4px; font-size: .74rem; line-height: 1.3; color: rgba(255,255,255,.72);
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}

@media (min-width: 769px) {
    .sc-card { aspect-ratio: 16 / 5; }
    .sc-card-name { font-size: 1.7rem; }
    .sc-card-line { margin-top: 8px; font-size: 1.05rem; line-height: 1.4; color: rgba(255,255,255,.85); }
}

.sc-card-go {
    position: absolute; z-index: 2; right: 8px; bottom: 8px;
    width: 26px; height: 17px; border-radius: 999px;
    background: rgba(255,255,255,.92);
    display: flex; align-items: center; justify-content: center;
}
.sc-card-go svg {
    width: 7px; height: 11px; fill: none; stroke: #1c1c1e;
    stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}


/* ── SCHOLARS LIST PAGE + SCHOLAR PROFILE PAGE ── */
.sp-round {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 44, 46, 0.7);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sp-round svg { width: 22px; height: 22px; }
.sp-round:active { opacity: 0.7; }
:root[data-theme="light"] .sp-round {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* list page */
#scholars-page, #scholar-profile-page { background: var(--bg); overflow-y: auto; }
.sc-list-head { padding: calc(env(safe-area-inset-top, 0px) + 14px) 1.5rem 0; }
.sc-list-title {
    margin: 18px 0 14px;
    font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.2;
    color: var(--text-main);
}
.sc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 1.5rem calc(150px + env(safe-area-inset-bottom, 0px));
}
.sc-row {
    position: relative;
    width: 100%;
    min-height: 150px;
    padding: 0;
    border: 0;
    border-radius: 22px;
    overflow: hidden;
    background: #111;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sc-row:active { opacity: 0.85; }
.sc-row img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.sc-row::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,0) 78%);
}
.sc-row-text { position: absolute; z-index: 1; left: 18px; top: 16px; width: 54%; color: #fff; }
.sc-row-name { font-size: 1.15rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.sc-row-line {
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 769px) {
    .sc-row { aspect-ratio: 16 / 5; }
    .sc-row-name { font-size: 1.7rem; }
    .sc-row-line { margin-top: 8px; font-size: 1.05rem; line-height: 1.4; color: rgba(255, 255, 255, 0.85); }
}

/* profile page */
.sp-hero { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #1c1c1e; overflow: hidden; }
.sp-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-hero-back { position: absolute; left: 16px; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 2; }
.sp-hero-share { position: absolute; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 2; }
.sp-body { padding: 0 1.5rem calc(150px + env(safe-area-inset-bottom, 0px)); }
.sp-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.sp-name {
    margin: 0;
    font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.15;
    color: var(--text-main);
}
.sp-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #0a84ff;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sp-pill svg { width: 20px; height: 20px; }
.sp-pill:active { opacity: 0.8; }
.sp-bio-wrap { position: relative; margin-top: 14px; }
.sp-bio {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-more {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 0 0 0 36px;
    border: 0;
    background: linear-gradient(90deg, transparent 0, var(--bg) 40%);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
}
.sp-sec-row { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }
.sp-sec-title { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--text-main); }
.sp-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: 0;
    background: none;
    color: #0a84ff;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 500;
    cursor: pointer;
}
.sp-sort svg { width: 22px; height: 22px; }
.sp-res-list { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.sp-res {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sp-res-thumb { flex: 0 0 42%; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: var(--card-bg); }
.sp-res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-res-thumb.is-book { flex: 0 0 26%; aspect-ratio: 2 / 3; border-radius: 8px; margin: 0 8% 0 8%; }
.sp-res-text { flex: 1; min-width: 0; }
.sp-res-title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; color: var(--text-main); }
.sp-res-sub { margin-top: 4px; font-size: 0.9rem; line-height: 1.35; color: var(--text-muted); }
.sp-res-chev { width: 9px; height: 15px; flex-shrink: 0; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-coming { padding: 2.5rem 0; text-align: center; font-size: 1.05rem; color: var(--text-muted); }

@media (min-width: 769px) {
    .sp-hero { aspect-ratio: 16 / 5; }
    .sp-res { align-items: flex-start; }
    .sp-res-thumb { flex: 0 0 240px; aspect-ratio: 16 / 9; }
    .sp-res-thumb.is-book { flex: 0 0 120px; aspect-ratio: 2 / 3; margin: 0 60px; }
}


/* ── SCHOLAR SHEETS (bio, filter, sort) ── */
.sp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9290;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sp-backdrop.open { opacity: 1; pointer-events: auto; }
.sp-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: calc(env(safe-area-inset-top, 0px) + 44px);
    z-index: 9300;
    display: flex;
    flex-direction: column;
    background: #1c1c1e;
    color: #fff;
    border-radius: 38px 38px 0 0;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.4s;
}
:root[data-theme="light"] .sp-sheet { background: #f2f2f7; color: #000; }
.sp-sheet.open {
    transform: none;
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
}
.sp-sheet-head {
    position: relative;
    flex-shrink: 0;
    min-height: 88px;
    padding: 28px 16px 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.sp-sheet-head .sp-round { background: rgba(120, 120, 128, 0.28); color: inherit; box-shadow: none; }
.sp-sheet-head .sp-tick { background: #0a84ff; color: #fff; }
.sp-sheet-title {
    position: absolute;
    left: 70px;
    right: 70px;
    top: 28px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
}
.sp-sheet-sub { margin-top: 2px; font-size: 0.95rem; font-weight: 400; opacity: 0.6; }
.sp-sheet-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 1.5rem calc(40px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
}
#sp-bio-full { font-size: 1.05rem; line-height: 1.55; color: rgba(235, 235, 245, 0.68); }
:root[data-theme="light"] #sp-bio-full { color: rgba(60, 60, 67, 0.78); }
#sp-bio-full p { margin: 0 0 1rem; }
#sp-bio-full h3 { margin: 1.4rem 0 0.4rem; font-size: 1.1rem; font-weight: 700; color: #fff; }
:root[data-theme="light"] #sp-bio-full h3 { color: #000; }
#sp-bio-full ul { margin: 0 0 1rem; padding-left: 1.2rem; }
#sp-bio-full li { margin-bottom: 0.35rem; }
#sp-bio-full img { display: block; width: 100%; border-radius: 16px; margin: 1rem 0; }

/* filter sheet */
.sp-filter-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.sp-filter-row h2 { margin: 0; font-size: 1.8rem; font-weight: 700; }
.sp-filter-row button {
    border: 0;
    background: none;
    color: #0a84ff;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 500;
    cursor: pointer;
}
.sp-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp-chip {
    height: 62px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(120, 120, 128, 0.24);
    color: inherit;
    opacity: 0.55;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}
.sp-chip.on { background: #0a84ff; color: #fff; opacity: 1; }

/* sort popup */
.sp-menu {
    position: fixed;
    z-index: 9310;
    min-width: 220px;
    padding: 6px;
    border-radius: 26px;
    background: rgba(34, 36, 40, 0.86);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.86);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.32s cubic-bezier(0.32, 1.25, 0.4, 1), visibility 0s linear 0.32s;
}
.sp-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity 0.18s ease, transform 0.32s cubic-bezier(0.32, 1.25, 0.4, 1), visibility 0s;
}
:root[data-theme="light"] .sp-menu { background: rgba(246, 246, 248, 0.9); border-color: rgba(0, 0, 0, 0.06); }
.sp-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 0;
    border-radius: 18px;
    background: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
}
:root[data-theme="light"] .sp-menu-item { color: #000; }
.sp-menu-item:active { background: rgba(128, 128, 128, 0.2); }
.sp-check { width: 18px; flex-shrink: 0; font-size: 1.05rem; font-weight: 600; visibility: hidden; }
.sp-menu-item.selected .sp-check { visibility: visible; }

/* SCHOLAR BIO PHOTOS */
#sp-bio-full .bio-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    margin: 14px 0 18px;
}

#insights-list { padding-bottom: 0; }

/* ── PUSH POPUP (notification tap) ── */
.video-beta-card.push-popup-card {
    display: flex;
    flex-direction: column;
    max-width: 340px;
    max-height: 70vh;
    padding: 1.4rem 1.2rem 1.1rem;
    text-align: left;
}
.push-popup-title {
    flex: none;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.7rem;
}
.push-popup-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.push-popup-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-muted, #aaa);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0 0 0.9rem;
}
.push-popup-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0 0 0.9rem;
    background: var(--border);
}
.push-popup-actions {
    flex: none;
    margin-top: 0.4rem;
}

/* ── MORE FROM THE SALAFIYAHH (logo rows) ── */
.mf-row {
    min-height: 72px;
    padding-top: 10px;
    padding-bottom: 10px;
}
.mf-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 11px;
    object-fit: cover;
    background: #fff;
}
.mf-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mf-title {
    font-size: 1.05rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mf-sub {
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--acct-muted);
}
.acct-row.mf-row + .acct-row.mf-row::before { left: 78px; }

/* ── ROLE PICKER (Account Info) ── */
.acct-role-badge.is-empty {
    color: var(--acct-muted);
    background: rgba(127, 127, 127, 0.18);
}
.video-beta-card.role-pick-card {
    display: flex;
    flex-direction: column;
    max-width: 340px;
    max-height: 70vh;
    padding: 1.4rem 1.2rem 1.1rem;
    text-align: left;
}
.role-pick-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0.4rem 0 0.9rem;
}
.role-pick-item {
    flex: none;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 14px;
    background: rgba(127, 127, 127, 0.16);
    color: inherit;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.role-pick-item:active { opacity: 0.75; }
.role-pick-item.selected { background: #0a84ff; color: #fff; }


/* ── TOP CHARTS RAIL (Apple Books style) ── */
.tc-rail { margin: 0; }
.tc-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0 1.5rem;
    margin-bottom: 0.6rem;
    color: var(--text-main);
    cursor: pointer;
}
.tc-head h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.tc-head svg { color: var(--text-muted); flex-shrink: 0; }
.tc-scroll {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding: 0 1.5rem;
    scroll-padding-left: 1.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.tc-scroll::-webkit-scrollbar { display: none; }
.tc-col {
    flex: 0 0 calc(100% - 2.2rem);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}
.tc-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tc-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.tc-cover {
    width: 64px;
    height: 92px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 5px;
    background: var(--border);
    box-shadow: 0 3px 10px var(--shadow-color);
}
.tc-rank {
    width: 1.6rem;
    flex-shrink: 0;
    text-align: center;
    font-family: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}
.tc-text { flex: 1; min-width: 0; }
.tc-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tc-author {
    margin-top: 2px;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 900px) {
    .tc-head { padding-left: 3rem; padding-right: 3rem; }
    .tc-scroll { padding-left: 3rem; padding-right: 3rem; scroll-padding-left: 3rem; }
    .tc-col { flex-basis: 420px; }
}


/* ── SHELF SECTION (Apple Books style) ── */
.sh-section { margin: 0; padding: 0 1.5rem; }
.sh-heading {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
}
.sh-block {
    padding: 1rem 0 1.2rem;
    border-top: 1px solid var(--border);
    margin-top: 0.8rem;
}
.sh-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    margin-bottom: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}
.sh-head h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0;
}
.sh-head svg { color: var(--text-muted); flex-shrink: 0; }
.sh-scroll {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 4px 1.5rem 0.6rem;
    scroll-padding-left: 1.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.sh-scroll::-webkit-scrollbar { display: none; }
.sh-cover {
    flex: 0 0 auto;
    height: 150px;
    width: auto;
    max-width: 240px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--border);
    box-shadow: 0 4px 12px var(--shadow-color);
    cursor: pointer;
}
@media (min-width: 900px) {
    .sh-section { padding: 0 3rem; }
    .sh-scroll { margin: 0 -3rem; padding-left: 3rem; padding-right: 3rem; scroll-padding-left: 3rem; }
    .sh-cover { height: 190px; }
}

/* ── FEATURE CARDS (Apple Books Top Picks style) ── */
.fc-rail { margin: 0; }
.fc-scroll {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding: 0 1.5rem;
    scroll-padding-left: 1.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.fc-scroll::-webkit-scrollbar { display: none; }
.fc-card {
    flex: 0 0 calc(100% - 3rem);
    scroll-snap-align: start;
    padding: 1.4rem 1.4rem 1.2rem;
    border-radius: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
:root:not([data-theme="light"]) .fc-card { background: #1c1c1e; border-color: transparent; }
.fc-collage {
    display: flex;
    gap: 0.7rem;
    height: 190px;
    margin-bottom: 1.1rem;
}
.fc-big {
    height: 100%;
    width: auto;
    max-width: 55%;
    border-radius: 5px;
    object-fit: cover;
    background: var(--border);
    box-shadow: 0 6px 16px var(--shadow-color);
}
.fc-small {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.fc-small img {
    flex: 1;
    min-height: 0;
    width: 100%;
    border-radius: 5px;
    object-fit: cover;
    background: var(--border);
    box-shadow: 0 4px 12px var(--shadow-color);
}
.fc-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
}
.fc-sub {
    margin-top: 2px;
    font-size: 0.95rem;
    color: var(--text-muted);
}
@media (min-width: 900px) {
    .fc-scroll { padding: 0 3rem; scroll-padding-left: 3rem; }
    .fc-card { flex-basis: 420px; }
}

/* ── BOOKS WE LOVE (Home) ── */
.bwl-section {
    background: #234a74;
    padding: 30px 0 0;
    margin: 0;
    overflow: hidden;
}
.bwl-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    color: #fff;
    cursor: pointer;
}
.bwl-head h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
}
.bwl-head svg { opacity: 0.6; width: 20px; height: 20px; }
.bwl-sub {
    margin: 8px 20px 0;
    font-size: 1rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}
.bwl-stack {
    display: flex;
    align-items: flex-start;
    height: 150px;
    margin-top: 18px;
    padding: 0 20px;
    overflow: hidden;
    justify-content: center;
}
.bwl-cover {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}
.bwl-cover:nth-child(1) { height: 175px; margin-top: 0; margin-right: -34px; }
.bwl-cover:nth-child(2) { height: 160px; margin-top: 8px; margin-right: -44px; }
.bwl-cover:nth-child(3) { height: 172px; margin-top: 0; margin-right: -44px; }
.bwl-cover:nth-child(4) { height: 160px; margin-top: 8px; margin-right: 0; }
.bwl-cover:nth-child(n+5) { display: none; }