        :root {
            --color-primary: #006400; /* Dark Green */
            --color-primary-dark: #004d00;
            --color-secondary: #1E40AF; /* Blue */
            --color-secondary-dark: #1E3A8A;
            --color-danger: #B91C1C; /* Red */
            --color-danger-dark: #991B1B;
            --color-neutral: #6B7280; /* Medium Gray */
            --color-neutral-dark: #4B5563;
            --color-text-dark: #111827; /* Near Black */
            --color-text-body: #374151; /* Dark Gray */
            --color-text-light: #6B7280; /* Medium Gray */
            --color-bg-light: #f9fafb; /* Very Light Gray */
            --color-bg-white: #ffffff;
            --color-border: #e5e7eb; /* Light Gray Border */
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
            --radius-sm: 4px;
            --radius-md: 6px; 
            --radius-lg: 8px;
            --side-padding: 1rem;
        }
        @media (min-width: 769px) {
            :root { --side-padding: 1.5rem; }
        }

        /* Base Reset & Smooth Scroll */
        html, body {
            scroll-behavior: smooth;
        }
        body {
            font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
            margin: 0;
            background: var(--color-bg-light);
            color: var(--color-text-body); 
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            line-height: 1.65; 
            padding: 0 var(--side-padding); /* Apply side padding */
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        *, *::before, *::after { box-sizing: border-box; }

        /* --- Hero Section --- */
        .hero-section {
            display: flex; align-items: center; text-align: center;
            padding: 4rem 1rem; 
            background-color: #e8f5e9; /* Light green */
            border-bottom: 1px solid var(--color-border);
            margin: 0 calc(-1 * var(--side-padding)); /* Stretch full width */
            margin-bottom: 2rem; 
        }
        .hero-content { 
            max-width: 800px;
            margin: 0 auto; 
            padding: 0 1rem; 
        }
        .hero-content h1 { 
            font-size: clamp(2rem, 5vw, 2.8rem); 
            color: var(--color-text-dark); 
            font-weight: 700; margin: 0 0 1rem 0; line-height: 1.25;
            border: none; padding: 0;
        }
        .hero-content p { 
            font-size: 1.15rem; font-weight: 400; color: var(--color-text-body);
            margin: 0 0 1.75rem 0;
        }
        
        /* --- Hero Buttons --- */
        .hero-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        /* --- CSS FIX: Force outline style for lang button --- */
        #lang-toggle-btn {
            background: var(--color-bg-white) !important; /* FORCE white background */
            color: var(--color-primary) !important;
            border-color: var(--color-primary);
        }
        #lang-toggle-btn span {
             color: var(--color-primary) !important; /* FORCE span text color */
        }
        #lang-toggle-btn:hover {
            background: #f0fff0 !important; /* FORCE light green background on hover */
            border-color: var(--color-primary-dark);
            color: var(--color-primary-dark) !important;
        }
        #lang-toggle-btn:hover span {
             color: var(--color-primary-dark) !important;
        }

        
        /* --- Main Container & Typography --- */
        .main-container {
            max-width: 1000px; /* Centered, single column */
            margin: 0 auto;
            padding-bottom: 3rem; 
            flex-grow: 1;
            width: 100%;
        }
        h1, h2, h3 {
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 10px;
            color: var(--color-text-dark);
            font-weight: 600;
        }
        h1 { text-align: center; margin-top: 0; }
        h2 { margin-top: 1rem; }
        h3 { margin-top: 25px; border-bottom: none; font-size: 1.2em; }

        /* --- Card Layout --- */
        .card {
            background: var(--color-bg-white);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            margin-top: 1.5rem;
        }
        .card-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--color-border);
        }
        .card-header h2 {
            margin: 0;
            padding: 0;
            border: none;
        }
        .card-body {
            padding: 1.5rem;
        }
        .card-body-grid {
            padding: 1.5rem;
            display: grid;
            grid-template-columns: 1fr; /* Mobile first */
            gap: 2rem;
        }
        @media (min-width: 769px) {
            .card-body-grid {
                grid-template-columns: 1fr 1fr; /* 2-col on desktop */
            }
        }

        /* --- Inputs, Selects, Textareas --- */
        input[type="text"], textarea, select {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            box-sizing: border-box;
            box-shadow: var(--shadow-sm);
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        textarea:focus, input[type="text"]:focus, select:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(0,100,0,0.15); 
        }
        textarea { height: 200px; }
        select { background-color: var(--color-bg-white); }
        label {
            display: block;
            font-weight: 500;
            color: var(--color-text-dark);
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }
        
        /* --- Button System --- */
        .btn {
            display: inline-flex; align-items: center; justify-content: center;
            padding: 10px 18px;
            font-size: 0.9rem;
            font-weight: 600;
            color: #ffffff;
            border: 1px solid transparent;
            border-radius: var(--radius-md);
            cursor: pointer;
            text-decoration: none;
            box-shadow: var(--shadow-sm);
            transition: all 0.2s ease;
        }
        .btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        .btn:disabled {
            background: #D1D5DB; color: var(--color-text-light);
            cursor: not-allowed; transform: none; box-shadow: none;
        }
        .btn-primary { background: var(--color-primary); border-color: var(--color-primary); }
        .btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
        .btn-secondary { background: var(--color-secondary); border-color: var(--color-secondary); }
        .btn-secondary:hover:not(:disabled) { background: var(--color-secondary-dark); border-color: var(--color-secondary-dark); }
        .btn-danger { background: var(--color-danger); border-color: var(--color-danger); }
        .btn-danger:hover:not(:disabled) { background: var(--color-danger-dark); border-color: var(--color-danger-dark); }
        .btn-neutral { background: var(--color-neutral); border-color: var(--color-neutral); }
        .btn-neutral:hover:not(:disabled) { background: var(--color-neutral-dark); border-color: var(--color-neutral-dark); }
        .btn-outline {
            background: var(--color-bg-white);
            color: var(--color-neutral-dark);
            border-color: var(--color-border);
        }
        .btn-outline:hover:not(:disabled) {
            background: var(--color-bg-light);
            border-color: var(--color-neutral);
        }

        .button-group { display: flex; flex-wrap: wrap; gap: 10px; }
        .button-group-no-wrap { display: flex; flex-wrap: nowrap; gap: 10px; }
        
        /* --- Classify Button --- */
        .classify-button-container {
            margin-top: 2rem;
            text-align: center;
            border-top: 1px dashed var(--color-border);
            padding-top: 2rem;
        }
        #processButton {
            padding: 14px 32px;
            font-size: 1.1rem;
            font-weight: 700;
        }

        /* --- Loading Spinner --- */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .spinner {
            display: none; /* Hidden by default */
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-top-color: #ffffff;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .btn-loading {
            position: relative;
        }
        .btn-loading .spinner {
            display: inline-block;
        }
        
        /* --- Config Section --- */
        #keywordJsonOutput { height: 200px; background-color: var(--color-bg-light); font-family: monospace; font-size: 13px; }
        #conceptList { margin-top: 15px; max-height: 150px; overflow-y: auto; }
        
        .concept-tag {
            display: inline-block; background-color: #eee; color: #555;
            padding: 5px 12px; border-radius: 15px; font-size: 0.9em;
            margin-right: 5px; margin-bottom: 5px;
        }
        .concept-tag button {
            background: none; border: none; color: var(--color-danger); font-weight: bold;
            font-size: 1.1em; cursor: pointer; padding: 0 0 0 5px; margin-left: 2px;
        }

        /* --- Template Checkbox Dropdown --- */
        .template-dropdown-btn {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            box-sizing: border-box;
            box-shadow: var(--shadow-sm);
            transition: border-color 0.2s, box-shadow 0.2s;
            background: var(--color-bg-white);
            cursor: pointer;
            text-align: left;
            color: var(--color-text-body);
        }
        .template-dropdown-btn:focus, .template-dropdown-btn:hover {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(0,100,0,0.15); 
        }
        .template-dropdown-btn svg {
            transition: transform 0.2s ease;
        }
        .template-checkbox-container {
            border: 1px solid var(--color-border);
            border-top: none;
            border-radius: 0 0 var(--radius-md) var(--radius-md);
            padding: 10px;
            margin-top: -5px;
            max-height: 200px;
            overflow-y: auto;
            background: var(--color-bg-white);
        }
        .template-checkbox-item {
            display: flex;
            align-items: center;
            padding: 8px 5px;
            cursor: pointer;
            border-radius: var(--radius-sm);
            font-weight: 400;
            margin-bottom: 0;
        }
        .template-checkbox-item:hover {
            background-color: var(--color-bg-light);
        }
        .template-checkbox-item input[type="checkbox"] {
            width: auto;
            margin-right: 8px;
            accent-color: var(--color-primary);
        }

        /* --- Error Handling --- */
        .error-message {
            color: var(--color-danger);
            font-size: 0.85rem;
            font-weight: 500;
            display: none;
            margin-top: 5px;
        }
        .required-marker {
            color: var(--color-danger);
            font-weight: bold;
            margin-left: 2px;
        }
        
        /* --- Analysis Summary Card --- */
        .summary-card {
            background: var(--color-bg-white);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            margin-bottom: 1.5rem;
            padding: 1.5rem;
        }
        .summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
        }
        .summary-item {
            background-color: var(--color-bg-light);
            border-radius: var(--radius-md);
            padding: 1rem;
            border: 1px solid var(--color-border);
        }
        .summary-item-label {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--color-text-light);
            margin-bottom: 0.5rem;
            display: block;
        }
        .summary-item-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--color-primary);
        }
        .summary-item-value.dark {
             color: var(--color-text-dark);
        }

        /* --- Dashboard & Results --- */
        #results-area {
            margin-top: 2rem;
            padding-top: 2rem;
            border-top: 1px dashed var(--color-border);
        }
        #dashboardContainer {
            padding: 20px;
            background: var(--color-bg-white);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            margin-bottom: 1.5rem;
            height: 350px;
            box-shadow: var(--shadow-sm);
        }
        .results-header {
            display: flex; justify-content: space-between; align-items: center;
            flex-wrap: wrap; gap: 15px; margin-top: 20px;
        }
        #filterInput { width: 300px; }
        #shlokaCount { font-size: 1.1em; font-weight: 600; color: var(--color-text-dark); }
        
        /* --- Pagination --- */
        .pagination-controls {
            display: flex; justify-content: center; align-items: center;
            gap: 15px; margin-top: 20px;
        }
        #pageInfo { font-weight: 500; font-size: 0.9em; color: var(--color-text-light); }

        /* --- Table Styles --- */
        #resultsTableContainer {
            overflow-x: auto; margin-top: 20px;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            background: var(--color-bg-white);
        }
        table { width: 100%; border-collapse: collapse; }
        th, td {
            border-bottom: 1px solid var(--color-border);
            padding: 14px 16px;
            text-align: left;
            font-size: 0.9rem;
            word-break: normal;
            overflow-wrap: break-word;
        }
        th {
            background-color: var(--color-bg-light);
            font-weight: 600;
            color: var(--color-text-dark);
        }
        tr:last-child td { border-bottom: none; }
        tr:nth-child(even) { background-color: var(--color-bg-light); }
        
        #resultsBody tr {
            cursor: pointer;
            transition: background-color 0.15s ease;
        }
        #resultsBody tr:hover {
            background-color: #f0fdf4;
        }

        mark {
            background-color: #fffb91;
            padding: 2px 3px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            color: #333;
        }
        
        .hidden { display: none; }
        
        /* --- Modal Styles --- */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 1rem;
        }
        .modal-overlay.hidden {
            display: none;
        }
        .modal-content {
            background: var(--color-bg-white);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            padding: 2rem;
            max-width: 700px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }
        .modal-close-btn {
            position: absolute;
            top: 1rem; right: 1rem;
            background: none;
            border: none;
            font-size: 2rem;
            line-height: 1;
            color: var(--color-neutral);
            cursor: pointer;
            padding: 0;
        }
        .modal-close-btn:hover {
            color: var(--color-text-dark);
        }
        .modal-content h3 {
            margin-top: 0;
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 10px;
            color: var(--color-primary);
        }
        .modal-content p {
            font-size: 1.1rem;
            line-height: 1.7;
            background: var(--color-bg-light);
            padding: 1rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--color-border);
            word-wrap: break-word;
        }
        .modal-content p.shloka-context-before,
        .modal-content p.shloka-context-after {
            background: var(--color-bg-white);
            color: var(--color-text-light);
            font-style: italic;
            border-style: dashed;
            font-size: 1rem;
            opacity: 0.9;
        }
        .modal-content p.shloka-main {
             border-color: var(--color-primary);
             border-width: 1px;
             box-shadow: var(--shadow-sm);
        }

        .modal-content .modal-label {
            font-weight: 600;
            color: var(--color-text-dark);
            margin-top: 1rem;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .modal-content .modal-detail {
             font-size: 1rem;
             color: var(--color-text-body);
        }

        .seo-section {
            margin-top: 3rem;
            padding-top: 1rem;
        }
        .seo-section h2 {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--color-text-dark);
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 0.75rem;
            margin-top: 0;
            margin-bottom: 1rem;
        }
        .seo-section h2:first-of-type {
            margin-top: 0;
        }
        .seo-section h3 {
             font-size: 1.1rem;
             font-weight: 600;
             color: var(--color-text-dark);
             border-bottom: none;
             margin-top: 1.5rem;
             margin-bottom: 0.5rem;
        }
        .seo-section p, .seo-section li {
            font-size: 1rem;
            line-height: 1.7;
            color: var(--color-text-body);
            word-break: break-word;
        }
        .seo-section ol, .seo-section ul {
            padding-left: 1.5rem;
            margin-left: 0;
        }
        .seo-section li {
            margin-bottom: 0.5rem;
        }
        .seo-section ul li ul {
            padding-left: 1.25rem;
            margin-top: 0.5rem;
        }
        .seo-section a {
            color: var(--color-primary);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }
        .seo-section a:hover {
            color: var(--color-primary-dark);
            text-decoration: underline;
        }
        .seo-section .creator-info {
            background-color: var(--color-bg-light);
            padding: 1.5rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--color-border);
        }
        .seo-section .creator-info p {
            margin: 0.5rem 0;
            word-break: break-word;
        }

        @media (max-width: 900px) {
            .results-header { flex-direction: column; align-items: stretch; }
            #filterInput { width: 100%; }
        }
        @media (max-width: 480px) {
            .results-header .button-group {
                 flex-wrap: nowrap;
            }
        }

        /* --- v2.0 Research Features --- */
        .analysis-settings-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        @media (min-width: 769px) {
            .analysis-settings-grid { grid-template-columns: 1fr 1fr; }
        }
        .checkbox-inline {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 400;
            cursor: pointer;
        }
        .checkbox-inline input { width: auto; accent-color: var(--color-primary); }
        .settings-hint {
            font-size: 0.8rem;
            color: var(--color-text-light);
            margin-top: 0.25rem;
        }
        .progress-container {
            margin-top: 1rem;
            display: none;
        }
        .progress-container.visible { display: block; }
        .progress-bar-track {
            height: 8px;
            background: var(--color-border);
            border-radius: 999px;
            overflow: hidden;
        }
        .progress-bar-fill {
            height: 100%;
            width: 0%;
            background: var(--color-primary);
            transition: width 0.15s ease;
        }
        .progress-text {
            font-size: 0.85rem;
            color: var(--color-text-light);
            margin-top: 0.35rem;
            text-align: center;
        }
        input[type="number"] {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            box-shadow: var(--shadow-sm);
        }
        input[type="number"]:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(0,100,0,0.15);
        }
        .match-badge {
            display: inline-block;
            font-size: 0.75rem;
            padding: 2px 6px;
            border-radius: 4px;
            background: #e8f5e9;
            color: var(--color-primary-dark);
            margin-right: 4px;
        }
        tr.no-results-row td {
            text-align: center;
            font-style: italic;
            color: var(--color-text-light);
            padding: 2rem;
        }
