     /* Battery Icon Styles */
     .battery-icon {
        stroke-width: 1;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke: rgba(0, 0, 0, 0.3);
    }

    .battery-fill {
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #llm-battery {
        z-index: 999;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.375rem 0.75rem;
        background-color: #f3f4f6;
        border-radius: 9999px;
        font-size: 0.875rem;
        color: #4b5563;
    }

    #llm-battery:hover {
        background-color: rgba(255, 255, 255, 0.95);
    }

    #llm-battery.charging .battery-fill {
        animation: chargingPulse 2s infinite;
    }

    @keyframes chargingPulse {
        0% { opacity: 0.8; }
        50% { opacity: 1; }
        100% { opacity: 0.8; }
    }

    /* Retail Rocket Inspired Styles - Compact Version */
    body {
      font-family: 'Inter', sans-serif;
      background-color: #f8f9fa;
      color: #212529;
      font-size: 0.9rem;
    }
    /* Header Styles */
    header {
        background-color: #ffffff;
        border-bottom: 1px solid #dee2e6;
        padding: 0.75rem 1.5rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .logo-svg {
        height: 28px;
        width: auto;
        fill: #01284D;
    }
    .logo-svg .path-blue {
         fill: #16AADB;
    }
    nav.header-links a {
        color: #0d6efd;
        text-decoration: none;
        margin-left: 0.8rem;
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
    }
    nav.header-links a:hover {
        text-decoration: underline;
    }

    /* Main Content Styles */
    .main-title {
        color: #1a2b4d;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    .subtitle {
        color: #6c757d;
        font-size: 0.9rem;
    }

    /* Page Filter Styles */
    .page-filters {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 1.5rem; /* Margin below page filters (before grid) */
        margin-top: 1.5rem; /* Margin above page filters (after descriptions) */
        gap: 0.5rem;
        background-color: #f8f9fa; /* Retain background for consistency */
        padding: 1rem 0;           /* Retain padding for consistency */
        /* position: sticky; and related styling moved to the media query below */
    }

    @media (min-width: 1024px) {
        .page-filters {
            position: sticky;
            top: 0;
            z-index: 100;
            /* border-bottom and box-shadow are applied only when sticky */
            border-bottom: 1px solid #dee2e6;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
    }
    .page-filter-btn {
        background-color: #ffffff;
        color: #495057;
        padding: 0.3rem 0.7rem;
        border-radius: 9999px;
        border: 1px solid #ced4da;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.75rem;
        font-weight: 500;
    }
    .page-filter-btn:hover {
        background-color: #f1f3f5;
        border-color: #adb5bd;
    }
    .page-filter-btn.active {
        background-color: #e7f5ff;
        color: #0d6efd;
        border-color: #a5d8ff;
    }
    .page-filter-btn.highlighted {
        background-color: #fff3bf !important;
        border-color: #ffe066 !important;
        color: #a08500 !important;
    }
    .page-filter-btn.active.highlighted {
        background-color: #fff3bf !important;
        border-color: #ffe066 !important;
        color: #a08500 !important;
    }

    /* Classification Button Styles */
    .classification-controls {
         margin-bottom: 1rem;
    }
    .classification-btn {
        background-color: #e9ecef;
        color: #495057;
        padding: 0.4rem 0.8rem;
        border-radius: 0.375rem;
        border: 1px solid #ced4da;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.8rem;
        margin: 0.2rem 0.2rem;
    }
    .classification-btn:hover {
        background-color: #dee2e6;
    }
    .classification-btn.active {
        background-color: #0d6efd;
        color: #ffffff;
        border-color: #0d6efd;
    }
    .classification-btn.inactive {
        background-color: #e9ecef;
        color: #495057;
        border-color: #ced4da;
    }

    /* Card Styles */
    .category-card {
        background-color: #ffffff;
        border-radius: 0.5rem;
        border: 1px solid #e0e0e0;
        padding: 1rem;
        transition: all 0.3s ease-in-out;
        display: flex; /* Flex container */
        flex-direction: column; /* Column direction allows vertical stacking */
        /* No fixed height or min-height, card grows with content */
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .category-card:hover {
        border-color: #adb5bd;
        box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    }
    .category-card.filtered-out {
        opacity: 0.3;
        pointer-events: none;
    }
    .category-card h2 {
         color: #1a2b4d;
         font-size: 1.1rem;
         margin-bottom: 0.5rem;
    }
    .category-card p.text-sm {
         color: #495057;
         font-size: 0.85rem;
         margin-bottom: 0.75rem;
    }

    /* Details/Summary Styles */
    details {
        background-color: #f8f9fa;
        border-radius: 0.375rem;
        margin-bottom: 0.4rem;
        border: 1px solid #dee2e6;
        /* Height determined by content */
    }
    details.filtered-out {
         display: none;
    }
    summary {
        padding: 0.5rem 0.75rem;
        padding-right: 32px; /* Compact spacing for score circle */
        font-weight: 500;
        color: #343a40;
        cursor: pointer;
        list-style: none; /* Ensure no default marker */
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color 0.2s ease;
        font-size: 0.85rem;
        position: relative; /* Needed for pseudo-element positioning */
        position: relative; /* For absolute positioning of score circle */
    }
    summary:hover {
        background-color: #e9ecef;
    }
    summary::before { /* Custom triangle marker */
        content: '▼';
        font-size: 0.7em;
        transition: transform 0.3s ease;
        margin-right: 0.4rem;
        color: #6c757d;
        display: inline-block;
        flex-shrink: 0;
    }
    details[open] summary::before {
        transform: rotate(180deg);
    }
    .details-content {
        padding: 0.5rem 0.75rem 0.75rem 0.75rem;
        color: #495057;
        font-size: 0.8rem;
        border-top: 1px solid #dee2e6;
        /* Height determined by content */
    }
    .summary-desc {
        font-style: italic;
        color: #6c757d;
        margin-bottom: 0.5rem;
        border-left: 2px solid #0d6efd;
        padding-left: 0.5rem;
        font-size: 0.8rem;
    }
    .details-content ul {
        list-style-type: '- ';
        padding-left: 0.8rem;
        margin-top: 0.4rem;
    }
    .details-content code {
        background-color: #e9ecef;
        color: #c92a2a;
        padding: 0.1em 0.3em;
        border-radius: 0.2rem;
        font-size: 0.8em;
        font-family: monospace;
        word-break: break-all;
        border: 1px solid #dee2e6;
    }
    .call-details {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px dashed #ced4da;
        font-size: 0.75rem;
    }
    .call-details strong {
        color: #343a40;
    }
    .vp-button, .doc-button {
        background-color: #16AADB; /* Retail Rocket blue */
        color: white;
        padding: 0.4rem 0.8rem;
        border-radius: 0.25rem;
        font-size: 0.75rem;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-top: 0.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 120px;
        text-align: center;
    }
    .vp-button:hover {
        background-color: #01284D; /* Darker blue on hover */
        transform: translateY(-1px);
    }
    .doc-button {
        background-color: #0d6efd;
        margin-left: 0.75rem;
    }
    .doc-button:hover {
        background-color: #0b5ed7;
        transform: translateY(-1px);
    }
    .doc-button:disabled {
        background-color: #6c757d;
        cursor: not-allowed;
        opacity: 0.65;
        transform: none;
    }
    .vp-button:disabled {
        background-color: #6c757d;
        cursor: not-allowed;
        opacity: 0.65;
        transform: none;
    }

    /* Footer Styles */
    footer {
        background-color: #e9ecef;
        color: #6c757d;
        padding: 1rem;
        text-align: center;
        font-size: 0.8rem;
        margin-top: 1.5rem;
        border-top: 1px solid #dee2e6;
    }
    .footer-credits {
         font-size: 0.7rem;
         margin-top: 0.4rem;
    }

    .hidden {
        display: none;
    }
    .grid {
         /* No grid-auto-rows, allowing rows to size to content */
        gap: 1rem;
    }

     /* Pop-up Styles */
     .popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1250; /* Increased from 1150 */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    .popup-content {
        background-color: white;
        padding: 2rem;
        border-radius: 0.5rem;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        width: 90%;
        max-width: 600px;
        max-height: 80vh;
        overflow-y: auto;
        position: relative;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }
    .popup-close-btn {
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        font-weight: bold;
        color: #6c757d;
        cursor: pointer;
        line-height: 1;
        padding: 0.25rem;
        border-radius: 0.25rem;
        transition: all 0.2s ease;
    }
    .popup-close-btn:hover {
        color: #343a40;
        background-color: #f8f9fa;
    }
    .popup-content h3 {
        color: #1a2b4d;
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 1rem;
        border-bottom: 1px solid #dee2e6;
        padding-bottom: 0.5rem;
        font-family: inherit;
    }
    .popup-content h4 {
         color: #0d6efd;
        font-size: 1rem;
         font-weight: 600;
         margin-top: 1rem;
        margin-bottom: 0.5rem;
        font-family: inherit;
    }
     .popup-content p, .popup-content ul {
        font-size: 0.9rem;
        color: #495057;
        line-height: 1.6;
        margin-bottom: 0.75rem;
        font-family: inherit;
    }
    .explanation-content {
        font-size: 0.9rem;
        line-height: 1.6;
        color: #495057;
        font-family: inherit;
    }
    .explanation-content h4 {
        color: #1a2b4d;
        font-size: 1rem;
        font-weight: 600;
        margin: 1.5rem 0 0.8rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #dee2e6;
        font-family: inherit;
    }
    .explanation-content p {
        margin-bottom: 1rem;
        padding: 0.5rem;
        border-radius: 0.375rem;
        font-size: 0.9rem;
        font-family: inherit;
    }
    .explanation-content li {
        margin-bottom: 0.5rem;
        padding: 0.3rem;
        border-radius: 0.25rem;
    }
    .external-disclaimer {
        background: #f8f9fa;
        border-left: 4px solid #1a1a1a;
        padding: 1rem;
        margin: 2rem 0;
        font-size: 0.9rem;
        color: #666;
        font-family: inherit;
    }
    @media (max-width: 768px) {
        .popup-content { 
            padding: 1.5rem; 
            width: 95%; 
        }
        .popup-content h3 { 
            font-size: 1.1rem; 
        }
        .popup-content h4 { 
            font-size: 0.95rem; 
        }
        .popup-content p, 
        .popup-content ul,
        .explanation-content,
        .explanation-content p,
        .external-disclaimer { 
        font-size: 0.85rem;
        }
    }

    /* Highlight key elements */
    .explanation-content .highlight {
        background-color: #fff3bf;
        border: 1px solid #ffe066;
        color: #a08500;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
        font-weight: 500;
    }

    .explanation-content .algorithm-name {
        color: #0d6efd;
        font-weight: 600;
        background-color: #e7f5ff;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
        border: 1px solid #a5d8ff;
    }

    /* Flashing animation */
    @keyframes flash {
        0% { opacity: 1; }
        50% { opacity: 0.5; }
        100% { opacity: 1; }
    }

    .flashing {
        animation: flash 1s infinite;
    }

    .explanation-content .business-value {
        background-color: #d3f9d8;
        border: 1px solid #8ce99a;
        color: #2b8a3e;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
        font-weight: 500;
    }

    /* Toast notification styles */
    .toast {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        background-color: #1a2b4d;
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 0.25rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        display: none;
        z-index: 2000;
    }

    .toast.show {
        display: block;
        animation: fadeInOut 3s ease-in-out;
    }

    @keyframes fadeInOut {
        0% { opacity: 0; transform: translateY(1rem); }
        10% { opacity: 1; transform: translateY(0); }
        90% { opacity: 1; transform: translateY(0); }
        100% { opacity: 0; transform: translateY(-1rem); }
    }

    /* Update logo styles */
    .external-header .logo {
        height: 30px;
        margin-right: 1rem;
        filter: brightness(0) invert(1); /* Make the logo white */
    }

    .external-header .logo img {
        height: 100%;
        width: auto;
    }

    /* Update logo styles */
    .external-header .logo {
        height: 30px;
        margin-right: 1rem;
        display: flex;
        align-items: center;
    }

    .external-header .logo svg {
        height: 100%;
        width: auto;
        fill: white;
    }

    /* Group Icons Styles */
    .group-icon {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .group-icon path {
        fill: #16AADB;
    }

    /* Search Styles */
    .search-container {
        position: relative;
        z-index: 1000;
    }
    
    .search-container input {
        transition: all 0.3s ease;
        padding-right: 2.5rem; /* Make room for the clear icon */
    }
    
    .search-container input:focus {
        box-shadow: 0 0 0 2px rgba(22, 170, 219, 0.2);
    }
    
    .search-container button {
        transition: all 0.2s ease;
    }
    
    .search-container button:hover {
        transform: translateY(-1px);
    }

    .clear-search {
        position: absolute;
        right: 8.5rem; /* Changed from 6rem to match build_116 */
        top: 50%;
        width: 20px;
        height: 20px;
        margin-top: -10px; /* Half of height to center vertically */
        display: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #6c757d;
        border: none;
        background: none;
        padding: 0;
        opacity: 0.6;
        pointer-events: auto;
        z-index: 1;
        transition: none;
        will-change: auto;
    }

    .clear-search svg {
        width: 16px;
        height: 16px;
        stroke: currentColor;
        stroke-width: 2;
        fill: none;
        pointer-events: none;
    }

    .clear-search:hover,
    .clear-search:active,
    .clear-search:focus {
        opacity: 0.6;
        outline: none;
    }
    
    #searchResults {
        max-height: 300px;
        overflow-y: auto;
        margin-top: 0.5rem;
        padding: 0.5rem;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    #searchResults div {
        transition: all 0.2s ease;
    }
    
    #searchResults div:hover {
        background-color: #f8f9fa;
    }
    
    .highlighted {
        background-color: #fff3bf !important;
        border-color: #ffe066 !important;
    }

    /* Explanation Popup Styles */
    .explanation-loading {
        text-align: center;
        padding: 2rem;
    }
    
    .explanation-loading .spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #16AADB;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 1rem;
    }
    
    .explanation-content {
        font-size: 0.9rem;
        line-height: 1.6;
        color: #495057;
    }
    
    .explanation-content h4 {
        color: #1a2b4d;
        font-size: 1.1rem;
        font-weight: 600;
        margin: 1.5rem 0 0.8rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .explanation-content h4:first-child {
        margin-top: 0;
    }
    
    .explanation-content p {
        margin-bottom: 1rem;
        padding: 0.5rem;
        border-radius: 0.375rem;
        font-size: 0.9rem;
        font-family: inherit;
    }
    
    .explanation-content strong {
        color: #0d6efd;
        font-weight: 600;
    }
    
    .explanation-content em {
        color: #6c757d;
        font-style: italic;
    }
    
    .explanation-content ul {
        list-style-type: disc;
        padding-left: 1.2rem;
        margin: 0.5rem 0;
    }
    
    .explanation-content li {
        margin-bottom: 0.5rem;
        padding: 0.3rem;
        border-radius: 0.25rem;
    }
    
    .explanation-content code {
        background-color: #e9ecef;
        color: #c92a2a;
        padding: 0.2rem 0.4rem;
        border-radius: 0.2rem;
        font-family: monospace;
        font-size: 0.85em;
        border: 1px solid #dee2e6;
    }
    
    .explanation-button {
        background-color: #0d6efd;
        color: white;
        padding: 0.4rem 0.8rem;
        border-radius: 0.375rem;
        font-size: 0.75rem;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        width: 36px;
    }
    
    .explanation-button:hover {
        background-color: #0b5ed7;
        transform: translateY(-1px);
    }
    
    .explanation-button:disabled {
        background-color: #6c757d;
        cursor: not-allowed;
        transform: none;
    }
    
    .explanation-button svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        stroke-width: 2;
        fill: none;
    }

    @keyframes buttonFlashingAnimation { /* Renamed to avoid potential conflicts */
        0% { opacity: 1; }
        50% { opacity: 0.5; }
        100% { opacity: 1; }
    }

    .explanation-button.flashing {
        animation: buttonFlashingAnimation 1.5s infinite;
    }

    /* Popup Styles */
    .popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(4px);
    }
    
    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .popup-content {
        background-color: white;
        padding: 2rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        width: 90%;
        max-width: 800px;
        max-height: 80vh;
        overflow-y: auto;
        position: relative;
        border: 1px solid #e0e0e0;
    }
    
    .popup-close-btn {
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        font-weight: bold;
        color: #6c757d;
        cursor: pointer;
        line-height: 1;
        padding: 0.25rem;
        border-radius: 0.25rem;
        transition: all 0.2s ease;
    }
    
    .popup-close-btn:hover {
        color: #343a40;
        background-color: #f8f9fa;
    }
    
    .popup-content h3 {
        color: #1a2b4d;
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #dee2e6;
    }

    /* Highlight key elements */
    .explanation-content .highlight {
        background-color: #fff3bf;
        border: 1px solid #ffe066;
        color: #a08500;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
        font-weight: 500;
    }

    .explanation-content .algorithm-name {
        color: #0d6efd;
        font-weight: 600;
        background-color: #e7f5ff;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
        border: 1px solid #a5d8ff;
    }

    .explanation-content .business-value {
        background-color: #d3f9d8;
        border: 1px solid #8ce99a;
        color: #2b8a3e;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
        font-weight: 500;
    }

    @media (max-width: 768px) {
        .popup-content {
            padding: 1.5rem;
            width: 95%;
        }
        
        .explanation-content {
            font-size: 0.85rem;
        }
        
        .explanation-content h4 {
            font-size: 1rem;
        }
        
        .popup-content h3 {
            font-size: 1.1rem;
        }

        /* Added to prevent explanation title overlapping with action icons on small screens */
        #explanation-popup #explanation-title {
            padding-right: 11rem; /* Approx width of actions (7.5rem) + their offset (3rem) + buffer (0.5rem) */
        }
    }

    /* Remove all hover-related styles */
    .category-card:hover .group-icon path[fill="#16AADB"],
    .category-card:hover .group-icon {
        transform: none;
        fill: #16AADB;
    }

    /* Loading Spinner Popup Styles */
    .loading-popup {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(4px);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 3001;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        padding: 1rem;
    }
    
    .loading-popup.active {
        opacity: 1;
        visibility: visible;
    }
    
    .loading-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 2rem;
        background-color: white;
        border-radius: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-width: 90%;
        width: 320px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #16AADB;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 1.5rem;
    }
    
    .loading-text {
        color: #1a2b4d;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.5;
        margin: 0;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    @media (max-width: 640px) {
        .loading-content {
            padding: 1.5rem;
            width: 280px;
        }
        
        .loading-spinner {
            width: 40px;
            height: 40px;
            border-width: 3px;
            margin-bottom: 1rem;
        }
        
        .loading-text {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 360px) {
        .loading-content {
            padding: 1rem;
            width: 240px;
        }
        
        .loading-spinner {
            width: 36px;
            height: 36px;
            margin-bottom: 0.75rem;
        }
        
        .loading-text {
            font-size: 0.85rem;
        }
    }

    /* Search Suggestions Styles */
    .search-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        z-index: 1000;
        max-height: 300px;
        overflow-y: auto;
        display: none;
        margin-top: 0.25rem;
    }
    .search-suggestion-item {
        padding: 0.35rem 0.75rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        font-size: 0.8rem;
        color: #495057;
        transition: background-color 0.2s ease;
    }
    .search-suggestion-item:hover {
        background-color: #f8f9fa;
    }
    .suggestion-icon {
        margin-right: 0.4rem;
            font-size: 0.7rem;
        color: #6c757d;
        flex-shrink: 0;
    }
    .suggestion-text {
        flex-grow: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .suggestion-count {
        color: #6c757d;
        font-size: 0.7rem;
        background: #e9ecef;
        padding: 0.1rem 0.35rem;
        border-radius: 1rem;
        margin-left: 0.4rem;
    }
    .delete-suggestion {
        color: #6c757d;
        cursor: pointer;
        font-size: 0.7rem;
        padding: 0.1rem;
        line-height: 1;
        opacity: 0.7;
        transition: opacity 0.2s ease;
        margin-left: 0.4rem;
    }
    .delete-suggestion:hover {
        opacity: 1;
    }

    /* Add new styles for explanation popup actions */
    .explanation-actions {
        position: absolute;
        top: 1rem;
        right: 3rem; /* Adjusted from 1rem to 3rem to avoid close button */
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .explanation-action-btn {
        background-color: #0d6efd; /* Match .explanation-button */
        color: white; /* Match .explanation-button */
        padding: 0.4rem 0.8rem;
        border-radius: 0.375rem;
        font-size: 0.75rem;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        width: 36px;
    }
    
    .explanation-action-btn:hover {
        background-color: #0b5ed7; /* Match .explanation-button:hover */
        color: white; /* Match .explanation-button:hover */
        transform: translateY(-1px); /* Match .explanation-button:hover */
    }

    .explanation-action-btn:disabled {
        background-color: #6c757d; /* Match .explanation-button:disabled */
        color: white; /* Icon color for disabled state */
        cursor: not-allowed;
        transform: none; /* Match .explanation-button:disabled */
        opacity: 0.65; /* Visual cue for disabled */
    }

    .explanation-action-btn svg {
        width: 18px; /* Match .explanation-button svg */
        height: 18px; /* Match .explanation-button svg */
        fill: none; /* Default to outline */
        stroke: currentColor; /* Default to outline */
        stroke-width: 2; /* Match .explanation-button svg */
    }

    /* Specific filled icons */
    .export-dropdown > .explanation-action-btn svg,
    .explanation-action-btn#copy-to-clipboard svg,
    .explanation-action-btn#text-to-speech .tts-icon-play, /* Target specific SVG class */
    .explanation-action-btn#text-to-speech .tts-icon-stop { /* Target specific SVG class */
        fill: currentColor;
        stroke: none;
    }
    
    /* Specific styling for TTS Spot icon (outline) */
    /* Note: .explanation-action-btn#text-to-speech svg general rule is removed as icons are handled by class or default */
    .explanation-action-btn#text-to-speech .tts-icon-spot { /* Target specific SVG class */
        fill: none;
        stroke: currentColor; 
        stroke-width: 1.5; /* Original specific stroke width */
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .export-dropdown.export-dropdown-disabled:hover .export-dropdown-content {
        display: none !important; 
    }


    .export-dropdown {
        position: relative;
        display: inline-block;
    }

    /* The main export button within dropdown should inherit .explanation-action-btn styles */
    /* .export-dropdown > .explanation-action-btn svg { */
         /* fill: currentColor; /* Ensures the main export icon is filled */
         /* stroke: none; */
    /* } */

    .export-dropdown-content {
        display: none;
        position: absolute;
        right: 0;
        background-color: white;
        min-width: 160px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        border-radius: 0.25rem;
        z-index: 1;
    }

    .export-dropdown:hover .export-dropdown-content {
        display: block;
    }

    .export-option {
        padding: 0.5rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #495057;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }

    .export-option:hover {
        background-color: #f8f9fa;
        color: #0d6efd;
    }

    .export-option svg {
        width: 16px;
        height: 16px;
        fill: currentColor; /* DOC/PDF container icons are filled */
        stroke: none;
    }

    .export-option svg text {
        fill: currentColor; /* Text within DOC/PDF icons also uses currentColor */
        stroke: none;
        font-family: Arial, sans-serif; /* Ensure font consistency */
        font-size: 4px; /* Adjust as needed */
        text-anchor: middle;
        font-weight: bold;
    }

    /* external-style document formatting */
    .external-doc {
        font-family: Arial, sans-serif;
        font-size: 12pt;
        line-height: 1.5;
        margin: 20px;
    }

    .external-header {
        text-align: center;
        margin-bottom: 20px;
    }

    .external-header h1 {
        font-size: 24pt;
        margin: 0;
    }

    .external-header .date {
        font-size: 12pt;
        color: #666;
    }

    .external-disclaimer {
        font-size: 10pt;
        color: #666;
        margin-bottom: 20px;
    }

    .external-footer {
        text-align: center;
        margin-top: 20px;
    }

    .copyright {
        font-size: 12pt;
        color: #666;
    }

    /* Popup Styles */
    #explanation-popup,
    #value-proposition-popup {
        z-index: 1250; /* Ensure these specific popups are layered correctly */
    }

    /* Styles moved from index.html */
    .algo-code-block {
        background: #f5f6fa;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        font-family: 'Roboto Mono', 'Consolas', 'Menlo', 'Monaco', monospace;
        font-size: 0.92em;
        color: #222;
        padding: 0.25em 0.6em;
        margin: 0.4em 0 0.7em 0;
        display: inline-block;
        max-width: 100%;
        white-space: pre-wrap;
        word-break: break-all;
        box-sizing: border-box;
    }

    .relevance-score {
        display: none; /* Hidden by default */
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #16AADB;
        color: #ffffff;
        font-size: 0.5rem;
        font-weight: 500;
        position: absolute;
        right: 8px;
        top: 8px;
        align-items: center;
        justify-content: center;
        z-index: 10;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        transition: all 0.2s ease;
    }

    .relevance-score.show {
        display: flex !important;
    }

    .relevance-score::before {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        right: 0;
        transform: translateY(-8px);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 0.75rem;
        line-height: 1.4;
        white-space: normal;
        visibility: hidden;
        opacity: 0;
        transition: all 0.2s ease;
        pointer-events: none;
        max-width: 280px;
        width: max-content;
        text-align: left;
        word-wrap: break-word;
    }

    .relevance-score:hover::before {
        visibility: visible;
        opacity: 1;
        transform: translateY(-4px);
    }

    .business-task {
        visibility: hidden;
        text-align: center;
        margin: 1rem 0;
        color: #1a2b4d;
        font-size: 1.25rem;
        font-weight: 600;
        min-height: 2rem;
    }

    .counter-container {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }

    #export-png-btn {
        position: fixed;
        bottom: 60px; /* Set to be above the refresh button */
        right: 20px;
        z-index: 1200;
        box-shadow: 0 2px 8px rgba(22,170,219,0.10);
    }

    #export-png-btn svg {
        display: block;
    }

    /* Styles for loading overlay from app-services.js */
    .loading-overlay-styles {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255,255,255,0.9);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    .loading-inner-container {
        text-align: center;
    }

    .loading-message {
        margin-bottom: 10px;
        /* Add other text styles if needed, e.g., font-size, color */
    }

    .loading-spinner-styles {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3; /* Light grey */
        border-top: 4px solid #3498db; /* Blue */
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* Style for initialization error popup from app-services.js */
    .initialization-error-popup {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #ff4444; /* Red */
        color: white;
        padding: 10px 20px;
        border-radius: 5px;
        z-index: 10000; /* Ensure it's above loading overlay if shown simultaneously */
    }

    /* Styles for refresh button positioning (if not already handled by .explanation-action-btn) */
    #refresh-data-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000; /* Ensure it's above most content but below popups if necessary */
    }

    /* Styles for Case Study Link in algorithm details */
    .case-study-link {
        text-decoration: underline;
        color: #0d6efd; /* Bootstrap link blue */
    }

    .variants-section {
        margin: 0.5em 0;
    }

    /* Apply specific height for the explanation popup */
    #explanation-popup .popup-content {
        height: 75vh;
    }

    /* New Spinner for streaming explanation text - Centered Overlay */
    .explanation-spinner-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: transparent;
        padding: 20px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1270;
        display: none;
        width: auto;
        height: auto;
    }

    .explanation-spinner-overlay .spinner-graphic {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #16AADB;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    /* Ensure the white box with the spinner and text remains opaque */
    .explanation-loading-popup-overlay .loading-content {
      background-color: #ffffff;
    }

    /* This specifically targets the explanation popup's loader overlay */
    .explanation-loading-popup-overlay {
        background-color: transparent !important; /* Ensures transparency */
        backdrop-filter: none !important; /* Ensures no blur */
    }

    .explanation-spinner-overlay .spinner-graphic {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #16AADB;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    /* CTA Button for LLM Explanation Popup */
    #cta-llm-button {
        position: sticky;
        bottom: 1rem;
        right: 1rem;
        float: right; /* Re-added for right alignment */
        padding: 0.6rem 1.2rem; /* Adjusted padding */
        border-radius: 0.375rem; /* Consistent with other action buttons */
        background-color: #0d6efd; /* Standard blue */
        color: white;
        font-size: 0.875rem; /* Adjusted font size */
        font-weight: 500; /* Standard font weight for buttons */
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Existing shadow */
        z-index: 10; /* Sufficient for sticky positioning within its context */
        transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
        /* display: none; /* Controlled by JavaScript */
        /* Tailwind classes in HTML might provide initial/override some styles if not covered here */
    }

    #cta-llm-button:hover {
        background-color: #0b5ed7; /* Darker blue on hover */
        transform: translateY(-2px); /* Moving effect */
        box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.07); /* Enhanced shadow on hover */
    }

    .explanation-body {
        position: relative; /* Ensure parent is a positioning context for the absolute button */
        /* padding-bottom: 4rem; */ /* Removed as button is no longer inside this element */
    }

/* Firebase Auth Container Overlay Styles */
#firebaseui-auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black background for the overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3002; /* Increased to be above loading popups */
}

/* Styles for the FirebaseUI widget card itself */
#firebaseui-auth-container .firebaseui-card-content {
  background-color: rgba(255, 255, 255, 0.95) !important; /* Slightly transparent white for the card */
  border-radius: 0 !important; /* Removed rounded corners */
  padding: 2rem !important; /* Consistent padding */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important; /* Match other popups */
}

#firebaseui-auth-container .firebaseui-card-header {
  background-color: transparent !important; /* Remove default header background if any */
}

/* If input fields have specific backgrounds you want to make transparent or themed: */
#firebaseui-auth-container .firebaseui-input {
  background-color: rgba(255, 255, 255, 0.8) !important; /* Example: Make inputs slightly transparent white */
  /* border-radius: 0.25rem !important; */ /* Optional: round corners of inputs too */
}

/* Style for buttons if needed */
#firebaseui-auth-container .firebaseui-button {
  /* background-color: #0d6efd !important; */ /* Example: Match your app's primary button color */
  /* border-radius: 0.25rem !important; */
}