  body { transition: background-color 0.2s, color 0.2s; font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: #ffffff; }

        .dark body { background-color: #111216 !important; color: #e5e7eb !important; }
        html.dark { background-color: #111216; }

        .dark .bg-white        { background-color: #1e1e1e !important; }
        .dark .bg-gray-50      { background-color: #1a1a1e !important; }
        .dark .bg-gray-100     { background-color: #2a2a2a !important; }
        .dark .border-gray-200 { border-color: #333 !important; }
        .dark .border-gray-100 { border-color: #2a2a2a !important; }
        .dark .border-gray-300 { border-color: #404040 !important; }
        .dark .shadow-md       { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.6) !important; }
        .dark .shadow-sm       { box-shadow: 0 1px 6px rgba(0,0,0,0.4) !important; }
        .dark .shadow-lg       { box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important; }
        .dark .text-gray-800   { color: #f1f1f1 !important; }
        .dark .text-gray-700   { color: #e0e0e0 !important; }
        .dark .text-gray-600   { color: #b0b3b8 !important; }
        .dark .text-gray-500   { color: #9ca3af !important; }
        .dark .text-gray-400   { color: #6b7280 !important; }
        .dark .text-gray-300   { color: #4b5563 !important; }

        .dark header                     { border-color: #2a2a2a !important; }
        .dark nav.md\\:hidden a          { color: #9ca3af !important; }
        .dark nav.md\\:hidden            { border-color: #2a2a2a !important; }
        .dark #themeToggle               { background-color: #2a2a2a !important; border-color: #404040 !important; color: #e5e7eb !important; }
        .dark #personalRoastBtn          { background-color: #1e1e1e !important; border-color: #404040 !important; color: #d1d5db !important; }
        .dark #personalRoastBtn:hover    { border-color: #7c3aed !important; color: #a78bfa !important; }
        .dark #personalRoastBtnMobile    { background-color: #1e1e1e !important; border-color: #404040 !important; }

        .dark #jokeInput                 { color: #f1f1f1 !important; background: transparent !important; }
        .dark #jokeInput::placeholder    { color: #6b7280 !important; opacity: 1 !important; }
        .dark .search-wrap > div         { background-color: #1e1e1e !important; border-color: #404040 !important; }
        .dark #micBtn                    { background-color: #2a2a2a !important; }

        .dark .chip                      { background-color: #2a2a2a !important; color: #e5e7eb !important; }
        .dark .chip span                 { color: #e5e7eb !important; }
        .dark .chip:hover                { background-color: #fde047 !important; color: #111 !important; }
        .dark .chip:hover span           { color: #111 !important; }

        .dark #jokeCard                  { background-color: #1a1a1e !important; border-color: #333 !important; }
        .dark #jokeText                  { color: #f3f4f6 !important; -webkit-text-fill-color: #f3f4f6 !important; }
        .dark #jokeText .joke-keyword    { -webkit-text-fill-color: transparent !important; }
        .dark #jokeCard p                { color: #f3f4f6 !important; }
        .dark #voteUp, .dark #voteDown   { background-color: #2a2a2a !important; border-color: #404040 !important; color: #d1d5db !important; }
        .dark #ttsBtn                    { background-color: #2a2a2a !important; border-color: #404040 !important; }
        .dark #shareJokeBtn              { background-color: #2a2a2a !important; border-color: #404040 !important; color: #d1d5db !important; }
        .dark #copyJokeBtn               { background-color: #3b2f6e !important; color: #d8b4fe !important; }

        .dark .ad-placeholder            { background: repeating-linear-gradient(45deg,#1a1a1e,#1a1a1e 10px,#222 10px,#222 20px) !important; color: #4b5563 !important; border-color: #333 !important; }

        .dark #suggestionsWrap p         { color: #6b7280 !important; }
        .dark .suggestion-card           { background-color: #1e1e1e !important; border-color: #2a2a2a !important; }
        .dark .suggestion-card p.text-gray-700 { color: #d1d5db !important; }
        .dark .suggestion-card p.text-gray-400 { color: #6b7280 !important; }
        .dark .suggestion-card .sug-arrow { color: #4b5563 !important; }

        .dark #recentList                { background-color: #1e1e1e !important; border-color: #2a2a2a !important; }
        .dark #recentList li             { border-color: #2a2a2a !important; color: #b0b3b8 !important; }
        .dark .recent-item:hover         { background-color: #2a2630 !important; color: #a78bfa !important; }
        .dark #recentList h2, .dark .text-gray-500 { color: #6b7280 !important; }

        .dark footer                          { border-color: #2a2a2a !important; }
        .dark footer h3, .dark footer h4      { color: #f1f1f1 !important; }
        .dark footer a                        { color: #9ca3af !important; }
        .dark footer a:hover                  { color: #a78bfa !important; }
        .dark footer li                       { color: #9ca3af !important; }
        .dark footer .text-gray-400           { color: #4b5563 !important; }
        .dark .footer-link-item               { color: #9ca3af !important; }
        .dark footer .border-gray-100         { border-color: #2a2a2a !important; }
        .dark footer .rounded-xl.bg-gray-100  { background-color: #2a2a2a !important; border-color: #404040 !important; color: #9ca3af !important; }
        .dark footer .rounded-xl.bg-gray-100:hover { color: #a78bfa !important; }
        .dark footer a.border-purple-400      { background-color: #1e1e1e !important; color: #c4b5fd !important; }
        .dark #backToTopFooter                { background-color: #fde047 !important; color: #111 !important; }

        .dark #ttsModalBox               { background-color: #1e1e1e !important; }
        .dark #ttsModalBox span, .dark #ttsModalBox p { color: #d1d5db !important; }
        .dark #ttsModalBox select        { background-color: #2a2a2a !important; color: #d1d5db !important; border-color: #404040 !important; }
        .dark #ttsModalClose             { background-color: #2a2a2a !important; border-color: #404040 !important; color: #9ca3af !important; }
        .dark #ttsStopBtn                { background-color: #2a2a2a !important; border-color: #404040 !important; color: #d1d5db !important; }

        /* ── Logo switching ── */
        .logo-light { display: block; }
        .logo-dark  { display: none; }
        html.dark .logo-light { display: none; }
        html.dark .logo-dark  { display: block; }

        /* ── Cat image switching ── */
        .cat-light { display: block; }
        .cat-dark  { display: none; }
        html.dark .cat-light { display: none; }
        html.dark .cat-dark  { display: block; }

        /* ══ CHIP EFFECTS ══ */
        .chip {
            cursor: pointer; position: relative; overflow: hidden;
            transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, background-color 0.25s ease, border-color 0.25s ease;
            border: 1px solid transparent; will-change: transform; -webkit-font-smoothing: antialiased;
        }
        .chip::before { content:''; position:absolute; top:0; left:-100%; width:60%; height:100%; background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,0.55) 50%,transparent 100%); transform:skewX(-20deg); transition:none; pointer-events:none; z-index:1; }
        .chip::after  { content:''; position:absolute; inset:0; border-radius:inherit; opacity:0; transition:opacity 0.3s ease; background:linear-gradient(135deg,rgba(124,58,237,0.15),rgba(245,158,11,0.15)); pointer-events:none; z-index:0; }
        .chip:hover   { transform:translateY(-4px) scale(1.06); background-color:#ffffff !important; border-color:#fde047 !important; box-shadow:0 8px 25px rgba(253,224,71,0.35),0 3px 10px rgba(0,0,0,0.08),inset 0 1px 0 rgba(255,255,255,0.9); color:#7c3aed !important; }
        .chip:hover span { color:#7c3aed !important; }
        .chip:hover::before { left:150%; transition:left 0.5s ease; }
        .chip:hover::after  { opacity:1; }
        .chip:active { transform:translateY(-1px) scale(0.97); box-shadow:0 2px 8px rgba(124,58,237,0.15),inset 0 1px 3px rgba(0,0,0,0.06); transition-duration:0.08s; }
        .chip.active-chip { background:linear-gradient(135deg,#fde047,#f59e0b) !important; border-color:#f59e0b !important; color:#1a1a1a !important; font-weight:700; transform:translateY(-2px) scale(1.03); box-shadow:0 6px 20px rgba(245,158,11,0.35),0 2px 6px rgba(0,0,0,0.1),inset 0 1px 0 rgba(255,255,255,0.5); }
        .chip.active-chip span { color:#1a1a1a !important; }
        .dark .chip:hover { background-color:#2d1f6e !important; border-color:rgba(167,139,250,0.5) !important; box-shadow:0 8px 25px rgba(124,58,237,0.35),0 3px 10px rgba(0,0,0,0.3),inset 0 1px 0 rgba(255,255,255,0.08); color:#c4b5fd !important; }
        .dark .chip:hover span { color:#c4b5fd !important; }
        .dark .chip:hover::before { background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,0.1) 50%,transparent 100%); }

        .ad-placeholder { background: repeating-linear-gradient(45deg,#f9f9f9,#f9f9f9 10px,#eeeeee 10px,#eeeeee 20px); }
        .dark .ad-placeholder { background: repeating-linear-gradient(45deg,#2a2a2a,#2a2a2a 10px,#333 10px,#333 20px); }

        .toast { position:fixed; bottom:2rem; left:50%; transform:translateX(-50%); background:#2d2d2d; color:white; padding:0.6rem 1.8rem; border-radius:999px; font-size:0.95rem; box-shadow:0 10px 25px rgba(0,0,0,0.25); z-index:400; opacity:0; transition:opacity 0.2s; pointer-events:none; }
        .toast.show { opacity:1; }
        .vote-active { color:#7c3aed; }
        .max-w-fhd { max-width:1600px; margin-left:auto; margin-right:auto; }

        /* ── Footer 5-column grid ── */
        .footer-grid {
            display: grid;
            grid-template-columns: 1.2fr 1.3fr 0.9fr 1.6fr 1.1fr;
            gap: 1.5rem;
            align-items: start;
        }
        @media (max-width: 1024px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
        @media (max-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem; } }

        #jokeText.fade-out { opacity:0; transform:translateY(6px); transition:opacity 0.2s ease,transform 0.2s ease; }
        #jokeText.fade-in  { animation:jokeIn 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards; }
        @keyframes jokeIn { from{opacity:0;transform:translateY(-10px) scale(0.97)}to{opacity:1;transform:translateY(0) scale(1)} }

        #jokeText { font-family:'Segoe UI',system-ui,-apple-system,sans-serif; font-size:1.22rem; line-height:1.75; color:#1f2937; letter-spacing:0.015em; font-weight:400; position:relative; }

        .joke-keyword { font-weight:600; background:linear-gradient(90deg,rgb(124,58,237),rgb(59,130,246),rgb(16,185,129),rgb(245,158,11)); background-size:300% auto; -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; animation:rgbShift 4s linear infinite; }
        @keyframes rgbShift { 0%{background-position:0% center}50%{background-position:150% center}100%{background-position:300% center} }

        .joke-loading { display:none; align-items:center; justify-content:center; gap:0; padding:20px 0; }
        .joke-loading.active { display:flex; flex-direction:column; gap:14px; }
        .wave-bars { display:flex; align-items:flex-end; gap:5px; height:36px; }
        .wave-bar { width:5px; border-radius:3px; background:linear-gradient(180deg,#a855f7,#7c3aed); animation:waveAnim 1s ease-in-out infinite; }
        .wave-bar:nth-child(1){animation-delay:0s;height:40%}.wave-bar:nth-child(2){animation-delay:0.1s;height:70%}.wave-bar:nth-child(3){animation-delay:0.2s;height:100%}.wave-bar:nth-child(4){animation-delay:0.3s;height:70%}.wave-bar:nth-child(5){animation-delay:0.4s;height:40%}.wave-bar:nth-child(6){animation-delay:0.5s;height:70%}.wave-bar:nth-child(7){animation-delay:0.6s;height:100%}.wave-bar:nth-child(8){animation-delay:0.7s;height:70%}.wave-bar:nth-child(9){animation-delay:0.8s;height:40%}
        @keyframes waveAnim { 0%,100%{transform:scaleY(0.3);opacity:0.4}50%{transform:scaleY(1);opacity:1} }

        .loading-text { font-size:0.78rem; font-weight:600; letter-spacing:0.12em; text-transform:uppercase; background:linear-gradient(90deg,#7c3aed,#a855f7,#f59e0b,#7c3aed); background-size:300% auto; -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; animation:gradShift 2s linear infinite; }
        @keyframes gradShift { to{background-position:300% center} }
        .dot-pulse::after { content:''; animation:dots 1.2s steps(3,end) infinite; }
        @keyframes dots { 0%{content:''}33%{content:'.'}66%{content:'..'}100%{content:'...'} }

        .reaction-float { position:absolute; font-size:1.4rem; pointer-events:none; z-index:50; animation:reactionFly 1s cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
        @keyframes reactionFly { 0%{opacity:1;transform:translateY(0) scale(0.6)}60%{opacity:1;transform:translateY(-50px) scale(1.2)}100%{opacity:0;transform:translateY(-80px) scale(0.8)} }

        .vote-count.pop { animation:countPop 0.25s ease; }
        @keyframes countPop { 0%{transform:scale(1)}50%{transform:scale(1.5)}100%{transform:scale(1)} }
        .vote-bounce i { animation:voteBounce 0.4s cubic-bezier(0.34,1.56,0.64,1); }
        @keyframes voteBounce { 0%{transform:scale(1)}40%{transform:scale(1.6) rotate(-15deg)}70%{transform:scale(0.9) rotate(5deg)}100%{transform:scale(1) rotate(0)} }
        .btn-clicked { animation:btnClick 0.35s cubic-bezier(0.34,1.56,0.64,1); }
        @keyframes btnClick { 0%{transform:scale(1)}40%{transform:scale(0.88)}70%{transform:scale(1.1)}100%{transform:scale(1)} }

        .suggestion-card { transition:all 0.2s ease; }
        .suggestion-card:hover { transform:translateY(-3px); box-shadow:0 12px 40px rgba(124,58,237,0.15); border-color:rgba(124,58,237,0.25) !important; }
        .suggestion-card:hover .sug-arrow { transform:translateX(3px); color:#7c3aed; }
        .sug-icon { transition:all 0.2s ease; }
        .suggestion-card:hover .sug-icon { transform:scale(1.1) rotate(-5deg); }

        .skeleton { background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size:200% 100%; animation:shimmer 1.4s ease infinite; border-radius:6px; }
        .dark .skeleton { background:linear-gradient(90deg,#2a2a2a 25%,#333 50%,#2a2a2a 75%); background-size:200% 100%; }
        @keyframes shimmer { 0%{background-position:200% 0}100%{background-position:-200% 0} }

        .recent-item { transition:background 0.15s ease; }
        .recent-item:hover { background-color:#f5f3ff; color:#7c3aed; }
        .dark .recent-item:hover { background-color:#2a2630; }

        #confettiCanvas { position:fixed; inset:0; pointer-events:none; z-index:300; }
        #flashOverlay { position:fixed; inset:0; pointer-events:none; z-index:500; opacity:0; background:radial-gradient(ellipse at center,rgba(124,58,237,0.2) 0%,transparent 70%); transition:opacity 0.15s ease; }
        #flashOverlay.flash { animation:gradFlash 0.6s ease forwards; }
        @keyframes gradFlash { 0%{opacity:0}25%{opacity:1}100%{opacity:0} }

        .search-glow { position:absolute; inset:-2px; border-radius:999px; background:linear-gradient(135deg,#7c3aed,#f59e0b); opacity:0; filter:blur(8px); transition:opacity 0.3s ease; pointer-events:none; z-index:0; }
        .search-wrap:focus-within .search-glow { opacity:0.3; }

        #micBtn.listening { background-color:#ef4444 !important; color:white !important; animation:pulseMic 1s ease-in-out infinite; }
        @keyframes pulseMic { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0.4)}50%{box-shadow:0 0 0 8px rgba(239,68,68,0)} }

        .typed-cursor { display:inline-block; width:2px; height:0.85em; background:#7c3aed; margin-left:2px; vertical-align:middle; border-radius:1px; animation:cursorBlink 0.75s step-end infinite; }
        @keyframes cursorBlink { 0%,100%{opacity:1}50%{opacity:0} }

        #ttsModal { display:none; position:fixed; inset:0; z-index:600; background:rgba(0,0,0,0.5); backdrop-filter:blur(6px); align-items:flex-end; justify-content:center; }
        #ttsModal.open { display:flex; }
        @media (min-width:768px) { #ttsModal{align-items:center} #ttsModalBox{border-radius:24px !important;max-width:480px;margin:0 auto} }
        #ttsModalBox { animation:slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1); }
        @keyframes slideUp { from{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1} }
        #ttsBars { display:flex; align-items:flex-end; justify-content:center; gap:4px; height:44px; margin-bottom:14px; }
        #ttsBars .tts-bar { width:10px; border-radius:5px; background:linear-gradient(180deg,#a855f7,#7c3aed); transform-origin:bottom; animation:barBounce 0.5s ease-in-out infinite alternate; }
        #ttsBars.paused .tts-bar { animation-play-state:paused; }
        @keyframes barBounce { from{transform:scaleY(0.3);opacity:0.5}to{transform:scaleY(1);opacity:1} }

        #menuDrawer { transition:left 0.3s cubic-bezier(0.4,0,0.2,1); }

        .footer-link-item { position:relative; display:inline-block; transition:color 0.2s ease; }
        .footer-link-item::after { content:''; position:absolute; bottom:-1px; left:0; width:0; height:1.5px; background:linear-gradient(90deg,#7c3aed,#f59e0b); border-radius:1px; transition:width 0.25s ease; }
        .footer-link-item:hover { color:#7c3aed !important; }
        .footer-link-item:hover::after { width:100%; }

        /* ================================================================
           MOBILE ONLY
           ================================================================ */
        @media (max-width: 640px) {
            html, body { overflow-x:hidden; max-width:100%; }
            .max-w-fhd { padding-left:16px !important; padding-right:16px !important; }
            header { padding-top:14px; padding-bottom:14px; }
            h1 { font-size:2.8rem !important; text-align:center; }
            .min-h-6 { justify-content:center; text-align:center; }
            .search-wrap { margin-top:20px; }
            #jokeInput { font-size:0.95rem !important; padding-top:14px !important; padding-bottom:14px !important; }
            #chipContainer { max-width:100% !important; width:100% !important; margin-left:0 !important; margin-right:0 !important; overflow:visible !important; }
            .chips-mobile { display:flex !important; flex-wrap:nowrap !important; overflow-x:auto !important; overflow-y:hidden !important; -webkit-overflow-scrolling:touch !important; margin-left:-16px !important; margin-right:-16px !important; padding-left:16px !important; padding-right:16px !important; width:calc(100% + 32px) !important; }
            .chips-mobile::-webkit-scrollbar { display:none; }
            .chips-mobile .chip { flex-shrink:0 !important; white-space:nowrap !important; }
            #jokeCard { padding:18px 16px !important; border-radius:20px !important; }
            #jokeText { font-size:1rem !important; line-height:1.65 !important; }
            #jokeCard > div.flex.items-center.justify-between { flex-wrap:wrap; gap:10px; }
            .ad-placeholder { height:60px !important; font-size:0.75rem !important; border-radius:12px; }
            #recentList li span { font-size:0.8rem; }

            footer { margin-top:40px !important; padding-left:0 !important; padding-right:0 !important; overflow-x:hidden; text-align:center !important; }
            .footer-grid { grid-template-columns:1fr 1fr !important; gap:20px 12px !important; width:100% !important; padding:0 !important; justify-items:center !important; }
            .footer-grid > div { min-width:0; overflow:hidden; word-break:break-word; text-align:center !important; width:100%; }
            .footer-grid ul { text-align:center !important; padding-left:0 !important; list-style:none !important; }
            .footer-grid ul li { margin-bottom:4px; text-align:center !important; }
            .footer-grid h3, .footer-grid h4 { font-size:0.78rem !important; margin-bottom:8px !important; text-align:center !important; }
            .footer-grid a, .footer-grid .footer-link-item { font-size:0.72rem !important; }
            .footer-grid ul.space-y-1 li { font-size:0.68rem !important; }
            .footer-col-follow { grid-column:1 / -1 !important; text-align:center !important; }
            .footer-col-follow .flex.flex-nowrap { flex-wrap:wrap !important; justify-content:center !important; gap:8px !important; max-width:100% !important; }
            .footer-col-follow .flex.flex-nowrap a { width:36px !important; height:36px !important; font-size:0.9rem !important; flex-shrink:0 !important; }
            .footer-col-follow a.inline-block { font-size:0.72rem !important; padding:8px 12px !important; display:inline-block !important; }
            .footer-col-follow p { text-align:center !important; }
            .footer-cat-col { grid-column:1 / -1 !important; text-align:center !important; justify-content:center !important; }
            #backToTopFooter { padding:10px 16px !important; font-size:0.75rem !important; margin-top:12px !important; }
            footer > div.flex.flex-wrap { flex-direction:column !important; align-items:center !important; text-align:center !important; gap:6px !important; }
            footer > div.flex.flex-wrap > div { font-size:0.68rem !important; text-align:center !important; width:100% !important; }
        }
        @media (max-width: 380px) {
            h1 { font-size:2.2rem !important; }
            #jokeText { font-size:0.92rem !important; }
            .footer-grid { grid-template-columns:1fr 1fr !important; gap:16px 12px !important; }
        }
        
        /* ============================================================
   MOBILE MEDIA QUERIES — Header, Navigation & Footer Fix
   ============================================================ */

/* ── Small mobile (< 480px) ── */
@media (max-width: 480px) {

  /* HEADER */
  header {
    padding: 10px 14px !important;
    gap: 8px !important;
  }
  header .flex.items-center.gap-4 {
    gap: 8px !important;
  }
  #personalRoastBtn {
    display: none !important;
  }
  #personalRoastBtnMobile {
    display: flex !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 0.85rem !important;
  }
  #themeToggle {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.95rem !important;
  }
  header a.bg-yellow-400 {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
    border-radius: 999px !important;
  }
  header a.bg-yellow-400 .md\:inline {
    display: none !important;
  }

  /* MOBILE MENU DRAWER */
  #menuDrawer {
    width: 240px !important;
  }
  #menuDrawer a {
    font-size: 0.78rem !important;
    padding: 8px 8px !important;
  }

  /* FOOTER */
  footer {
    padding: 24px 14px 16px !important;
    margin-top: 32px !important;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px 10px !important;
  }
  .footer-grid h3,
  .footer-grid h4 {
    font-size: 0.72rem !important;
    margin-bottom: 8px !important;
    text-align: center !important;
  }
  .footer-grid ul li a,
  .footer-grid ul li,
  .footer-link-item {
    font-size: 0.68rem !important;
  }
  .footer-col-follow {
    grid-column: 1 / -1 !important;
    text-align: center !important;
    align-items: center !important;
  }
  .footer-col-follow .flex.flex-nowrap {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  .footer-col-follow .flex.flex-nowrap a {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.85rem !important;
  }
  .footer-col-follow a.inline-block {
    font-size: 0.7rem !important;
    padding: 8px 14px !important;
  }
  .footer-cat-col {
    grid-column: 1 / -1 !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .footer-cat-col img {
    width: 120px !important;
  }
  footer > div.flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    text-align: center !important;
  }
  #backToTopFooter {
    padding: 9px 18px !important;
    font-size: 0.72rem !important;
  }
}

/* ── Medium mobile (481px – 640px) ── */
@media (min-width: 481px) and (max-width: 640px) {

  /* HEADER */
  header {
    padding: 12px 16px !important;
  }
  #personalRoastBtn {
    display: none !important;
  }
  #personalRoastBtnMobile {
    display: flex !important;
  }

  /* FOOTER */
  footer {
    padding: 28px 16px 20px !important;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px 14px !important;
  }
  .footer-col-follow {
    grid-column: 1 / -1 !important;
    text-align: center !important;
  }
  .footer-col-follow .flex.flex-nowrap {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  .footer-cat-col {
    grid-column: 1 / -1 !important;
    justify-content: center !important;
  }
  .footer-cat-col img {
    width: 140px !important;
  }
  footer > div.flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    text-align: center !important;
  }
}

/* ── Tablet (641px – 768px) ── */
@media (min-width: 641px) and (max-width: 768px) {

  /* HEADER */
  #personalRoastBtn {
    display: none !important;
  }
  #personalRoastBtnMobile {
    display: flex !important;
  }

  /* FOOTER */
  .footer-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px 16px !important;
  }
  .footer-col-follow {
    grid-column: 1 / -1 !important;
    text-align: center !important;
  }
  .footer-col-follow .flex.flex-nowrap {
    justify-content: center !important;
  }
  .footer-cat-col {
    grid-column: 1 / -1 !important;
    justify-content: center !important;
    align-items: center !important;
  }
}

/* ── Large tablet / small desktop (769px – 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {

  /* HEADER */
  #personalRoastBtn span br {
    display: none !important;
  }
  #personalRoastBtn {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
  }

  /* FOOTER */
  .footer-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px 20px !important;
  }
  .footer-cat-col {
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
  }
  .footer-cat-col img {
    width: 150px !important;
  }
}

/* ── MOBILE ONLY: Header + Menu fixes ── */
@media (max-width: 768px) {

  /* Header compact */
  header {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  /* Logo chhota */
  header a img {
    height: 22px !important;
  }

  /* Hamburger button chhota */
  header > div:first-child button {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    font-size: 0.7rem !important;
  }

  /* Theme toggle chhota */
  #themeToggle {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    font-size: 0.7rem !important;
  }

  /* Roast mobile button chhota */
  #personalRoastBtnMobile {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.7rem !important;
  }

  /* Tip button chhota */
  header a.bg-yellow-400 {
    padding: 5px 10px !important;
    font-size: 0.7rem !important;
    gap: 4px !important;
  }

  /* Right side gap kam */
  header > div:last-child {
    gap: 6px !important;
  }

  /* ── Mobile Menu Drawer — Modern ── */
  #menuDrawer {
    width: 240px !important;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(124,58,237,0.1) !important;
    box-shadow: 8px 0 32px rgba(0,0,0,0.1) !important;
  }

  /* Drawer header */
  #menuDrawer > div:first-child {
    padding: 14px 12px 10px !important;
    border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  }

  /* Drawer header title */
  #menuDrawer > div:first-child span {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
  }

  /* Close button */
  #menuDrawer > div:first-child button {
    width: 26px !important;
    height: 26px !important;
    border-radius: 7px !important;
    font-size: 0.65rem !important;
  }

  /* All menu links */
  #menuDrawer a {
    padding: 7px 10px !important;
    font-size: 0.76rem !important;
    border-radius: 9px !important;
    margin-bottom: 1px !important;
  }

  /* Menu links — icon colored badge style */
  #menuDrawer a i {
    width: 20px !important;
    height: 20px !important;
    border-radius: 6px !important;
    background: rgba(124,58,237,0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.6rem !important;
    flex-shrink: 0 !important;
  }

  /* Section labels */
  #menuDrawer p {
    font-size: 0.55rem !important;
    padding: 6px 10px 4px !important;
    letter-spacing: 0.1em !important;
  }

  /* Divider line gradient */
  #menuDrawer > div:nth-child(2) > div[style*="height:1px"] {
    background: linear-gradient(90deg, transparent, rgba(124,58,237,0.15), transparent) !important;
    margin: 8px 6px !important;
  }

  /* Drawer inner padding */
  #menuDrawer > div:nth-child(2) {
    padding: 8px 6px !important;
  }
}

/* ── Extra small phones ── */
@media (max-width: 380px) {
  header a img {
    height: 18px !important;
  }
  #menuDrawer {
    width: 220px !important;
  }
  header a.bg-yellow-400 span {
    display: none !important;
  }
  header a.bg-yellow-400 {
    padding: 5px 8px !important;
  }
}