/* ==========================================================================
   NEXBOOK — premium-v2.css
   Motion, illustration & signature-detail layer. Loaded after premium.css.
   Pure presentation: no IDs changed, no Firebase/JS behaviour touched.
   ========================================================================== */

/* ---------- 0. Course colour system (B.Sc / B.A / B.Com / BCA / BBA / PG) ---------- */
:root {
    --c-sci: #2563eb;   /* B.Sc. — blue */
    --c-arts: #c2410c;  /* B.A.  — terracotta */
    --c-com: #047857;   /* B.Com — green */
    --c-bca: #7c3aed;   /* BCA   — violet */
    --c-bba: #b45309;   /* BBA   — amber */
    --c-pg: #0f172a;    /* M.*   — ink */
    --ink: #111110;
    --ink-2: rgba(17,17,16,0.62);
    --paper: #fbfbfa;
    --line: rgba(17,17,16,0.10);
}
[data-course="sci"]  { --course: var(--c-sci); }
[data-course="arts"] { --course: var(--c-arts); }
[data-course="com"]  { --course: var(--c-com); }
[data-course="bca"]  { --course: var(--c-bca); }
[data-course="bba"]  { --course: var(--c-bba); }
[data-course="pg"]   { --course: var(--c-pg); }

/* ---------- 1. Smooth scroll + thin ink scrollbar ---------- */
html { scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: rgba(17,17,16,0.28) transparent; }
html::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: rgba(17,17,16,0.22); border-radius: 999px; border: 2px solid var(--paper); }
html::-webkit-scrollbar-thumb:hover { background: rgba(17,17,16,0.45); }

/* ---------- 2. Page-load choreography (hero) ---------- */
@keyframes nbRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nbHeroImg { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
@keyframes nbKenBurns { from { transform: scale(1) translate3d(0,0,0); } to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); } }
@keyframes nbKickerIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }

html:not(.nb-no-motion) #top > img {
    animation: nbHeroImg 1.2s cubic-bezier(0.22,1,0.36,1) both, nbKenBurns 26s ease-in-out 1.2s infinite alternate both;
    will-change: transform;
    transform-origin: 55% 45%;
}
html:not(.nb-no-motion) #top h1 { animation: nbRise 0.9s cubic-bezier(0.22,1,0.36,1) 0.05s both; }
html:not(.nb-no-motion) #top p.hero-subtitle-shadow { animation: nbRise 0.9s cubic-bezier(0.22,1,0.36,1) 0.16s both; }
html:not(.nb-no-motion) #top p.hero-subtitle-shadow > span { animation: nbKickerIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.1s both; }
html:not(.nb-no-motion) #top .flex.flex-col { animation: nbRise 0.9s cubic-bezier(0.22,1,0.36,1) 0.3s both; }
#top { overscroll-behavior-y: auto; }
/* rubber-band stretch on overscroll (set by JS) */
#top > img { transition: transform 0.45s cubic-bezier(0.22,1,0.36,1); }
html.nb-overscroll #top > img { animation-play-state: paused; transform: scale(var(--nb-stretch, 1)) !important; }

/* ---------- 3. Section boundary fades + ghost numbers + abstract shapes ---------- */
main > section, body > section { position: relative; }
section.bg-gray-50::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 64px; pointer-events: none;
    background: linear-gradient(to bottom, #ffffff, rgba(249,250,251,0)); z-index: 0;
}
section.bg-white::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 64px; pointer-events: none;
    background: linear-gradient(to bottom, #f9fafb, rgba(255,255,255,0)); z-index: 0;
}
#top::before { display: none; }
section > .max-w-7xl, section > .max-w-6xl, section > .max-w-5xl, section > .max-w-4xl, section > .container { position: relative; z-index: 1; }

.nb-ghost {
    position: absolute; top: 28px; right: clamp(8px, 3vw, 48px); z-index: 0; pointer-events: none; user-select: none;
    font-family: var(--font-display, 'Playfair Display', serif); font-weight: 800; font-style: italic;
    font-size: clamp(120px, 18vw, 300px); line-height: 1; color: var(--ink); opacity: 0.035; letter-spacing: -0.04em;
}
.nb-shape {
    position: absolute; z-index: 0; pointer-events: none; left: 50%; top: 48px; transform: translateX(-50%);
    width: min(520px, 80vw); aspect-ratio: 1; opacity: 0.05; border: 1.5px solid var(--ink);
}
.nb-shape--circle { border-radius: 50%; }
.nb-shape--ring { border-radius: 50%; box-shadow: inset 0 0 0 54px transparent, inset 0 0 0 56px var(--ink); border-width: 1.5px; }
.nb-shape--square { border-radius: 48px; transform: translateX(-50%) rotate(8deg); }
@media (max-width: 767px) { .nb-ghost { font-size: 110px; top: 12px; } .nb-shape { top: 24px; } }

/* ---------- 4. Live campus ticker (under hero) ---------- */
.nb-ticker {
    position: relative; z-index: 2; overflow: hidden; height: 56px; display: flex; align-items: center;
    background: #fdfdfb;
    border-top: 1px solid rgba(17,17,16,0.08);
    border-bottom: 1px solid rgba(17,17,16,0.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
/* soft vignette at both ends so items dissolve instead of getting clipped */
.nb-ticker::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
    background: linear-gradient(90deg, #fdfdfb 0%, rgba(253,253,251,0) 16%, rgba(253,253,251,0) 88%, #fdfdfb 100%);
}
/* pinned live badge */
.nb-ticker__live {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 4; flex: none;
    display: inline-flex; align-items: center; gap: 8px; padding: 0 26px 0 clamp(16px, 4vw, 40px);
    font: 700 0.66rem/1 var(--font-ui, Inter, system-ui); letter-spacing: 0.18em; text-transform: uppercase;
    color: #111110;
    background: #fdfdfb;
    border-right: 1px solid rgba(17,17,16,0.1);
}
/* fade tail so items dissolve out from under the badge instead of getting chopped */
.nb-ticker__live::after {
    content: ''; position: absolute; left: 100%; top: 0; bottom: 0; width: 60px; pointer-events: none;
    background: linear-gradient(90deg, #fdfdfb 0%, rgba(253,253,251,0) 100%);
}
.nb-ticker__pulse { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; flex: none; box-shadow: 0 0 0 0 rgba(22,163,74,0.5); animation: nbPulse 2.4s ease-out infinite; }
@keyframes nbPulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.45); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }

.nb-ticker__track { display: flex; align-items: center; gap: 0; white-space: nowrap; will-change: transform; animation: nbTicker 120s linear infinite; }
/* Hover pe pause NAHI hoga — always scroll */

.nb-ticker__item {
    display: inline-flex; align-items: baseline; gap: 7px; padding: 0 26px;
    font: 500 0.795rem/1 var(--font-ui, Inter, system-ui); letter-spacing: 0.012em;
    color: rgba(17,17,16,0.6);
}
.nb-ticker__item b { color: #111110; font-weight: 650; letter-spacing: 0.015em; }
.nb-ticker__item span:not(.go) { color: rgba(17,17,16,0.38); font-weight: 450; }
.nb-ticker__item span:not(.go)::before { content: '·'; margin-right: 7px; color: rgba(17,17,16,0.25); }
/* fallback bullet if the v5 icon pass hasn't run */
.nb-ticker__dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(17,17,16,0.25); flex: none; align-self: center; }
.nb-ticker__sep { flex: none; width: 1px; height: 15px; background: linear-gradient(180deg, transparent, rgba(17,17,16,0.14), transparent); }
@keyframes nbTicker { to { transform: translateX(-50%); } }
html.nb-no-motion .nb-ticker__track { animation: none; }
@media (max-width: 767px) {
    .nb-ticker { height: 48px; }
    .nb-ticker__track { animation-duration: 160s; } /* Mobile pe slow */

    .nb-ticker__item { padding: 0 18px; font-size: 0.735rem; }
    .nb-ticker__live { padding: 0 20px 0 16px; font-size: 0.6rem; letter-spacing: 0.14em; }
}

/* ---------- 5. Magnetic buttons + haptic press ---------- */
.nb-magnet { transition: transform 0.35s cubic-bezier(0.22,1,0.36,1); will-change: transform; }
.nb-press { transition: transform 0.18s cubic-bezier(0.22,1,0.36,1), box-shadow 0.18s ease; }
.nb-press.is-pressed { transform: scale(0.97) !important; box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important; }
@media (hover: hover) and (pointer: fine) {
    .nb-press:hover { transform: translateY(-2px); }
}

/* ---------- 6. Custom cursor (desktop, fine pointer only) ---------- */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html.nb-cursor, html.nb-cursor a, html.nb-cursor button, html.nb-cursor [role="button"], html.nb-cursor .cursor-pointer { cursor: none !important; }
    html.nb-cursor input, html.nb-cursor textarea, html.nb-cursor select, html.nb-cursor [contenteditable] { cursor: auto !important; }
    .nb-cur {
        position: fixed; left: 0; top: 0; z-index: 2147483647; pointer-events: none;
        width: 10px; height: 10px; border-radius: 999px; background: var(--ink);
        transform: translate(-50%, -50%); transition: width 0.25s cubic-bezier(0.22,1,0.36,1), height 0.25s cubic-bezier(0.22,1,0.36,1), background 0.2s, opacity 0.2s;
        mix-blend-mode: normal; display: grid; place-items: center; overflow: hidden;
        font: 600 11px/1 var(--font-ui, Inter, system-ui); color: #fff; letter-spacing: 0.02em; opacity: 0;
    }
    .nb-cur.is-on { opacity: 1; }
    .nb-cur::after { content: attr(data-label); opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
    .nb-cur.is-link { width: 34px; height: 34px; background: var(--ink); }
    .nb-cur.is-link::after { opacity: 1; }
    .nb-cur.is-card { width: 58px; height: 58px; background: rgba(17,17,16,0.92); }
    .nb-cur.is-card::after { opacity: 1; }
    .nb-cur.is-text { width: 2px; height: 22px; border-radius: 1px; }
    .nb-cur.is-hidden { opacity: 0; }
}

/* ---------- 7. Buy Books tiles → book-spine shelves ---------- */
.course-major-item > div { background: #f4f3ef !important; }
.course-major-item img { opacity: 0.14 !important; filter: grayscale(1) contrast(1.1); transform: none !important; }
.course-major-item > div > .absolute.bg-gradient-to-t { background: linear-gradient(to top, rgba(17,17,16,0.72), rgba(17,17,16,0.05) 60%, transparent) !important; }
.course-major-item > div > .absolute.bg-black\/40 { background: transparent !important; align-items: flex-start !important; justify-content: flex-start !important; padding: 3.1rem 1.4rem 1.25rem !important; }
.course-major-item h3 { font-family: var(--font-display, 'Playfair Display', serif) !important; font-size: 1.45rem !important; line-height: 1.1 !important; text-align: left !important; color: var(--ink) !important; max-width: 60%; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
.course-major-item > div > .absolute.bg-gradient-to-t { background: linear-gradient(to top, rgba(17,17,16,0.55), transparent 45%) !important; }
.nb-shelf {
    position: absolute; left: 0; right: 0; bottom: 22px; height: 170px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 7px;
    padding: 0 7%; pointer-events: none; z-index: 1;
}
.nb-spine {
    --h: 150px; width: 34px; height: var(--h); border-radius: 3px 3px 2px 2px; position: relative; flex: none;
    background: linear-gradient(90deg, rgba(0,0,0,0.22), transparent 18%, rgba(255,255,255,0.18) 40%, transparent 62%, rgba(0,0,0,0.25)), var(--course, #444);
    box-shadow: 0 14px 22px -10px rgba(0,0,0,0.45), inset 0 -2px 0 rgba(0,0,0,0.18);
    transform-origin: bottom center; transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.nb-spine::before { content: ""; position: absolute; left: 5px; right: 5px; top: 10px; height: 2px; background: rgba(255,255,255,0.55); box-shadow: 0 calc(var(--h) - 24px) 0 rgba(255,255,255,0.55); }
.nb-spine span {
    position: absolute; inset: 0; display: grid; place-items: center; writing-mode: vertical-rl; transform: rotate(180deg);
    font: 700 10px/1 var(--font-ui, Inter, system-ui); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.92); padding: 16px 0;
}
.nb-spine:nth-child(2) { --h: 132px; width: 28px; filter: brightness(1.12); }
.nb-spine:nth-child(3) { --h: 162px; width: 40px; filter: brightness(0.92); }
.nb-spine:nth-child(4) { --h: 124px; width: 30px; filter: brightness(1.2) saturate(0.9); }
.nb-spine:nth-child(5) { --h: 146px; width: 26px; filter: brightness(0.82); }
.nb-spine:nth-child(5) { transform: rotate(-9deg) translateX(4px); }
.nb-shelf::after {
    content: ""; position: absolute; left: 5%; right: 5%; bottom: 18px; height: 9px; border-radius: 2px;
    background: linear-gradient(#8a6a48, #5e4630); box-shadow: 0 12px 22px -8px rgba(0,0,0,0.5);
}
.course-major-item:hover .nb-spine { transform: translateY(-6px); }
.course-major-item:hover .nb-spine:nth-child(3) { transform: translateY(-12px); }
.course-major-item:hover .nb-spine:nth-child(5) { transform: rotate(-3deg) translateX(2px) translateY(-5px); }
.course-major-item .nb-course-tag {
    position: absolute; top: 14px; left: 16px; z-index: 2; font: 700 0.66rem/1 var(--font-ui, Inter, system-ui); letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--course, var(--ink)); background: rgba(255,255,255,0.9); padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.06);
}
.course-major-item > div { border-top: 3px solid var(--course, transparent) !important; }
@media (max-width: 767px) { .nb-spine { width: 28px; } .nb-spine:nth-child(3) { width: 34px; } .nb-shelf { bottom: 20px; height: 150px; } .course-major-item h3 { max-width: 100%; } }

/* ---------- 8. AI course cards → tilted deck with stacked shadow cards ---------- */
@media (min-width: 1024px) {
    #ai-courses-grid { perspective: 1400px; }
    #ai-courses-grid .course-card { position: relative; transform: rotate(-1.4deg); transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), box-shadow 0.6s; }
    #ai-courses-grid .course-card:nth-child(even) { transform: rotate(1.2deg); }
    #ai-courses-grid .course-card::before, #ai-courses-grid .course-card::after {
        content: ""; position: absolute; inset: 0; border-radius: inherit; background: #fff; border: 1px solid var(--line); z-index: -1;
        transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), opacity 0.4s; box-shadow: 0 10px 30px -12px rgba(0,0,0,0.18);
    }
    #ai-courses-grid .course-card::before { transform: rotate(3deg) translate(6px, 8px); opacity: 0.9; }
    #ai-courses-grid .course-card::after { transform: rotate(-3.5deg) translate(-6px, 10px); opacity: 0.7; }
    #ai-courses-grid .course-card:hover { transform: rotate(0) translateY(-8px) scale(1.02) !important; z-index: 3; }
    #ai-courses-grid .course-card:hover::before { transform: rotate(6deg) translate(22px, 14px); }
    #ai-courses-grid .course-card:hover::after { transform: rotate(-7deg) translate(-22px, 16px); }
}

/* ---------- 9. Study tiles → frosted glass panel slides up on hover ---------- */
#study-material-grid > button { isolation: isolate; }
#study-material-grid > button > div.absolute.flex { z-index: 2; background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 70%) !important; }
#study-material-grid > button::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; z-index: 1; pointer-events: none;
    background: rgba(20,20,20,0.38); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-top: 1px solid rgba(255,255,255,0.18); transform: translateY(101%); transition: transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
@media (hover: hover) { #study-material-grid > button:hover::after { transform: translateY(0); } }
#study-material-grid > button > div.absolute.flex > p:last-child::after { content: " →"; }
/* document-type glyphs */
.nb-glyph {
    position: absolute; top: 14px; right: 14px; z-index: 3; font: 700 0.62rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em;
    color: #fff; background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.28); padding: 5px 7px; border-radius: 6px; backdrop-filter: blur(6px);
}
/* paper-stack illustration above the grid */
.nb-paperstack { display: flex; justify-content: center; margin: -8px auto 28px; pointer-events: none; }
.nb-paperstack svg { width: min(360px, 80vw); height: auto; }

/* ---------- 10. University chip expands on hover ---------- */
#universities-grid a p.bg-black { display: inline-flex !important; align-items: center; overflow: hidden; white-space: nowrap; transition: padding 0.3s; }
#universities-grid a p.bg-black::after {
    content: "· free certificates"; display: inline-block; max-width: 0; overflow: hidden; opacity: 0; margin-left: 0;
    transition: max-width 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.3s, margin 0.3s; font-weight: 500;
}
@media (hover: hover) {
    #universities-grid a:hover p.bg-black::after { max-width: 180px; opacity: 0.9; margin-left: 6px; }
}

/* ---------- 11. Subject icon set (AcademyX subjects) ---------- */
.nb-subject-icon {
    position: absolute; top: 14px; left: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(255,255,255,0.92); border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 6px 16px -6px rgba(0,0,0,0.25); color: var(--ink);
}
.nb-subject-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#subjects-grid .subject-item { position: relative; }

/* ---------- 12. Condition badge icons (book cards) ---------- */
.nb-cond { display: inline-flex !important; align-items: center; gap: 5px; }
.nb-cond svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 13. Leaderboard → podium, metallic rings, medals, geometric avatars ---------- */
[id^="top-3-section-NEXBOOK"] .grid { align-items: flex-end !important; perspective: 1200px; }
[id^="top-3-section-NEXBOOK"] .grid > div { position: relative; transform-style: preserve-3d; }
[id^="top-3-section-NEXBOOK"] .grid > div::after {
    content: ""; display: block; align-self: stretch; width: calc(100% + 16px); margin: 14px -8px -8px; height: var(--podium, 26px); border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, #ffffff, #ececea 60%, #dedddb); border: 1px solid var(--line); border-bottom: 0;
    box-shadow: inset 0 1px 0 #fff, 0 -6px 18px -10px rgba(0,0,0,0.18);
}
[id^="top-3-section-NEXBOOK"] .grid > div:nth-child(1)::after { --podium: 34px; }
[id^="top-3-section-NEXBOOK"] .grid > div:nth-child(2)::after { --podium: 58px; }
[id^="top-3-section-NEXBOOK"] .grid > div:nth-child(3)::after { --podium: 22px; }
[id^="top-3-section-NEXBOOK"] .grid > div img { position: relative; border-width: 3px !important; animation: nbFloat 5s ease-in-out infinite; }
[id^="top-3-section-NEXBOOK"] .grid > div:nth-child(2) img { animation-delay: -1.2s; border-color: #f5c542 !important; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #d9a520, 0 12px 24px -8px rgba(217,165,32,0.5); }
[id^="top-3-section-NEXBOOK"] .grid > div:nth-child(1) img { border-color: #c0c4cc !important; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #9aa0aa, 0 12px 24px -8px rgba(120,125,135,0.5); }
[id^="top-3-section-NEXBOOK"] .grid > div:nth-child(3) img { animation-delay: -2.4s; border-color: #d4935a !important; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #b5712f, 0 12px 24px -8px rgba(181,113,47,0.5); }
@keyframes nbFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
html.nb-no-motion [id^="top-3-section-NEXBOOK"] .grid > div img { animation: none; }
.nb-medal { position: absolute; z-index: 3; width: 30px; height: 40px; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25)); }
@media (max-width: 767px) { .nb-medal { width: 20px; height: 27px; } }
.nb-confetti { position: absolute; inset: 0; overflow: visible; pointer-events: none; z-index: 5; }
.nb-confetti i { position: absolute; left: 50%; top: 30%; width: 6px; height: 10px; border-radius: 2px; opacity: 0; animation: nbConf 1.6s cubic-bezier(0.22,1,0.36,1) forwards; }
@keyframes nbConf { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(540deg); } }
/* geometric avatars replace placeholders */
.nb-avatar { display: inline-block; border-radius: 50%; overflow: hidden; background: #fff; }
.nb-avatar svg { width: 100%; height: 100%; display: block; }
#leaderboard-container-donors > div, #full-donor-list-NEXBOOK .glass-card { transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s; }

/* ---------- 14. Empty-state illustrations ---------- */
.nb-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 16px; color: var(--ink-2); text-align: center; }
.nb-empty svg { width: 120px; height: auto; stroke: var(--ink); fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.nb-empty p { font: 500 0.95rem/1.5 var(--font-ui, Inter, system-ui); max-width: 28ch; }

/* ---------- 15. Horizontal snap carousels on mobile ---------- */
@media (max-width: 767px) {
    #platforms-grid, #universities-grid, #subjects-grid {
        display: flex !important; gap: 14px !important; overflow-x: auto; overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory; padding: 4px 16px 18px !important; margin: 0 -16px !important;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    #platforms-grid::-webkit-scrollbar, #universities-grid::-webkit-scrollbar, #subjects-grid::-webkit-scrollbar { display: none; }
    #platforms-grid > *, #universities-grid > *, #subjects-grid > * { flex: 0 0 82% !important; scroll-snap-align: center; display: block !important; }
    #universities-grid > * { flex-basis: 72% !important; }
    /* carousel overrides the "view more" hidden-children rule — show all, swipe instead */
    [id$="-wrapper"][data-expanded="false"] #platforms-grid > *, [id$="-wrapper"][data-expanded="false"] #universities-grid > *, [id$="-wrapper"][data-expanded="false"] #subjects-grid > * { display: block !important; }
    #view-more-platforms, #view-more-universities, #view-more-subjects { display: none !important; }
    .nb-swipe-hint { display: flex; justify-content: center; gap: 6px; margin-top: -6px; }
    .nb-swipe-hint i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background 0.3s, width 0.3s; }
    .nb-swipe-hint i.is-on { background: var(--ink); width: 18px; border-radius: 3px; }
}
@media (min-width: 768px) { .nb-swipe-hint { display: none; } }

/* ---------- 16. Bottom nav — relative positioning for blob ---------- */
.mobile-nav-container nav { position: relative; }

/* ---------- 17. Auth modal — Apple-style ---------- */
#authModal .modal-content { border-radius: 24px !important; }
#authModal .modal-content > .relative.h-32 { height: 88px !important; }
#authModal .modal-content > .relative.h-32 img { filter: saturate(0.9); }
#authModal .px-8 { padding-left: 2rem; padding-right: 2rem; padding-bottom: 1.75rem; }
#authModal h2.font-display { font-size: 1.85rem !important; margin-bottom: 0.35rem !important; letter-spacing: -0.03em !important; }
.nb-auth-logo { width: 46px; height: 46px; border-radius: 13px; margin: -40px auto 10px; display: block; position: relative; z-index: 2; box-shadow: 0 8px 20px -8px rgba(0,0,0,0.35), 0 0 0 4px #fff; }
.nb-auth-copy { text-align: center; font: 500 0.92rem/1.5 var(--font-ui, Inter, system-ui); color: var(--ink-2); margin: 0 0 1.1rem; }
.nb-auth-proof { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font: 500 0.78rem/1 var(--font-ui, Inter, system-ui); color: var(--ink-2); }
.nb-auth-proof .nb-avs { display: flex; }
.nb-auth-proof .nb-avs .nb-avatar { width: 20px; height: 20px; border: 2px solid #fff; margin-left: -6px; }
.nb-auth-proof .nb-avs .nb-avatar:first-child { margin-left: 0; }
#authModal #authForm { display: flex; flex-direction: column; gap: 10px; }
#authModal #authForm > #googleSignInBtn { order: -2; height: 52px !important; border-radius: 14px !important; border: 1.5px solid var(--ink) !important; font-weight: 600 !important; font-size: 1rem !important; background: #fff !important; }
#authModal #authForm > .relative.flex.py-2 { order: -1; }
#authModal #authForm > .relative.flex.py-2 span { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
#authModal #authForm input { border-radius: 12px !important; padding: 0.8rem 0.95rem !important; border-color: var(--line) !important; background: #fafaf9; font-size: 0.95rem; }
#authModal #authForm input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(17,17,16,0.08) !important; border-color: var(--ink) !important; --tw-ring-color: transparent !important; }
#authModal #authForm button[type="submit"] { border-radius: 12px !important; height: 48px !important; font-size: 0.95rem !important; }
#authModal #authForm p.text-xs { margin-top: 6px !important; }

/* ---------- 18. Backpack checkout — steps, sticky summary, trust row ---------- */
.nb-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin: 0 auto 22px; max-width: 520px; }
.nb-step { display: flex; align-items: center; gap: 8px; font: 600 0.78rem/1 var(--font-ui, Inter, system-ui); color: var(--ink-2); white-space: nowrap; }
.nb-step i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 0.7rem; }
.nb-step.is-on { color: var(--ink); } .nb-step.is-on i { background: var(--ink); color: #fff; border-color: var(--ink); }
.nb-step.is-done i { background: #16a34a; border-color: #16a34a; color: #fff; }
.nb-step + .nb-step::before { content: ""; width: clamp(18px, 6vw, 56px); height: 1px; background: var(--line); margin: 0 10px; }
.nb-trust { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; margin: 18px 0 4px; font: 500 0.78rem/1 var(--font-ui, Inter, system-ui); color: var(--ink-2); }
.nb-trust span { display: inline-flex; align-items: center; gap: 6px; }
.nb-trust svg { width: 14px; height: 14px; stroke: #16a34a; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 768px) {
    #backpackCheckoutModalContent #checkoutForm > div:first-child { position: sticky; top: 12px; align-self: start; }
}
#backpackCheckoutModalContent #checkoutForm > div:first-child > .bg-gray-50 { border-radius: 16px; background: #fafaf9; }

/* ---------- 19. Thinkly AI — suggestion cards (empty chat) ---------- */
.nb-suggest { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 6px 14px 10px; max-width: 680px; margin: 0 auto; width: 100%; }
.nb-suggest button {
    text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 14px 14px 12px; display: flex; gap: 12px; align-items: flex-start;
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s, border-color 0.3s; cursor: pointer;
}
.nb-suggest button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -16px rgba(0,0,0,0.3); border-color: rgba(17,17,16,0.25); }
.nb-suggest svg { width: 30px; height: 30px; flex: none; stroke: var(--ink); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.nb-suggest b { display: block; font: 600 0.9rem/1.2 var(--font-ui, Inter, system-ui); color: var(--ink); }
.nb-suggest small { display: block; margin-top: 3px; font: 500 0.75rem/1.35 var(--font-ui, Inter, system-ui); color: var(--ink-2); }
#expandedView.nb-has-messages .nb-suggest { display: none; }
@media (max-width: 420px) { .nb-suggest { grid-template-columns: 1fr; } }

/* ---------- 20. Free Books — hands illustration + campus map ---------- */
.nb-hands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 6px; }
.nb-hands figure { margin: 0; text-align: center; }
.nb-hands svg { width: 100%; max-width: 120px; height: auto; display: block; margin: 0 auto 6px; }
.nb-hands figcaption { font: 600 0.72rem/1 var(--font-ui, Inter, system-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.nb-map { margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #f7f6f2; }
.nb-map svg { width: 100%; height: auto; display: block; }
.nb-map figcaption { padding: 10px 14px; font: 500 0.78rem/1.3 var(--font-ui, Inter, system-ui); color: var(--ink-2); display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); background: #fff; }
.nb-map figcaption i { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
@keyframes nbPin { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.nb-map .pin { animation: nbPin 2.2s ease-in-out infinite; transform-origin: center bottom; }
@keyframes nbDash { to { stroke-dashoffset: -40; } }
.nb-map .route { stroke-dasharray: 6 6; animation: nbDash 2.4s linear infinite; }

/* ---------- 21. Footer — night campus skyline ---------- */
.nb-skyline { display: block; width: 100%; height: auto; margin-bottom: -1px; }
.nb-skyline .win { animation: nbWin 4s ease-in-out infinite; }
.nb-skyline .win:nth-child(3n) { animation-delay: -1.3s; } .nb-skyline .win:nth-child(5n) { animation-delay: -2.6s; } .nb-skyline .win:nth-child(7n) { animation-delay: -0.7s; }
@keyframes nbWin { 0%,100% { opacity: 0.9; } 50% { opacity: 0.25; } }
html.nb-no-motion .nb-skyline .win, html.nb-no-motion .nb-map .pin, html.nb-no-motion .nb-map .route { animation: none; }

/* ---------- 22. Colour-coded course accents in modal header ---------- */
#courseModal [data-course] .modal-header, #courseModal[data-course] h2 { border-left: 4px solid var(--course); padding-left: 12px; }
#courseModal[data-course] .modal-content { border-top: 4px solid var(--course) !important; }

/* ---------- 23. Fallback font metrics (zero layout shift while Inter / Playfair load) ---------- */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica Neue"); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "Playfair Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 104%; ascent-override: 104%; descent-override: 28%; line-gap-override: 0%; }
:root { --font-ui: "Inter", "Inter Fallback", system-ui, sans-serif; --font-display: "Playfair Display", "Playfair Fallback", Georgia, serif; }

/* ---------- 24. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    #top > img, #top h1, #top p, #top .flex, .nb-ticker__track, .nb-skyline .win, .nb-map .pin, .nb-map .route, [id^="top-3-section-NEXBOOK"] .grid > div img { animation: none !important; }
    html { scroll-behavior: auto; }
}
