 
        :root {
            --primary: #3b82f6;
            --primary-light: #eff6ff;
            --primary-hover: #2563eb;
            --secondary: #f3f4f6;
            --foreground: #1e293b;
            --muted: #64748b;
            --border: #e2e8f0;
            --bg-body: #f8fafc;
        }

        * { box-sizing: border-box; }
        body { 
            font-family: 'Inter', sans-serif; 
            margin: 0; 
            background-color: var(--bg-body); 
            color: var(--foreground);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        h1, h2, h3 { font-family: 'Poppins', sans-serif; margin: 0; }
        .container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; width: 100%; }
        .hidden { display: none !important; }

        /* Navigation */
        .nav {
            position: sticky;
            top: 0;
            z-index: 50;
            width: 100%;
            border-bottom: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(12px);
        }
        .nav-inner {
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .logo-wrap { display: flex; align-items: center; gap: 0.5rem; }
        .logo-icon {
            height: 48px;
            width: 48px;
            border-radius: 50%;
            background: transparent;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .logo-img {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        @media (max-width: 767px) {
            .logo-icon {
                width: 32px;
                height: 32px;
            }
            .logo-img {
                width: 32px;
                height: 32px;
            }
        }
        
        @media (max-width: 480px) {
            .logo-icon {
                width: 28px;
                height: 28px;
            }
            .logo-img {
                width: 28px;
                height: 28px;
            }
        }
        
        .logo-text h1 { font-family: 'Poppins', sans-serif; font-size: 24px; font-weight: 700; line-height: 1; color: #3b82f6; }
        .logo-text p { font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
        
        .nav-links { display: flex; align-items: center; gap: 1.5rem; }
        .nav-links a { text-decoration: none; color: var(--muted); font-size: 0.875rem; font-weight: 500; transition: 0.2s; }
        .nav-links a:hover { color: var(--primary); }
        .btn-contribute {
            padding: 0.375rem 0.75rem; border: 1px solid var(--border);
            background: white; border-radius: 6px; cursor: pointer; font-size: 0.875rem;
        }

        /* Hero */
        .hero { position: relative; padding: 3rem 0; overflow: hidden; text-align: center; }
        .hero-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, #fff, #eff6ff50, #fff); }
        .badge {
            display: inline-block; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600;
            color: var(--primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 9999px; margin-bottom: 1rem;
        }
        .hero-title { font-size: 2.5rem; font-weight: 800; color: #0f172a; margin-bottom: 1.5rem; }
        @media (min-width: 768px) { .hero-title { font-size: 3.5rem; } }
        .text-blue { color: var(--primary); }
        .hero-desc { color: var(--muted); max-width: 42rem; margin: 0 auto 2rem; line-height: 1.6; font-size: 1.125rem; }

        /* Search */
        .search-box { position: relative; max-width: 32rem; margin: 0 auto 3rem; }
        .search-inner {
            position: relative; display: flex; align-items: center;
            background: white; border: 1px solid var(--border); border-radius: 0.75rem;
            transition: all 0.3s; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
            gap: 0.5rem;
            padding-right: 0.5rem;
        }
        .search-inner:focus-within { border-color: var(--primary); ring: 4px rgba(59, 130, 246, 0.1); }
        .search-icon { margin-left: 1rem; color: #94a3b8; width: 20px; }
        .search-box input {
            flex: 1; width: 100%; border: none; padding: 1rem; outline: none; font-size: 1rem; background: transparent;
        }
        .search-btn {
            border: none;
            padding: 0;
            font-size: 0.875rem;
            font-weight: 600;
            color: white;
            background: var(--primary);
            border-radius: 0.6rem;
            cursor: pointer;
            transition: 0.2s;
            white-space: nowrap;
            min-height: 40px;
            min-width: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .search-btn:hover { background: var(--primary-hover); }
        .search-btn:active { transform: translateY(1px); }
        .search-btn:focus-visible { outline: 3px solid rgba(59, 130, 246, 0.25); outline-offset: 2px; }
        .search-btn svg { width: 18px; height: 18px; }
        .search-btn-text { display: none; }

        /* Tabs */
        .tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
        .tab-btn {
            padding: 0.625rem 1.25rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 600;
            border: 1px solid var(--border); background: white; color: var(--muted); cursor: pointer; transition: 0.3s;
        }
        .tab-btn.active {
            background: var(--primary); color: white; border-color: var(--primary);
            box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3); transform: scale(1.05);
        }

        /* Content Area */
        .main { padding-bottom: 5rem; flex: 1; }
        .content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
        .dept-title { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
        .count-badge { font-size: 0.75rem; font-weight: 400; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }

        /* Regulation Toggle */
        .reg-toggle { display: flex; align-items: center; gap: 0.5rem; background: #f1f5f9; padding: 4px; border-radius: 0.5rem; border: 1px solid var(--border); }
        .reg-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); padding: 0 8px; text-transform: uppercase; }
        .reg-btns { display: flex; background: white; border-radius: 4px; overflow: hidden; }
        .reg-btn { border: none; padding: 4px 12px; font-size: 0.75rem; cursor: pointer; color: var(--muted); background: transparent; }
        .reg-btn.active { color: var(--primary); font-weight: 600; background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

        /* Grid */
        .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; align-items: start; }
        .card { background: white; border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; transition: 0.3s; height: fit-content; }
        .card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
        .card.expanded { ring: 2px solid var(--primary); border-color: var(--primary); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
        .card.is-focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
        .card.is-focus .card-body { background: #eff6ff; }
        .card-body { padding: 1.25rem; cursor: pointer; }

        .subject-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
        .subject-code {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            border: 1px solid #c7d2fe;
            background: #eef2ff;
            color: #3730a3;
        }
        .subject-link { font-size: 0.75rem; font-weight: 600; color: var(--primary); text-decoration: none; }
        .subject-link:hover { text-decoration: underline; }

        .card-header { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
        .sem-tag { padding: 2px 8px; font-size: 0.7rem; font-family: monospace; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
        .reg-tag { padding: 2px 8px; font-size: 0.75rem; font-weight: 600; border-radius: 4px; }
        .reg-tag.odd { background: #ffedd5; color: #c2410c; }
        .reg-tag.even { background: #dbeafe; color: #1d4ed8; }

        .papers-list { background: #f8fafc; border-top: 1px solid #f1f5f9; padding: 1.25rem; max-height: 280px; overflow-y: auto; }
        .paper-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 0.75rem; background: white; border: 1px solid var(--border);
            border-radius: 0.5rem; margin-bottom: 0.75rem; transition: 0.2s;
        }
        .paper-item:hover { border-color: #bfdbfe; background: #eff6ff; }
        .btn-icon { background: none; border: none; padding: 8px; cursor: pointer; color: var(--muted); border-radius: 6px; transition: 0.2s; }
        .btn-icon:hover { color: var(--primary); background: #eff6ff; }

        /* Modal */
        .modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(6px); }
        .modal-content { background: white; border-radius: 0.75rem; width: 95vw; max-width: 1200px; height: 95vh; min-height: 80vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
        .modal-header { padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; border-bottom: 1px solid var(--border); }
        .pdf-frame { flex: 1; width: 100%; height: 100%; border: none; background: #f1f5f9; }
        .modal-footer { padding: 1rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

        /* Footer */
        .footer { border-top: 1px solid var(--border); background: white; padding: 3rem 0; margin-top: auto; text-align: center; }
        .footer-logo { display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: var(--primary); font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; }

        /* States */
        .loader { text-align: center; padding: 5rem 0; }
        .spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
        @keyframes spin { to { transform: rotate(360deg); } }
        
        .empty-state { text-align: center; padding: 5rem 0; border: 2px dashed var(--border); border-radius: 1rem; }

        /* Dark mode overrides */
        body.dark-mode {
            --bg-body: #0b1220;
            --foreground: #e5e7eb;
            --muted: #9ca3af;
            --border: #1f2937;
            --secondary: #0f172a;
        }
        body.dark-mode .nav { background: rgba(17, 24, 39, 0.7); border-bottom-color: var(--border); }
        body.dark-mode .logo-text p { color: #94a3b8; }
        body.dark-mode .logo-text h1,
        body.dark-mode .footer-logo {
            color: #7dd3fc;
            text-shadow: 0 0 12px rgba(125, 211, 252, 0.45);
        }
        body.dark-mode .hero-bg { background: linear-gradient(to bottom, #0b1220, #0b1220); }
        body.dark-mode .badge { background: #0f172a; border-color: var(--border); color: #93c5fd; }
        body.dark-mode .hero-title { color: #e5e7eb; }
        body.dark-mode .hero-desc { color: var(--muted); }
        body.dark-mode .search-inner { background: #0f172a; border-color: var(--border); box-shadow: none; }
        body.dark-mode .search-btn { background: var(--primary); color: #fff; }
        body.dark-mode .search-btn:focus-visible { outline-color: rgba(147, 197, 253, 0.35); }
        body.dark-mode .reg-toggle { background: #0f172a; border-color: var(--border); }
        body.dark-mode .reg-label { color: #94a3b8; }
        body.dark-mode .reg-btns { background: #0b1220; }
        body.dark-mode .reg-btn { color: #94a3b8; }
        body.dark-mode .reg-btn.active { background: #111827; color: #e5e7eb; box-shadow: none; }
        body.dark-mode .tab-btn { background: #0f172a; border-color: var(--border); color: #94a3b8; }
        body.dark-mode .tab-btn.active { background: var(--primary); color:#fff; border-color: var(--primary); }
        body.dark-mode .card { background: #0f172a; border-color: var(--border); }
        body.dark-mode .card.is-focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2); }
        body.dark-mode .card.is-focus .card-body { background: rgba(30, 64, 175, 0.18); }
        body.dark-mode .subject-code { background: #0b1220; border-color: #1f2937; color: #93c5fd; }
        body.dark-mode .subject-link { color: #93c5fd; }
        body.dark-mode .papers-list { background: #0b1220; border-top-color: var(--border); }
        body.dark-mode .paper-item { background: #0f172a; border-color: var(--border); }
        body.dark-mode .btn-icon { color: #9ca3af; }
        body.dark-mode .btn-icon:hover { background: #111827; }
        body.dark-mode .footer { background: #0b1220; border-top-color: var(--border); }
        body.dark-mode .count-badge { background: #111827; color: #9ca3af; }
        body.dark-mode .modal { background: rgba(0,0,0,0.6); }
        body.dark-mode .modal-content { background: #0b1220; color: #e5e7eb; }
        body.dark-mode .modal-header { background: #0f172a; border-bottom-color: var(--border); }
        body.dark-mode .pdf-frame { background: #0b1220; }
        body.dark-mode .modal-footer { border-top-color: var(--border); }

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

        /* Very small mobile (≤480px) */
        @media (max-width: 480px) {
            .search-inner { padding: 0.25rem 0.5rem 0.25rem 0.25rem; }
            .search-box input {
                padding: 0.85rem 0.75rem;
            }
            .search-btn {
                width: 44px;
                height: 44px;
                border-radius: 0.75rem;
            }
            .nav-inner {
                height: 48px;
                padding: 0 10px;
            }

            .logo-icon {
                height: 24px;
                width: 24px;
            }

            .logo-text h1 {
                font-size: 20px;
            }

            .logo-text p {
                font-size: 8px;
            }

            .nav-links a {
                font-size: 11px;
            }

            .btn-contribute {
                padding: 5px 10px;
                font-size: 11px;
            }

            .hero {
                padding: 24px 12px;
            }

            .badge {
                font-size: 9px;
                padding: 3px 10px;
                margin-bottom: 10px;
            }

            .hero-title {
                font-size: 20px;
                margin-bottom: 12px;
            }

            .hero-desc {
                font-size: 13px;
                margin-bottom: 16px;
            }

            .search-box {
                margin-bottom: 20px;
            }

            .search-inner {
                border-radius: 8px;
            }

            .search-icon {
                margin-left: 10px;
                width: 16px;
            }

            .search-box input {
                padding: 10px;
                font-size: 13px;
            }

            .tabs {
                gap: 6px;
            }

            .tab-btn {
                padding: 6px 12px;
                font-size: 11px;
            }

            .container {
                padding: 0 12px;
            }

            .content-header {
                margin-bottom: 16px;
                gap: 12px;
            }

            .dept-title {
                font-size: 16px;
                gap: 6px;
            }

            .count-badge {
                font-size: 9px;
                padding: 2px 6px;
            }

            .reg-toggle {
                gap: 6px;
                padding: 3px;
            }

            .reg-label {
                font-size: 9px;
                padding: 0 6px;
            }

            .reg-btn {
                padding: 3px 8px;
                font-size: 9px;
            }

            .grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .card-body {
                padding: 12px;
            }

            .card-header {
                margin-bottom: 8px;
            }

            .sem-tag {
                font-size: 9px;
                padding: 2px 6px;
            }

            .reg-tag {
                font-size: 9px;
                padding: 2px 6px;
            }

            .card-body h3 {
                font-size: 14px !important;
                line-height: 1.3 !important;
            }

            .papers-list {
                padding: 12px;
                max-height: 240px;
            }

            .paper-item {
                padding: 10px;
                margin-bottom: 8px;
            }

            .paper-item > div:first-child > div:first-child {
                font-size: 12px !important;
            }

            .paper-item > div:first-child > div:last-child {
                font-size: 9px !important;
            }

            .btn-icon {
                padding: 6px;
            }

            .modal-content {
                width: 98%;
                height: 95vh;
            }

            .modal-header {
                padding: 10px 12px;
            }

            .modal-header h3 {
                font-size: 13px !important;
            }

            .modal-footer {
                padding: 10px;
                gap: 8px;
            }

            .modal-footer button {
                font-size: 12px;
                padding: 8px 12px;
            }

            .footer {
                padding: 24px 12px;
            }

            .footer-logo {
                font-size: 16px;
                margin-bottom: 12px;
            }

            .footer p {
                font-size: 12px !important;
                margin-bottom: 16px !important;
            }

            .footer > div > div:last-child {
                font-size: 10px !important;
            }

            .empty-state {
                padding: 40px 12px;
            }

            .empty-state h3 {
                font-size: 16px;
            }

            .empty-state p {
                font-size: 12px;
            }
        }

        /* Mobile general (481px-640px) */
        @media (min-width: 481px) and (max-width: 640px) {
            .nav-inner {
                height: 52px;
                padding: 0 14px;
            }

            .logo-icon {
                height: 26px;
                width: 26px;
            }

            .logo-text h1 {
                font-size: 22px;
            }

            .logo-text p {
                font-size: 9px;
            }

            .nav-links a {
                font-size: 12px;
            }

            .btn-contribute {
                padding: 6px 12px;
                font-size: 12px;
            }

            .hero {
                padding: 30px 16px;
            }

            .badge {
                font-size: 10px;
                padding: 4px 12px;
                margin-bottom: 12px;
            }

            .hero-title {
                font-size: 24px;
                margin-bottom: 14px;
            }

            .hero-desc {
                font-size: 14px;
                margin-bottom: 18px;
            }

            .search-box {
                margin-bottom: 24px;
            }

            .search-icon {
                margin-left: 12px;
                width: 18px;
            }

            .search-box input {
                padding: 12px;
                font-size: 14px;
            }

            .tabs {
                gap: 8px;
            }

            .tab-btn {
                padding: 8px 16px;
                font-size: 12px;
            }

            .container {
                padding: 0 16px;
            }

            .content-header {
                margin-bottom: 18px;
            }

            .dept-title {
                font-size: 18px;
            }

            .count-badge {
                font-size: 10px;
                padding: 2px 7px;
            }

            .reg-toggle {
                gap: 8px;
                padding: 4px;
            }

            .reg-label {
                font-size: 10px;
                padding: 0 7px;
            }

            .reg-btn {
                padding: 4px 10px;
                font-size: 10px;
            }

            .grid {
                grid-template-columns: 1fr;
                gap: 14px;
            }

            .card-body {
                padding: 14px;
            }

            .sem-tag {
                font-size: 10px;
            }

            .reg-tag {
                font-size: 10px;
            }

            .card-body h3 {
                font-size: 16px !important;
            }

            .papers-list {
                padding: 14px;
                max-height: 260px;
            }

            .paper-item {
                padding: 12px;
            }

            .paper-item > div:first-child > div:first-child {
                font-size: 13px !important;
            }

            .paper-item > div:first-child > div:last-child {
                font-size: 10px !important;
            }

            .modal-content {
                width: 95%;
                height: 92vh;
            }

            .modal-header {
                padding: 12px 16px;
            }

            .modal-header h3 {
                font-size: 14px !important;
            }

            .modal-footer {
                padding: 12px;
            }

            .modal-footer button {
                font-size: 13px;
            }

            .footer {
                padding: 28px 16px;
            }

            .footer-logo {
                font-size: 18px;
            }

            .footer p {
                font-size: 13px !important;
            }

            .footer > div > div:last-child {
                font-size: 11px !important;
            }
        }

        /* Tablet (641px-1024px) */
        @media (min-width: 641px) and (max-width: 1024px) {
            .nav-inner {
                height: 56px;
                padding: 0 24px;
            }

            .logo-icon {
                height: 28px;
                width: 28px;
            }

            .logo-text h1 {
                font-size: 24px;
            }

            .logo-text p {
                font-size: 9px;
            }

            .nav-links {
                gap: 12px;
            }

            .nav-links a {
                font-size: 13px;
            }

            .btn-contribute {
                padding: 7px 14px;
                font-size: 13px;
            }

            .hero {
                padding: 40px 24px;
            }

            .badge {
                font-size: 11px;
                padding: 4px 14px;
            }

            .hero-title {
                font-size: 32px;
            }

            .hero-desc {
                font-size: 16px;
            }

            .search-box {
                margin-bottom: 28px;
            }

            .tab-btn {
                padding: 10px 18px;
                font-size: 13px;
            }

            .container {
                padding: 0 24px;
            }

            .content-header {
                margin-bottom: 20px;
            }

            .dept-title {
                font-size: 20px;
            }

            .count-badge {
                font-size: 11px;
            }

            .reg-label {
                font-size: 11px;
            }

            .reg-btn {
                padding: 5px 11px;
                font-size: 11px;
            }

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

            .card-body {
                padding: 16px;
            }

            .card-body h3 {
                font-size: 17px !important;
            }

            .papers-list {
                padding: 16px;
            }

            .paper-item > div:first-child > div:first-child {
                font-size: 14px !important;
            }

            .modal-footer button {
                font-size: 14px;
            }

            .footer {
                padding: 32px 24px;
            }

            .footer-logo {
                font-size: 20px;
            }
        }

        /* Landscape mobile */
        @media (max-height: 600px) and (orientation: landscape) {
            .hero {
                padding: 20px 16px;
            }

            .hero-title {
                font-size: 22px;
            }

            .badge {
                margin-bottom: 8px;
            }

            .hero-desc {
                margin-bottom: 16px;
            }

            .nav-inner {
                height: 48px;
            }

            .logo-text h1 {
                font-size: 20px;
            }
        }

        /* Large desktop */
        @media (min-width: 1400px) {
            .container {
                max-width: 1400px;
            }

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

