        :root {
            --bg-primary: #f8fafc;
            --bg-surface: #ffffff;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --accent: #2563eb;
            --accent-light: rgba(37, 99, 235, 0.08);
            --border-color: #e2e8f0;
            --radius: 12px;
            --card-transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
            --global-transition: background-color 0.3s ease, color 0.3s ease;
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            --logo-grad: linear-gradient(135deg, #2563eb, #3b82f6);
        }

        body.dark-theme {
            --bg-primary: #0b0f19;
            --bg-surface: #131b2e;
            --text-main: #f1f5f9;
            --text-muted: #cbd5e1;
            --border-color: #1e293b;
            --accent-light: rgba(59, 130, 246, 0.15);
            --accent: #3b82f6;
            --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
            --logo-grad: linear-gradient(135deg, #3b82f6, #60a5fa);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        @media (prefers-reduced-motion: reduce) {
            * {
                animation-delay: 0s !important;
                animation-duration: 0s !important;
                transition-duration: 0s !important;
                transform: none !important;
            }
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-main);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            transition: var(--global-transition);
        }

        header {
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-color);
            padding: 0.75rem 1.5rem;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: var(--shadow-sm);
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .header-container {
            max-width: 1440px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo-brand {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            text-decoration: none;
            transition: transform 0.2s ease;
        }
        .logo-brand:hover { transform: scale(1.02); }

        .logo-icon-box {
            width: 32px;
            height: 32px;
            background: var(--logo-grad);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-size: 0.95rem;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
        }
        body.dark-theme .logo-icon-box { box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2); }

        .logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-main); display: flex; align-items: center; }
        .logo-text span { font-weight: 400; color: var(--text-muted); margin-left: 0.1rem; }
        .logo-dot { color: var(--accent); margin-left: 0.05rem; }

        .theme-toggle-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            padding: 0.4rem 0.6rem;
            border-radius: 8px;
            cursor: pointer;
            color: var(--text-main);
            transition: var(--global-transition);
        }

        .theme-toggle-btn:focus-visible,
        .category-btn:focus-visible,
        .clear-search-btn:focus-visible,
        .reset-search-btn:focus-visible,
        .clear-filters-btn:focus-visible,
        .clear-section-btn:focus-visible,
        .primary-action-btn:focus-visible,
        .preview-box:focus-visible,
        .modal-close:focus-visible,
        .checkbox-container input:focus-visible + .checkmark {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .tool-card:focus-visible {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-light);
            transform: translateY(-3px);
        }

        .hero {
            background: var(--bg-surface);
            border-bottom: 1px solid var(--border-color);
            padding: 3rem 1.5rem;
            text-align: center;
            transition: padding 0.25s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease, border-color 0.2s ease;
        }
        .hero.searching { padding: 1.5rem 1.5rem; }

        .hero-content { max-width: 640px; margin: 0 auto; }
        .hero h1 {
            font-size: 2.2rem; margin-bottom: 0.5rem; letter-spacing: -0.04em; font-weight: 800;
            transition: font-size 0.25s cubic-bezier(0.25, 1, 0.5, 1), margin 0.25s cubic-bezier(0.25, 1, 0.5, 1);
        }
        .hero.searching h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }

        .hero p {
            color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.05rem;
            transition: opacity 0.2s ease, max-height 0.25s cubic-bezier(0.25, 1, 0.5, 1), margin 0.25s cubic-bezier(0.25, 1, 0.5, 1);
            max-height: 50px; opacity: 1;
        }
        .hero.searching p { opacity: 0; max-height: 0; margin-bottom: 0.5rem; pointer-events: none; overflow: hidden; }

        .search-wrapper { 
            position: relative; 
            width: 100%; 
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .search-wrapper i.fa-magnifying-glass {
            position: absolute; 
            left: 1.15rem; 
            color: var(--text-muted); 
            font-size: 1.05rem;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            top: 0;
            transform: none;
        }

        .search-input {
            width: 100%; 
            padding: 0.85rem 2.75rem 0.85rem 2.75rem; 
            font-size: 1.05rem;
            line-height: 1.2;
            border: 1px solid var(--border-color); 
            border-radius: var(--radius); 
            outline: none;
            transition: var(--card-transition); 
            background: var(--bg-primary); 
            color: var(--text-main);
            display: block;
        }
        .search-input:focus { border-color: var(--accent); background: var(--bg-surface); box-shadow: 0 0 0 3px var(--accent-light); }

        .clear-search-btn {
            position: absolute; 
            right: 0.85rem; 
            top: 0;
            height: 100%;
            background: transparent; 
            border: none; 
            color: var(--text-muted); 
            font-size: 1.1rem;
            cursor: pointer; 
            display: none; 
            padding: 0 0.4rem; 
            transition: color 0.15s ease;
            align-items: center;
            justify-content: center;
        }
        .clear-search-btn:hover { color: var(--text-main); }

        .search-feedback {
            font-size: 0.85rem; margin-top: 0.5rem; font-weight: 600; color: var(--accent);
            display: none; animation: fadeIn 0.2s ease-out; align-items: center; justify-content: center; gap: 0.35rem;
        }
        .search-feedback i.fa-arrow-down { animation: bounce 1s infinite; }

        .skeleton-wrapper {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.25rem;
            width: 100%;
        }
        .skeleton-card {
            background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; height: 145px; position: relative; overflow: hidden;
        }
        .skeleton-card::after {
            content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: translateX(-100%); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%); animation: shimmerEffect 1.5s infinite;
        }
        body.dark-theme .skeleton-card::after { background: linear-gradient(90deg, rgba(19,27,46,0) 0%, rgba(19,27,46,0.5) 50%, rgba(19,27,46,0) 100%); }
        .skeleton-circle { width: 38px; height: 38px; background: var(--border-color); border-radius: 10px; }
        .skeleton-line { background: var(--border-color); border-radius: 4px; }
        .skeleton-line-title { width: 55%; height: 16px; }
        .skeleton-line-desc { width: 85%; height: 12px; }
        @keyframes shimmerEffect { 100% { transform: translateX(100%); } }

        .no-results-container {
            display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; background: var(--bg-surface); border: 1px dashed var(--border-color); border-radius: var(--radius); margin-top: 1rem; animation: fadeIn 0.25s ease-out;
        }
        .no-results-icon { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 1rem; opacity: 0.7; }
        .no-results-container h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
        .no-results-container p { font-size: 0.9rem; color: var(--text-muted); max-width: 320px; margin-bottom: 1.25rem; }
        
        .no-results-actions { display: flex; gap: 0.5rem; justify-content: center; }
        .reset-search-btn { background: var(--accent-light); color: var(--accent); border: none; padding: 0.5rem 1.25rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s ease; }
        .reset-search-btn:hover { background: var(--accent); color: white; }
        .clear-filters-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); padding: 0.5rem 1.25rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s ease; }
        .clear-filters-btn:hover { background: var(--bg-primary); }

        @keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

        .layout { max-width: 1440px; width: 100%; margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: 260px 1fr; gap: 2rem; flex: 1; }

        aside { position: sticky; top: 75px; height: calc(100vh - 100px); overflow-y: auto; padding-top: 1.5rem; }

        .category-list { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }

        .category-btn {
            width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border: none; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); transition: all 0.2s ease;
        }
        .category-btn div { display: flex; align-items: center; gap: 0.65rem; }
        .category-btn i { width: 16px; font-size: 1.05rem; }
        .category-btn:hover { background-color: var(--bg-surface); color: var(--text-main); }
        .category-btn.active { background-color: var(--accent-light); color: var(--accent); }

        .count { font-size: 0.75rem; background: var(--border-color); color: var(--text-muted); padding: 2px 8px; border-radius: 20px; font-weight: 700; }
        .category-btn.active .count { background: var(--accent); color: white; }

        .main-content { padding-top: 1.5rem; padding-bottom: 3rem; }
        
        .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
        .toolbar h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
        .sort-select { padding: 0.45rem 0.85rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); font-size: 0.85rem; color: var(--text-main); outline: none; cursor: pointer; font-weight: 500; }

        .dashboard-section { margin-bottom: 2.5rem; display: none;}
        .dashboard-section.visible { display: block; }
        
        .dashboard-section h4 {
            font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; width: 100%;
        }
        .dashboard-section h4 span { display: flex; align-items: center; gap: 0.4rem; }

        .clear-section-btn {
            background: transparent; border: none; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; font-weight: 600; padding: 2px 6px; border-radius: 4px; transition: all 0.15s ease; text-transform: none; letter-spacing: normal;
        }
        .clear-section-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }

        .tools-container { 
            display: grid; 
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
            gap: 1.25rem; 
        }

        .tool-card {
text-decoration: none;
    color: inherit;
    display: block;
            background: var(--bg-surface); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); border-radius: var(--radius); padding: 1.25rem; color: inherit; display: flex; flex-direction: column; gap: 0.75rem; position: relative; cursor: pointer; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
        }
        .tool-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }

        .tool-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 0.75rem; height: 100%; width: 100%; }

        .tool-icon { width: 42px; height: 42px; background: var(--accent-light); color: var(--accent); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

        .tool-info h3 { font-size: 1.1rem; margin-bottom: 0.25rem; font-weight: 700; letter-spacing: -0.01em; }
        .tool-info p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.4; }
        
        .status-pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; background: var(--bg-primary); border: 1px solid var(--border-color); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); width: fit-content; margin-top: auto; font-weight: 500; }
        .pulse-dot { width: 5px; height: 5px; background-color: #10b981; border-radius: 50%; }
        .tool-badge { position: absolute; top: 1.25rem; right: 2.75rem; font-size: 0.65rem; background: var(--accent); color: white; padding: 1px 6px; border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }

        .fav-btn {
            position: absolute; top: 1.25rem; right: 1.25rem; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.05rem; z-index: 2; padding: 12px; margin: -8px; border-radius: 4px;
        }
        .fav-btn.is-fav { color: #eab308; }
        .fav-btn:focus-visible { outline: 2px solid var(--accent); }

        .modal-overlay {
            position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, 0.3); backdrop-filter: blur(4px); z-index: 1000; display: flex; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
        }
        .modal-overlay:hover { cursor: pointer; }
        .modal-overlay.open { opacity: 1; pointer-events: auto; }

        .modal-drawer {
            width: 100%; max-width: 480px; background: var(--bg-surface); height: 100%; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; padding: 2rem; cursor: default;
        }
        .modal-overlay.open .modal-drawer { transform: translateX(0); }

        .modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1.5rem; }
        .modal-close { background: transparent; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; }

        .modal-body { flex: 1; overflow-y: auto; }
        
        .preview-box {
            font-family: monospace; background: #0f172a; color: #38bdf8; padding: 1.2rem 2.5rem 1.2rem 1rem; border-radius: 8px; font-size: 1.1rem; word-break: break-all; margin-bottom: 1rem; position: relative; cursor: pointer; border: 1px solid transparent; transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
        }
        .preview-box:hover { border-color: #38bdf8; background: #141e33; }
        .preview-box .copy-hint-icon { position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%); font-size: 0.85rem; color: #64748b; transition: color 0.15s ease; }
        .preview-box:hover .copy-hint-icon { color: #38bdf8; }

        .preview-box.copied-success { border-color: #10b981 !important; color: #10b981 !important; background: rgba(16, 185, 129, 0.05) !important; }
        .preview-box.copied-success .copy-hint-icon { color: #10b981 !important; }

        .range-wrapper { position: relative; width: 100%; margin-top: 1.5rem; margin-bottom: 1rem; }
        .slider-balloon {
            position: absolute; top: -28px; left: 0; transform: translateX(-50%); background: var(--accent); color: white; padding: 2px 6px; font-size: 0.75rem; font-weight: 700; border-radius: 4px; pointer-events: none; transition: left 0.05s ease-out;
        }
        .slider-balloon::after {
            content: ""; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); border-width: 4px 4px 0; border-style: solid; border-color: var(--accent) transparent transparent;
        }

        .form-group { margin-bottom: 1rem; }
        .form-group label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text-muted); }
        
        .primary-action-btn { width: 100%; padding: 0.75rem; background: var(--accent); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }

        /* Custom Toggle Framework for low cognitive-load setup mechanics */
        .options-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
            margin-bottom: 1.25rem;
        }

        .checkbox-container {
            display: flex;
            align-items: center;
            position: relative;
            padding-left: 30px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            user-select: none;
            color: var(--text-main);
            min-height: 22px;
        }

        .checkbox-container input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
            height: 0;
            width: 0;
        }

        .checkmark {
            position: absolute;
            top: 0;
            left: 0;
            height: 20px;
            width: 20px;
            background-color: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            transition: all 0.15s ease;
        }

        .checkbox-container:hover input ~ .checkmark {
            border-color: var(--accent);
        }

        .checkbox-container input:checked ~ .checkmark {
            background-color: var(--accent);
            border-color: var(--accent);
        }

        .checkmark:after {
            content: "";
            position: absolute;
            display: none;
        }

        .checkbox-container input:checked ~ .checkmark:after {
            display: block;
        }

        .checkbox-container .checkmark:after {
            left: 6px;
            top: 2px;
            width: 5px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

        .toast {
            position: fixed; bottom: 1.5rem; right: 1.5rem; background: #0f172a; color: white; padding: 0.75rem 1.2rem; border-radius: 8px; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; transform: translateY(150%); transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease; z-index: 2000; opacity: 0; visibility: hidden;
        }
        .toast.show { transform: translateY(0); opacity: 1; visibility: visible; }

        /* Responsive Layout Overrides */
        @media (max-width: 900px) {
            header { padding: 0.5rem 1rem; }
            .hero { padding: 1.5rem 1rem; }
            .hero.searching { padding: 0.75rem 1rem; }
            
            .layout { grid-template-columns: 1fr; gap: 0.5rem; padding: 0 0.75rem; }
            
            aside { 
                position: sticky; top: 48px; height: auto; padding: 0.6rem 0; margin: 0 -0.75rem; border-bottom: 1px solid var(--border-color); background: var(--bg-surface); z-index: 90; overflow-x: auto;
            }
            
            aside::after {
                content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 30px; background: linear-gradient(to right, rgba(255,255,255,0), var(--bg-surface)); pointer-events: none; z-index: 95;
            }
            body.dark-theme aside::after { background: linear-gradient(to right, rgba(19,27,46,0), var(--bg-surface)); }

            .category-list { 
              display: flex; 
    flex-direction: row; 
    gap: 0.5rem; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    padding: 0 0.75rem 0.25rem 0.75rem; /* Balanced horizontal padding */
    width: 100%;
            }
            .category-list::-webkit-scrollbar { display: none; }
            .category-list li { display: inline-flex; flex-shrink: 0; }
            
            .category-btn { 
                padding: 0.45rem 0.9rem; font-size: 0.85rem; white-space: nowrap; border-radius: 20px; border: 1px solid var(--border-color); background: var(--bg-primary); display: inline-flex; align-items: center; padding-top: 8px; padding-bottom: 8px;
            }
            .category-btn.active { border-color: transparent; }
            .category-btn div { gap: 0.4rem; }
            .count { display: none; }
            
            .main-content { padding-top: 0.75rem; }
            .toolbar { margin-bottom: 0.75rem; }
            .toolbar h2 { font-size: 1rem; }
            
            .tools-container, .skeleton-wrapper { grid-template-columns: 1fr; gap: 0.5rem; }
            
            .tool-card { flex-direction: row; align-items: center; padding: 0.75rem; gap: 0.75rem; }
            .tool-card-link { flex-direction: row; align-items: center; gap: 0.75rem; }

            .tool-icon { width: 34px; height: 34px; font-size: 0.95rem; flex-shrink: 0; }
            
            .tool-info p { 
                display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.75rem; margin-top: 0.1rem;
            } 
            .tool-info h3 { font-size: 0.95rem; margin-bottom: 0; }
            .status-pill { display: none; }
            .tool-badge { display: none; }
            .fav-btn { position: relative; top: auto; right: auto; margin-left: auto; order: 3; padding: 12px; margin: 0; }
        }
