
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f5f5f5;
            padding: 40px 20px;
            min-height: 100vh;
            /* background: #ffeaec; */
            /* background: #ffedef; */
            /* background: #fffdfd; */
            background: white;
            padding: 40px 120px;
        }


        .container {
            max-width: 800px;
            margin: 0 auto;
        }

        /* ===== WEATHER WIDGET STYLES ===== */

        .header-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            margin-bottom: 10px;
        }

        .weather-container {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .update-location-icon {
            position: absolute;
            top: -2px;
            right: 0px;
            font-size: 12px;
            cursor: pointer;
            opacity: 0.6;
            transition: opacity 0.2s;
        }

        .update-location-icon:hover {
            opacity: 1;
        }

        .weather-widget {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
        }

        .weather-icon {
            font-size: 24px;
            min-width: 28px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .weather-icon-img {
            width: 36px;
            height: 36px;
            object-fit: contain;
        }

        .weather-info {
            display: flex;
            flex-direction: column;
            font-size: 12px;
            line-height: 1.3;
        }

        .weather-temp {
            font-weight: 600;
            color: #333;
        }

        .weather-precip {
            color: #666;
        }

        .show-weather-btn {
            font-size: 13px;
            padding: 6px 12px;
            background: #f6f8fa;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            cursor: pointer;
            color: #333;
            transition: background 0.2s, border-color 0.2s;
        }

        .show-weather-btn:hover {
            background: #f0f0f0;
            border-color: #ccc;
        }

        /* Loading dots animation */
        .loading-dots {
            font-size: 14px;
            color: #999;
            animation: loadingPulse 1.5s ease-in-out infinite;
        }

        @keyframes loadingPulse {
            0%, 100% { opacity: 0.3; }
            50% { opacity: 1; }
        }

        /* Location Modal Styles */
        #location-modal-background {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 999;
        }

        #location-modal {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border-radius: 15px;
            z-index: 1000;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        }

        #location-modal .close {
            position: absolute;
            top: 15px;
            left: 15px;
            cursor: pointer;
            color: #999;
        }

        #location-modal .close:hover {
            color: #333;
        }

        #locationMap {
            height: 300px;
            width: 100%;
            border-radius: 10px;
            border: 1px solid #e0e0e0;
        }

        /* Query input container - provides positioning context for Facts overlay */
        .query-input-container {
            position: relative;
            width: 100%;
            display: block;
        }

        #queryInput {
            width: 100%;
            padding: 20px 24px 0px;
            font-size: 20px;
            font-family: inherit;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            background: transparent;
            position: relative;
            z-index: 2;
            caret-color: #333;
            box-sizing: border-box;
            overflow-wrap: break-word;
            display: block;
        }

        #queryArea {
            padding: 30px;
            padding-top: 8px;
        }

        .search-controls {
            display: flex;
            width: fit-content;
            margin-left: auto;
        }

        .clue {
            text-align: center;
  color: #666;
  margin-bottom: 30px;
        }

                h1 {
            text-align: center;
            margin-bottom: 10px;
            color: #333;
        }

        .subtitle {
            text-align: center;
            color: #666;
            margin-bottom: 40px;
        }

        #queryInput:focus {
            outline: none;
            border-color: #1976d2;
        }

        /* Search controls row - right-justified below input */
        .search-controls-row {
            display: flex;
            justify-content: flex-end;
            margin-top: 12px;
        }

        /* Search controls - inline with input */
        .search-controls {
            display: flex;
            /* flex-direction: column; */
            gap: 8px;
            align-items: stretch;
        }

        /* Intent dropdown */
        .intent-dropdown {
            position: relative;
            display: inline-block;
        }

        .intent-btn, .select {
            padding: 14px 20px;
            font-size: 16px;
            font-weight: 600;
            background: white;
            color: #333;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s;
            width: 100%;
        }

        .select {
            padding: 5px 10px;
            padding-right: 25px;
        }

        .intent-btn:hover, .select:hover {
            border-color: #1976d2;
            background: #f5f9ff;
        }

        .intent-btn .arrow {
            font-size: 12px;
            transition: transform 0.2s;
            margin-left: auto;
        }

        .intent-dropdown.open .intent-btn .arrow {
            transform: rotate(180deg);
        }

        .intent-menu {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 4px;
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 180px;
            z-index: 100;
            display: none;
        }

        .intent-dropdown.open .intent-menu {
            display: block;
        }

        /* Intent group - contains intent header + positioned source submenu */
        .option {
            position: relative;
        }

        /* Intent option - the clickable intent header */
        .option-title {
            padding: 10px 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s;
            font-weight: 600;
            color: #333;
        }

        .option:first-child .option-title {
            border-radius: 8px 8px 0 0;
        }

        .option:last-child .option-title {
            border-radius: 0 0 8px 8px;
        }

        .optoin:not(.selected) >.option-title:hover {
            background: #f5f5f5;
        }

        .option-title.selected {
            background: #e3f2fd;
        }

        .option-title .icon {
            font-size: 16px;
        }

        .option-title .label {
            font-weight: 600;
            font-size: 14px;
        }

        /* Chevron indicator */
        .option-title .chevron {
            margin-left: auto;
            font-size: 10px;
            color: #999;
        }

        /* Source list - overlay submenu positioned to the right */
        .source-list {
            position: absolute;
            left: 100%;
            top: 0;
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 160px;
            padding: 4px 0;
            display: none;
            z-index: 102;
            /* Bridge gap to prevent hover loss */
            margin-left: -4px;
            padding-left: 4px;
        }

        /* Invisible bridge for hover */
        .source-list::before {
            content: '';
            position: absolute;
            left: -8px;
            top: 0;
            bottom: 0;
            width: 12px;
            background: transparent;
        }

        /* Show on hover (desktop) */
        .option:hover .source-list,
        .source-list:hover {
            display: block;
        }

        /* Show when expanded (mobile/touch) */
        .option.expanded .source-list {
            display: block;
        }

        .source-option {
            padding: 8px 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s;
            font-size: 13px;
            white-space: nowrap;
        }

        .source-option:first-child {
            border-radius: 6px 6px 0 0;
        }

        .source-option:last-child {
            border-radius: 0 0 6px 6px;
        }

        .source-option:hover {
            background: #e3f2fd;
        }

        .source-option .icon {
            font-size: 13px;
        }

        .source-option .external {
            margin-left: auto;
            font-size: 10px;
            color: #666;
        }

        /* Submit button - hidden for now, using dropdown source selection instead */
        .submit-btn {
            /* display: none !important; */
            /* padding: 14px 32px; */
            padding: 10px 20px;
            font-size: 16px;
            font-weight: 600;
            background: #1976d2;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .submit-btn:hover {
            background: #1565c0;
            transform: translateY(-1px);
        }

        .submit-btn:active {
            transform: translateY(0);
        }

        .submit-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }

        .submit-btn.loading {
            opacity: 0.7;
        }

        /* Auto-detected intent badge
        .intent-auto-badge {
            font-size: 11px;
            background: #e8f5e9;
            color: #2e7d32;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 8px;
        } */

        /* Intent suggestion bar */
        .intent-suggestion {
            display: none;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            margin: 8px 0;
            background: linear-gradient(135deg, #f0f9ff 0%, #e8f4fd 100%);
            border: 1px solid #bde0fe;
            border-radius: 8px;
            font-size: 14px;
            color: #1e3a5f;
            flex-wrap: wrap;
        }

        .intent-suggestion.visible {
            display: flex;
            display: none;
        }

        /* Search suggestion row */
        .search-suggestion {
            display: none;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            margin: 8px 0;
            /* background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%); */
                        background: linear-gradient(135deg, #fff 0%, #fff2cc 100%);
            border: 1px solid #ffcc80;
            border-radius: 8px;
            font-size: 14px;
            color: #5d4037;
            flex-wrap: wrap;
        }

        .search-suggestion.visible {
            display: flex;
        }

        .search-suggestion .suggestion-text {
            flex: 1;
            min-width: 150px;
        }

        .search-suggestion .suggestion-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .search-suggestion .search-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: white;
            color: #333;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
        }

        .search-suggestion .search-btn:hover {
            background: #f5f5f5;
            border-color: #bbb;
            transform: translateY(-1px);
        }

        .search-suggestion .search-btn img {
            width: 16px;
            height: 16px;
        }

        .search-suggestion .search-btn.primary {
            background: #1976d2;
            color: white;
            border-color: #1565c0;
        }

        .search-suggestion .search-btn.primary:hover {
            background: #1565c0;
        }

        /* Thaura AI button styling */
        .search-suggestion .search-btn.thaura-btn {
            background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
            border-color: #81c784;
            color: #2e7d32;
        }

        .search-suggestion .search-btn.thaura-btn:hover {
            background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
            border-color: #66bb6a;
        }

        /* Thaura AI Results Container */
        .thaura-results-container {
            margin: 16px 0;
            padding: 0;
            background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
            border: 1px solid #a5d6a7;
            border-radius: 12px;
            overflow: hidden;
        }

        .thaura-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
            border-bottom: 1px solid #81c784;
        }

        .thaura-logo {
            font-weight: 600;
            color: #2e7d32;
            font-size: 14px;
        }

        .thaura-close {
            background: none;
            border: none;
            font-size: 18px;
            color: #558b2f;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: background 0.2s;
        }

        .thaura-close:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        .thaura-content {
            padding: 16px;
            font-size: 14px;
            line-height: 1.6;
            color: #333;
            max-height: 400px;
            overflow-y: auto;
        }

        .thaura-content.loading {
            text-align: center;
            color: #666;
            padding: 40px;
        }

        .thaura-content.loading::after {
            content: '';
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid #81c784;
            border-top-color: transparent;
            border-radius: 50%;
            animation: thaura-spin 0.8s linear infinite;
            margin-left: 10px;
            vertical-align: middle;
        }

        @keyframes thaura-spin {
            to { transform: rotate(360deg); }
        }

        .thaura-content.error {
            color: #c62828;
            background: #ffebee;
            border-radius: 8px;
            padding: 16px;
        }

        .thaura-save-prompt {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
            border-top: 1px solid #ffcc80;
            flex-wrap: wrap;
        }

        .save-prompt-text {
            font-size: 14px;
            color: #5d4037;
            font-weight: 500;
        }

        .save-prompt-buttons {
            display: flex;
            gap: 8px;
        }

        .save-btn {
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .save-btn.save-yes {
            background: #4caf50;
            color: white;
        }

        .save-btn.save-yes:hover {
            background: #388e3c;
        }

        .save-btn.save-no {
            background: #e0e0e0;
            color: #666;
        }

        .save-btn.save-no:hover {
            background: #bdbdbd;
        }

        .thaura-save-feedback {
            padding: 12px 16px;
            text-align: center;
            font-weight: 500;
        }

        .thaura-save-feedback.success {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .thaura-save-feedback.error {
            background: #ffebee;
            color: #c62828;
        }

        /* Mobile adjustments for search suggestion */
        @media (max-width: 500px) {
            .search-suggestion {
                padding: 10px 12px;
                gap: 8px;
            }

            .search-suggestion .suggestion-text {
                min-width: 100%;
                margin-bottom: 4px;
            }

            .search-suggestion .search-btn {
                padding: 10px 12px;
                flex: 1;
                justify-content: center;
            }
        }

        .intent-suggestion .suggestion-text {
            flex: 1;
            min-width: 200px;
        }

        .intent-suggestion .suggestion-text strong {
            color: #1976d2;
        }

        .intent-suggestion .suggestion-accept {
            padding: 8px 16px;
            background: #1976d2;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s;
        }

        .intent-suggestion .suggestion-accept:hover {
            background: #1565c0;
        }

        .intent-suggestion .suggestion-dismiss {
            padding: 6px 10px;
            background: transparent;
            color: #666;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .intent-suggestion .suggestion-dismiss:hover {
            background: #f5f5f5;
            border-color: #999;
        }

        .subscribe-form {
            margin: auto 10px auto auto;
        }

        /* Mobile adjustments for intent suggestion */
        @media (max-width: 500px) {
            .intent-suggestion {
                padding: 10px 12px;
                gap: 8px;
            }

            .intent-suggestion .suggestion-text {
                min-width: 100%;
                margin-bottom: 4px;
            }

            .intent-suggestion .suggestion-accept {
                flex: 1;
                padding: 10px 12px;
            }
        }

        /* Results area */
        .results-area {
            margin-top: 25px;
            padding-top: 20px;
            border-top: 2px solid #e0e0e0;
            display: none;
        }

        .results-area.visible {
            display: block;
        }

        .results-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 15px;
        }

        .result-card {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 10px;
            padding: 16px;
            margin-bottom: 12px;
            transition: all 0.2s;
        }

        .result-card:hover {
            border-color: #1976d2;
            box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
        }

        .result-name {
            font-size: 18px;
            font-weight: 600;
            color: #1976d2;
            margin-bottom: 4px;
        }

        .result-uri {
            font-size: 12px;
            color: #999;
            word-break: break-all;
        }

        .result-type {
            display: inline-block;
            font-size: 11px;
            padding: 3px 8px;
            background: #e3f2fd;
            color: #1565c0;
            border-radius: 4px;
            margin-top: 8px;
        }

        .result-subject {
            font-size: 13px;
            color: #666;
            margin-bottom: 4px;
        }

        .no-results {
            padding: 30px;
            text-align: center;
            color: #999;
            font-style: italic;
        }

        .loading-message {
            padding: 30px;
            text-align: center;
            color: #666;
        }

        .error-message {
            padding: 15px;
            background: #ffebee;
            color: #c62828;
            border-radius: 8px;
            margin-top: 15px;
        }

        /* Results sections for multiple sources */
        .results-section {
            margin-bottom: 20px;
        }

        .results-section-header {
            margin-bottom: 12px;
        }

        .source-badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 16px;
            font-size: 13px;
            font-weight: 600;
        }

        .source-badge.yago {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .source-badge.wikipedia {
            background: #fff3e0;
            color: #e65100;
        }

        /* ==============================================
           HELP FEATURE STYLES
           ============================================== */

        /* Help intent row: "in order to" input */
        .help-intent-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-top: 16px;
            padding: 16px;
            background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
            border-radius: 12px;
            border: 1px solid #c8e6c9;
        }

        .help-intent-label {
            font-weight: 600;
            color: #2e7d32;
            white-space: nowrap;
            font-size: 14px;
        }

        .help-intent-input {
            flex: 1;
            padding: 10px 14px;
            border: 2px solid #a5d6a7;
            border-radius: 8px;
            font-size: 15px;
            background: white;
            transition: border-color 0.2s;
        }

        .help-intent-input:focus {
            outline: none;
            border-color: #4caf50;
        }

        .help-search-btn {
            padding: 10px 20px;
            background: #4caf50;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
            white-space: nowrap;
        }

        .help-search-btn:hover {
            background: #388e3c;
        }

        /* Help results area */
        .help-results-area {
            margin-top: 20px;
        }

        .help-loading {
            text-align: center;
            padding: 40px;
            color: #666;
            font-size: 16px;
        }

        .help-empty {
            text-align: center;
            color: #666;
            margin-bottom: 30px;
        }

        .help-empty p {
            margin-bottom: 8px;
        }

        .help-hint {
            font-size: 13px;
            color: #999;
            font-style: italic;
        }

        .help-section {
            margin-bottom: 24px;
        }

        .help-section-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 2px solid #e0e0e0;
        }

        .help-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .help-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px 16px;
            padding-left: 0px;
            /* background: #fafafa;
            border-radius: 8px;
            border: 1px solid #e0e0e0;
            transition: background 0.2s, border-color 0.2s; */
        }

        /* .help-item:hover {
            background: #f5f5f5;
            border-color: #bdbdbd;
        } */

        /* .help-alternative {
            background: #fff8e1;
            border-color: #ffe082;
        }

        .help-alternative:hover {
            background: #fff3cd;
        } */

        /* Related answers (from similar queries) */
        .help-related-answers {
            border-left: 3px solid #9c27b0;
            background: linear-gradient(to right, #f3e5f5, transparent);
            padding-left: 16px;
        }

        .help-answer {
            background: #faf0ff;
            border-color: #e1bee7;
        }

        .help-answer:hover {
            background: #f3e5f5;
            border-color: #ce93d8;
        }

        .help-answer-link {
            color: #7b1fa2;
            text-decoration: none;
            font-weight: 500;
        }

        .help-answer-link:hover {
            text-decoration: underline;
        }

        .help-matched-query {
            font-size: 11px;
            color: #888;
            font-style: italic;
            margin-top: 4px;
        }

        .help-rank {
            width: 24px;
            height: 24px;
            background: #e0e0e0;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 600;
            color: #666;
            flex-shrink: 0;
        }

        .help-content {
            flex: 1;
            min-width: 0;
        }

        .help-text {
            font-size: 15px;
            color: #333;
            /* font-weight: 500; */
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        .help-rank {
            /* display: none; */
        }

        .help-desc {
            font-size: 13px;
            color: #666;
            margin-top: 4px;
        }

        .help-votes {
            display: flex;
            /* flex-direction: column; */
            align-items: center;
            gap: 2px;
            margin-top: 10px;
  margin-left: -8px;
        }

        .vote-btn {
            width: 28px;
            height: 24px;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 12px;
            color: #999;
            border-radius: 4px;
            transition: background 0.2s, color 0.2s;
        }

        .vote-btn:hover {
            background: #e0e0e0;
        }

        .vote-btn.upvote:hover {
            color: #4caf50;
        }

        .vote-btn.downvote:hover {
            color: #f44336;
        }

        .vote-score {
            font-size: 13px;
            font-weight: 600;
            color: #666;
        }

        /* Help submit form */
        .help-submit-form {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        .help-submit-input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            font-size: 14px;
        }

        .help-submit-input:focus {
            outline: none;
            border-color: #4caf50;
        }

        .help-submit-btn {
            padding: 8px 16px;
            background: #e8f5e9;
            color: #2e7d32;
            border: 1px solid #a5d6a7;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s;
        }

        .help-submit-btn:hover {
            background: #c8e6c9;
        }

        /* ==============================================
           ANSWER SUBMISSION STYLES
           ============================================== */

           #find-answer summary {
            text-align: center;
            list-style: none;
           }

           /* #find-answer[open] summary {
            list-style: none !important;
           } */

        .answer-submission-section {
            margin-top: 40px;
            /* border: 1px solid #e0e0e0; */
            border-radius: 12px;
            /* overflow: hidden;
            background: #fafafa; */
        }

        .answer-submission-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 18px;
            background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
            cursor: pointer;
            transition: background 0.2s;
            display: none;
        }

        /* .answer-submission-header:hover {
            background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
        } */

        /* .answer-submission-icon {
            font-size: 20px;
        }

        .answer-submission-title {
            flex: 1;
            font-size: 14px;
            font-weight: 500;
            color: #e65100;
        }

        .answer-submission-toggle {
            color: #e65100;
            font-size: 12px;
        } */

        #factsParsedResult {
            display: none !important;
        }

        .answer-submission-body {
            /* padding: 18px; */
            background: white;
            /* border-top: 1px solid #ffe0b2; */
        }

        .answer-input-group {
            margin-bottom: 16px;
        }

        .answer-input-group label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: #555;
            margin-bottom: 6px;
        }

        .answer-url-input {
            width: 100%;
            padding: 10px 14px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 14px;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }

        .answer-url-input:focus {
            outline: none;
            border-color: #ff9800;
        }

        .answer-text-input {
            width: 100%;
            padding: 10px 14px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            min-height: 60px;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }

        .answer-text-input:focus {
            outline: none;
            border-color: #ff9800;
        }

        .answer-submit-row {
            display: flex;
            gap: 12px;
            margin-left: auto;
            width: fit-content;
        }

        .answer-type-select {
            padding: 10px 14px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 14px;
            background: white;
            cursor: pointer;
            min-width: 150px;
        }

        .answer-type-select:focus {
            outline: none;
            border-color: #ff9800;
        }

        .answer-submit-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.1s, box-shadow 0.2s;
        }

        .answer-submit-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
        }

        .answer-submit-btn:active {
            transform: translateY(0);
        }

        .answer-submit-status {
            font-size: 13px;
            font-weight: 500;
        }

                #modal-background {
            position: fixed;
            background: black;
            opacity: 25%;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            display: block;
            z-index: 10;
            display: none;
        }

        .modal {
            position: fixed;
            background: white;
            border-radius: 10px;
            /* padding: 20px; */
            max-width: 800px;
            width: 90%;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            display: block;
            z-index: 11;
            overflow-y: auto;
            max-height: 90vh;
            padding: 40px 20px 20px;
            display: none;
        }

        .modal .container {
            padding: 0px 40px;
            max-width: 500px;
        }

        .modal .badges {
            display: flex;
            margin: auto;
            width: fit-content;
            flex-wrap: wrap;
            justify-content: center;
    row-gap: 10px;
        }

        .badges div {
            padding: 3px 10px;
            background: rgb(239, 239, 239);
            margin-right: 10px;
            border-radius: 10px;
            font-size: 14px;
            text-align: center;
            border: solid 1px rgb(188, 188, 188);
        }

        .badges .energy {
            background: rgb(217, 237, 217);
            border: solid 1px rgb(151, 212, 151);
            color: rgb(27, 94, 32);
        }

        .badges .search {
            background: rgb(217, 226, 237);
            border: solid 1px rgb(151, 174, 212);
            color: rgb(32, 77, 107);
        }

        .badges .people {
            background: rgb(236, 217, 237);
            border: solid 1px rgb(212, 151, 207);
            color: rgb(107, 32, 107);
        }

        .chart {
  border: 1px solid #ccc;
  background-color: #eaeaea;
  display: flex; /* Use Flexbox for easy horizontal layout */
  height: 200px; /* Set a fixed height for the graph area */
  align-items: flex-end; /* Align bars to the bottom */
  padding: 0;
  margin: 0;
  list-style: none; /* Remove list bullets */
  width: 100%;
  max-width: 500px;
  margin-top: 40px;
}

.chart-title {
    margin-top: 20px;
    text-align: center;
}

.chart li {
  flex-grow: 1; /* Distribute space evenly */
  margin: 0 5px;
  background-color: #4ecdc4; /* Bar color */
  position: relative; /* For positioning the span label */
  display: flex;
  justify-content: center;
}

.chart li > span {
  position: absolute;
  top: -35px; /* Position the label above the bar */
  font-size: 14px;
  color: #333;
  text-align: center;
}

.chart li > span span {
    font-weight: 700;
}

.chart li span:has(> span) {
    top: -54px;
}


        .modal-background, .modal-button {
            cursor: pointer;
        }

        .modal h1 {
            margin: auto;
        }

        .modal .close {
            position: absolute;
            top: 20px;
            left: 10px;
            cursor: pointer;
            color: rgb(156, 156, 156);
        }

        div.top > div > p.modal-button:hover {
            text-decoration: underline;
        }

        div.top > div > p.fund {
            border: solid 1px grey;
            border-radius: 10px;
            padding: 10px;
            margin-left: 10px;
            cursor: pointer;
        }

        div.top .button:hover {
            transform: translateY(1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: transform 0.1s, box-shadow 0.2s;
        }

        div.top svg {
            fill: rgb(68, 68, 68);
        }

        div.top svg:hover {
            fill: black;
        }

        /* ===== RESPONSIVE STYLES ===== */

        /* Medium screens: under 800px */
        @media (max-width: 800px) {
            .input-wrapper {
                width: 100%;
            }

            .container {
                padding: 20px 16px;
            }

            body {
                padding: 40px 10px;
            }

            div.container {
                padding: 0px 0px;
            }

            #queryArea {
                padding: 30px 10px;
            }

            div.intro {
                padding: 0px 20px;
            }

            div.top {
                margin-bottom: 40px;
            }

            div.top h1 {
                margin-bottom: 0px !important;
            }

            .search-controls-row {
                justify-content: center;
            }

            .search-controls {
                margin-left: 0px;
            }

            .modal {
                max-width: 90%;
            }

            .modal form {
                max-width: 80%;
            }
        }

        /* Small screens: under 600px */
        @media (max-width: 600px) {
            .help-intent-row {
                flex-direction: column;
                align-items: stretch;
                gap: 8px;
            }

            .help-intent-label {
                text-align: center;
            }

            .help-search-btn {
                width: 100%;
            }

            .query-input,
            .highlight-layer,
            .handles-layer {
                font-size: 18px;
                padding: 16px 18px;
            }

            .query-input {
                min-height: 58px;
            }

            .intent-btn {
                padding: 10px 14px;
                font-size: 14px;
            }

            .submit-btn {
                padding: 10px 14px;
                font-size: 16px;
            }

            .search-controls-row {
                justify-content: center;
            }

            h1 {
                font-size: 24px;
            }

            /* Weather widget responsive - stack vertically on mobile */
            .header-row {
                flex-direction: column;
                gap: 10px;
            }

            .weather-container {
                order: 1;
            }

            .header-row h1 {
                order: 0;
            }

            .show-weather-btn {
                order: 2;
            }

            .subtitle {
                font-size: 14px;
            }

                                    .help-item {
                display: block;
            }

                        .help-rank {
  margin-bottom: 10px;
            }

            .help-content, .help-votes {
                padding-left: 5px;
            }


    #welcome-modal .container {
        padding: 0px !important;
    }
        }

                /* Mobile: inline expand/collapse instead of flyout */
        @media (max-width: 500px) {

            .chart {
                margin-top: 50px;
            }
            .chart li > span {
    top: -55px;
}
            .chart li:first-of-type > span {
    top: -38px;
}


            .chart li span:has(> span) {
    top: -75px;
}

            .option {
                border-bottom: 1px solid #f0f0f0;
            }

            .option:last-child {
                border-bottom: none;
            }

            .source-list {
                position: static;
                background: transparent;
                border: none;
                border-radius: 0;
                box-shadow: none;
                min-width: auto;
                padding: 0 0 0 28px;
                margin: 0;
                display: block;
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.2s ease-out, padding-bottom 0.2s ease-out;
            }

            .source-list::before {
                display: none;
            }

            /* Disable hover expand on mobile */
            .option:hover .source-list {
                max-height: 0;
            }

            /* Only expand via .expanded class (tap) */
            .option.expanded .source-list,
            .option.expanded:hover .source-list {
                max-height: 300px;
                padding-bottom: 8px;
            }

            .source-option {
                white-space: normal;
            }

            /* Rotate chevron when expanded */
            .option.expanded .option-title .chevron {
                transform: rotate(90deg);
            }

            .option-title .chevron {
                transition: transform 0.2s ease;
            }

            .search-controls {
                margin-left: 0px;
            }

            .search-controls-row {
                justify-content: flex-start;
            }

            .search-controls {
                display: contents;
            }

            .source-list {
                padding-left: 0px;
            }

            #select {
                margin-left: 0px;
                margin-right: auto;
            }

            #submitBtn {
                margin-left: auto;
                margin-right: 0px;
                width: 50px;
            }

            body {
                padding: 10px 0px 80px !important;
                                margin-left: 0px !important;
                margin-right: 0px !important;
            }

            .intro {
                padding: 0px !important;
            }

            .intent-menu {
                min-width: 140px;
            }

                        #wiki-0 {
                padding: 6px;
            }
        }

        /* Extra small screens: under 450px */
        @media (max-width: 450px) {


            .chart li span:has(> span) {
    top: -86px;
}

            #factsParsingUI, #factsYagoResults {
                padding: 0px;
  background: none;
  border: none;
            }

            #wiki-0 {
                padding: 0px;
            }
            
            .container {
                padding: 12px 8px;
            }

            .query-input,
            .highlight-layer,
            .handles-layer {
                font-size: 16px;
                padding: 14px 12px;
            }

            .query-input {
                min-height: 52px;
            }

            /* Keep search controls on one line - hide label */
            .intent-btn .label {
                /* display: none; */
            }

            .intent-btn {
                padding: 8px 10px;
            }

            .intent-auto-badge {
                display: none;
            }

            .submit-btn {
                padding: 8px 12px;
                font-size: 14px;
            }

            .help-intent-input {
                font-size: 14px;
                padding: 8px 10px;
            }

            .help-section-title {
                font-size: 14px;
            }

            .help-item {
                padding: 10px;
            }

            .examples {
                padding: 12px;
            }

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

            .help-submit-form {
                display: block;
            }

            .help-submit-btn {
                margin: auto;
                display: block;
                margin-top: 10px;
            }

                    .modal {
            width: 95%;
        }

        .modal h1 {
            margin-top: 10px;
        }

        .modal .close {
            top: 10px;
        }
        }

        /* Minimum width: 300px */
        @media (max-width: 350px) {
            .intent-btn .icon {
                font-size: 14px;
            }

            .intent-btn {
                padding: 6px 8px;
            }

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

            h1 {
                font-size: 20px;
            }

            .subtitle {
                display: none;
            }
        }

                .intro p, .intro h1, .modal p {
            margin-bottom: 19px;
        }

        .intro br {
            display: none;
        }

        .intro details > *:not(summary) {
            padding-left: 20px;
        }

        .intro summary {
            cursor: pointer;
        }

        .top {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        #modal-background {
            position: fixed;
            background: black;
            opacity: 25%;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            display: none;
            z-index: 10;
        }

        button {
            cursor: pointer;
        }

        #subscribe-modal button {
            margin: auto;
            margin-left: 5px;
            background: black;
            color: white;
            padding: 5px 15px;
            border-radius: 10px;
            font-size: 16px;
            border: solid 1px gray;
            /* border: solid 1px #b4b4b4; 
            padding: 5px 10px; 
            border-radius: 10px;     
            background: linear-gradient(45deg, #ccebf1, #ecf6fd);
            color: black; */
            display: block;
            background: #1976d2;
            border: solid 1px #3990e8;
                background: #4d4d4d;
            border: solid 1px #f0f0f0;
            background: black;
        }

        #subscribe-modal {
            background: linear-gradient(45deg, #e9f5ff, #ffffff);
        }

        #subscribe-modal label {
            color: gray;
            font-size: 14px;
            margin-bottom: 2px;
        }

        #subscribe-modal button:hover {
            background: #1e88e5;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: transform 0.1s, box-shadow 0.2s; 
            background: rgb(91, 91, 91);
            background: rgb(37, 37, 37);
        }

        #subscribe-modal form, #subscribe-modal label {
            display: block;
        }

        #subscribe-modal input {
            width: 400px;
            max-width: 100%;
            font-size: 16px;
            padding: 5px;
        }

        #subscribe-modal form {
            width: fit-content;
            margin: auto;
        }

        #subscribe-modal form > div {
            margin-bottom: 20px;
        }

        .option > div:nth-of-type(2) {
            display: none;
        }

        .option:hover > div:nth-of-type(2) {
            display: block;
        }
        
        .select .option.selected {
            display: block;
            position: relative;
        }

        .select .option.selected > div:first-of-type::after {
            content: '▼';
            font-size: 12px;
            margin: auto;
            /* margin-left: 10px;
            right: 7%; */
            right: 0%;
            position: absolute;
            color: black;
                        transition: transform 0.2s;
        }

        .select.open .option.selected > div:first-of-type::after {
            content: '▼';
            font-size: 12px;
            margin: auto;
            margin-left: 10px;
            transform: rotate(180deg);
                       right: 0%;
            position: absolute;
            color: black;
            transition: transform 0.2s;
        }

        .select .option:not(.selected) {
            display: none;
        }

        .select {
            width: fit-content;
            display: block;
        }

        .select.open .option {
            display: block;
        }

        .option {
            position: relative;
            font-size: 14px;
        }

        .first .option {
            font-size: 16px;
        }

        .option > div:nth-of-type(2) {
            position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  background: white;
  height: fit-content;
        }

        .source-option {
            font-weight: normal;
        }

        .select {
            position: relative;
        }

        .select.open .intent-menu {
            display: block;
        }

        .option-title:not(.empty)::after {
            content: '▶';
            color: gray;
            position: absolute;
            right: 7%;
            font-size: 12px;
            margin: auto;
            margin-left: 10px;
            margin-left: auto;
            font-size: 10px;
            color: #999;
        }

        .clue.hidden {
            display: none;
        }

        #clue-help {
            margin-bottom: 10px;
        }

        #clue-help h3 {
            color: black;
            text-align: left;
            margin-top: 30px;
        }

        /* ========== FACTS INTENT STYLES - START ========== */
        /* This section is self-contained and can be removed without breaking other functionality */

        /* Facts Parsing UI Styles */
        .facts-parsing-ui {
            /* margin-top: 15px; */
            /* padding: 15px; */
            /* background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e0e0e0; */
            padding: 5px 15px 20px;
        }

        .facts-labels {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }

        .fact-label {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .fact-label:hover {
            filter: brightness(0.95);
        }

        .fact-label-topic {
            background: #e3f2fd;
            color: #1565c0;
            border: 1px solid #90caf9;
        }

        .fact-label-property {
            background: #e8f5e9;
            color: #2e7d32;
            border: 1px solid #a5d6a7;
        }

        .fact-label-filter {
            background: #fff3e0;
            color: #e65100;
            border: 1px solid #ffcc80;
        }

        .fact-label-rank {
            background: #fce4ec;
            color: #c2185b;
            border: 1px solid #f48fb1;
        }

        .fact-label-count {
            background: #f3e5f5;
            color: #7b1fa2;
            border: 1px solid #ce93d8;
        }

        .fact-label-type {
            font-size: 11px;
            opacity: 0.8;
            font-weight: normal;
        }

        .facts-parsed-result {
            font-size: 14px;
            color: #555;
            margin-bottom: 12px;
            padding: 10px;
            background: white;
            border-radius: 6px;
            border: 1px solid #eee;
        }

        .facts-parsed-result strong {
            color: #333;
        }

        .facts-parsed-result em {
            color: #1565c0;
        }

        .facts-sources {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .facts-sources-label {
            font-size: 14px;
            color: #666;
        }

        .facts-source-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 8px 14px;
            font-size: 14px;
            font-weight: 500;
            color: #333;
            background: white;
            border: 1px solid #ddd;
            border-radius: 6px;
            text-decoration: none;
            cursor: pointer;
            transition: all 0.2s;
        }

        .facts-source-btn:hover {
            background: #f5f5f5;
            border-color: #bbb;
        }

        .facts-confidence {
            display: inline-block;
            margin-left: 10px;
            padding: 2px 8px;
            font-size: 11px;
            border-radius: 10px;
        }

        .facts-confidence-high {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .facts-confidence-medium {
            background: #fff3e0;
            color: #e65100;
        }

        .facts-confidence-low {
            background: #ffebee;
            color: #c62828;
        }

        @media (max-width: 600px) {
            .facts-parsing-ui {
                padding: 12px;
            }

            .fact-label {
                padding: 5px 10px;
                font-size: 13px;
            }

            .facts-source-btn {
                padding: 6px 10px;
                font-size: 13px;
            }

            /* Mobile: Stack chips vertically */
            .facts-labels-layer {
                gap: 8px;
            }

            .facts-label-container {
                flex-wrap: wrap;
            }

            .facts-entity-input {
                min-width: 80px;
                max-width: 150px;
                font-size: 12px;
            }

            .facts-role-type-chip {
                font-size: 12px;
                padding: 5px 10px;
            }

            /* Mobile: Types submenu inline */
            .facts-role-item.has-submenu:hover .facts-types-submenu {
                display: none;
            }

            .facts-role-item.expanded .facts-types-submenu {
                display: block;
                position: static;
                box-shadow: none;
                border: none;
                margin-left: 0;
                padding-left: 16px;
                background: transparent;
            }
        }

/* YAGO Results Styles - Clickable Cards with Inline Wikipedia */
.facts-yago-results {
    margin-top: 15px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.facts-yago-status {
    margin-bottom: 12px;
    font-size: 14px;
}

.yago-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.yago-click-hint {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.yago-status-loading { color: #1976d2; }
.yago-status-success { color: #2e7d32; font-weight: 500; }
.yago-status-error { color: #c62828; }
.yago-status-warning { color: #f57c00; }
.yago-status-info { color: #666; }
.yago-status-info:not(.saved) { font-style: italic;}

/* Results list container */
.facts-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Result wrapper - contains card + wiki section */
.yago-result-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.yago-result-wrapper.expanded {
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
}

/* Clickable result card */
.result-card.yago-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.result-card.yago-result:hover {
    background: #e3f2fd;
}

.result-card.yago-result.selected {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #1976d2;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-predicate {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.result-value {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
}

.result-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.result-badge.primary {
    background: #4caf50;
    color: white;
}

.result-badge.entity {
    background: #2196f3;
    color: white;
}

.result-badge.literal {
    background: #9e9e9e;
    color: white;
}

.result-badge.saved {
    background: #ff9800;
    color: white;
    display: none;
}

.result-badge.yago-source {
    background: linear-gradient(135deg, #6a1b9a 0%, #8e24aa 100%);
    color: white;
    display: none;
}

.result-badge.wikidata-source {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    color: white;
    display: none;
}

/* Saved Answers from Community (SQLite) */
.saved-answers-container {
    margin-bottom: 12px;
}

.saved-answers-section {
    padding: 12px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    border-radius: 8px;
    border: 1px solid #ffcc80;
}

.saved-answers-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.saved-answers-badge {
    font-size: 12px;
    font-weight: 600;
    color: #e65100;
}

.saved-answers-count {
    font-size: 11px;
    color: #bf360c;
    background: rgba(255, 152, 0, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.saved-answer-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #ffe0b2;
    transition: all 0.2s ease;
}

.saved-answer-card:last-child {
    margin-bottom: 0;
}

.saved-answer-card:hover {
    border-color: #ff9800;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.15);
}

.saved-answer-content {
    flex: 1;
}

.saved-answer-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    color: inherit;
}

.saved-answer-title {
    font-size: 15px;
    font-weight: 500;
    color: #1976d2;
}

.saved-answer-link:hover .saved-answer-title {
    text-decoration: underline;
}

.saved-answer-url {
    font-size: 12px;
    color: #757575;
    font-family: monospace;
}

.saved-answer-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* Markdown styling for saved answers */
.saved-answer-markdown h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1a1a1a;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
}

.saved-answer-markdown h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #333;
}

.saved-answer-markdown h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 12px 0 6px 0;
    color: #444;
}

.saved-answer-markdown p {
    margin: 0 0 10px 0;
}

.saved-answer-markdown p:last-child {
    margin-bottom: 0;
}

.saved-answer-markdown ul {
    margin: 8px 0;
    padding-left: 20px;
}

.saved-answer-markdown li {
    margin: 4px 0;
    line-height: 1.5;
}

.saved-answer-markdown strong {
    font-weight: 600;
}

.saved-answer-markdown em {
    font-style: italic;
}

.saved-answer-markdown code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
}

.saved-answer-markdown a {
    color: #1976d2;
    text-decoration: none;
}

.saved-answer-markdown a:hover {
    text-decoration: underline;
}

.saved-answer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-answer-votes {
    font-size: 11px;
    color: #666;
}

/* Inline Wikipedia section */
.inline-wiki-section {
    display: none;
    padding: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.yago-result-wrapper.expanded .inline-wiki-section {
    display: block;
    padding: 16px;
}

.wiki-loading {
    color: #666;
    font-style: italic;
    padding: 12px;
    text-align: center;
}

.inline-wiki-card {
    background: #fafafa;
    border-radius: 6px;
    padding: 12px;
}

.inline-wiki-card.no-wiki,
.inline-wiki-card.error {
    background: #fff3e0;
    color: #e65100;
}

.inline-wiki-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.source-badge.wikipedia {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.wiki-title {
    font-size: 16px;
    font-weight: 600;
    color: #1976d2;
    text-decoration: none;
}

.wiki-title:hover {
    text-decoration: underline;
}

.wiki-thumbnail {
    float: right;
    max-width: 120px;
    max-height: 120px;
    margin: 0 0 10px 10px;
    border-radius: 4px;
}

.wiki-summary {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 10px;
}

.wiki-link {
    display: inline-block;
    color: #1976d2;
    font-size: 13px;
    text-decoration: none;
}

.wiki-link:hover {
    text-decoration: underline;
}

/* Topic Wikipedia section - appears at the top of results */
.topic-wiki-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.topic-wiki-header {
    padding: 12px 16px;
    background: rgba(255,255,255,0.5);
    border-bottom: 1px solid #a5d6a7;
}

.topic-wiki-title {
    font-size: 15px;
    color: #2e7d32;
}

.topic-wiki-content {
    padding: 16px;
    background: #fff;
}

.topic-wiki-content .inline-wiki-card {
    background: #fafafa;
}

.no-results-inline,
.error-inline {
    font-size: 13px;
    margin-left: 10px;
}

/* Alternatives section */
.yago-alternatives {
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
}

.yago-alt-label {
    color: #666;
    font-size: 13px;
    margin-right: 8px;
}

.yago-alt-btn {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    margin: 2px;
    transition: all 0.2s;
}

.yago-alt-btn:hover {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.no-results {
    color: #666;
    font-style: italic;
    padding: 12px;
    text-align: center;
}

/* ========== FACTS INTENT STYLES - START ========== */
/* This section is self-contained for the Facts intent overlay on query input */
/* HIDDEN: Overlay, highlight layer, handles, and selection dropdown are all hidden */

/* Highlight overlay - HIDDEN */
.facts-highlight-overlay {
    display: none !important;
}

/* Highlight layer - HIDDEN */
.facts-highlight-layer {
    display: none;
}

/* Handles layer - HIDDEN */
.facts-handles-layer {
    display: none;
}

/* Selection dropdown - HIDDEN */
.facts-selection-dropdown {
    display: none !important;
}

/* Highlight colors by role - kept for potential future use */
.facts-hl-topic { background-color: rgba(76, 175, 80, 0.25); border-radius: 3px; padding: 2px 0; }
.facts-hl-property { background-color: rgba(33, 150, 243, 0.25); border-radius: 3px; padding: 2px 0; }
.facts-hl-filter { background-color: rgba(255, 152, 0, 0.25); border-radius: 3px; padding: 2px 0; }
.facts-hl-rank { background-color: rgba(156, 39, 176, 0.25); border-radius: 3px; padding: 2px 0; }
.facts-hl-count { background-color: rgba(244, 67, 54, 0.25); border-radius: 3px; padding: 2px 0; }
.facts-hl-skip { background-color: rgba(158, 158, 158, 0.2); border-radius: 3px; padding: 2px 0; }

/* Highlight span wrapper - HIDDEN */
.facts-highlight-span {
    display: none;
}

/* Drag handles - HIDDEN */
.facts-drag-handle {
    display: none;
}

/* ========== FACTS SEMANTIC UI - LABEL CHIPS (TWO-PART DESIGN) ========== */

.facts-labels-layer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* Container for the two-part chip: [Entity Input] → [Role/Type Chip] */
.facts-label-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Arrow separator between entity and role/type */
.facts-chip-arrow {
    color: #666;
    font-size: 14px;
    user-select: none;
}

/* ===== Part 1: Editable Entity Input ===== */
.facts-entity-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.facts-entity-input {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    min-width: 100px;
    max-width: 200px;
    background: white;
    color: #333;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.facts-entity-input:focus {
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.2);
}

/* Entity input colors by role */
.facts-entity-input.entity-topic {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}
.facts-entity-input.entity-topic:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.facts-entity-input.entity-property {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}
.facts-entity-input.entity-property:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

.facts-entity-input.entity-filter {
    background: #fff3e0;
    border-color: #ffcc80;
    color: #e65100;
}
.facts-entity-input.entity-filter:focus {
    border-color: #e65100;
    box-shadow: 0 0 0 2px rgba(230, 81, 0, 0.2);
}

.facts-entity-input.entity-rank {
    background: #f3e5f5;
    border-color: #ce93d8;
    color: #7b1fa2;
}
.facts-entity-input.entity-rank:focus {
    border-color: #7b1fa2;
    box-shadow: 0 0 0 2px rgba(123, 31, 162, 0.2);
}

.facts-entity-input.entity-count {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}
.facts-entity-input.entity-count:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.2);
}

.facts-entity-input.entity-skip {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #757575;
}
.facts-entity-input.entity-skip:focus {
    border-color: #757575;
    box-shadow: 0 0 0 2px rgba(117, 117, 117, 0.2);
}

.facts-entity-arrow {
    position: absolute;
    right: 8px;
    font-size: 10px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.facts-entity-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1001;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.facts-entity-dropdown.visible {
    display: block;
}

.facts-entity-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.facts-entity-dropdown-item:hover {
    background: #f5f5f5;
}

.facts-entity-dropdown-item .entity-label {
    flex: 1;
}

.facts-entity-dropdown-item .entity-popularity {
    font-size: 11px;
    color: #888;
    margin-left: 8px;
}

.facts-entity-dropdown-empty {
    padding: 12px;
    color: #999;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

/* ===== Part 2: Role/Type Chip with Two-Level Dropdown ===== */
.facts-role-type-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.facts-role-type-chip .arrow {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.facts-role-type-chip:hover .arrow {
    opacity: 1;
}

/* Label colors by role (applied to role/type chip) */
.facts-label-topic { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.facts-label-property { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.facts-label-filter { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.facts-label-rank { background: #f3e5f5; color: #7b1fa2; border: 1px solid #ce93d8; }
.facts-label-count { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.facts-label-skip { background: #f5f5f5; color: #757575; border: 1px solid #e0e0e0; }

/* ===== Expected Type Chip (shows what the query is looking for) ===== */
.facts-expected-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

.facts-expected-type-chip .facts-chip-arrow {
    color: #888;
    font-size: 16px;
}

.facts-expected-type-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Role/Type dropdown */
.facts-role-type-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 160px;
    margin-top: 4px;
    padding: 4px 0;
}

.facts-role-type-dropdown.visible {
    display: block;
}

/* Role item with optional types submenu */
.facts-role-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.facts-role-item:hover {
    background: #f5f5f5;
}

.facts-role-item.selected {
    background: #e3f2fd;
    font-weight: 500;
}

.facts-role-item .role-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.facts-role-item .submenu-arrow {
    font-size: 10px;
    color: #999;
}

/* Types submenu - appears on hover (desktop) */
.facts-types-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 140px;
    margin-left: 4px;
    padding: 4px 0;
    z-index: 1002;
}

/* Invisible bridge for smoother hover */
.facts-types-submenu::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 12px;
    background: transparent;
}

/* Show types submenu on hover (desktop) */
.facts-role-item.has-submenu:hover .facts-types-submenu,
.facts-types-submenu:hover {
    display: block;
}

/* Show types submenu when expanded (mobile/touch) */
.facts-role-item.expanded .facts-types-submenu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    margin-left: 0;
    padding-left: 16px;
    background: transparent;
}

.facts-type-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.facts-type-item:hover {
    background: #f5f5f5;
}

.facts-type-item.selected {
    background: #e3f2fd;
    font-weight: 500;
}

.facts-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.facts-remove-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #c62828;
    transition: background 0.15s;
}

.facts-remove-item:hover {
    background: #ffebee;
}

/* ========== FACTS RESULT CARD - ENHANCED LAYOUT ========== */

.result-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.result-subject {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.result-subject em {
    font-style: normal;
    color: #1565c0;
    font-weight: 500;
}

.result-uri {
    font-size: 11px;
    color: #999;
    font-family: 'SF Mono', Consolas, monospace;
    margin-bottom: 6px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-type {
    font-size: 11px;
    color: #666;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* Update result card for vertical layout */
.result-card.yago-result {
    display: block;
    padding: 12px 16px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .facts-yago-results {
        background: #2a2a2a;
        border-color: #444;
    }

    .yago-click-hint { color: #999; }

    .yago-result-wrapper {
        border-color: #444;
    }

    .yago-result-wrapper.expanded {
        border-color: #42a5f5;
        box-shadow: 0 2px 8px rgba(66, 165, 245, 0.2);
    }

    .result-card.yago-result {
        background: #333;
    }

    .result-card.yago-result:hover {
        background: #1e3a5f;
    }

    .result-card.yago-result.selected {
        background: linear-gradient(135deg, #1e3a5f 0%, #0d47a1 100%);
    }

    .result-predicate { color: #aaa; }
    .result-value { color: #fff; }

    .inline-wiki-section {
        background: #1a1a1a;
        border-color: #444;
    }

    .inline-wiki-card {
        background: #2a2a2a;
    }

    .inline-wiki-card.no-wiki,
    .inline-wiki-card.error {
        background: #3e2723;
        color: #ffab91;
    }

    .source-badge.wikipedia {
        background: #333;
        color: #eee;
    }

    .wiki-title { color: #64b5f6; }
    .wiki-summary { color: #ddd; }
    .wiki-link { color: #64b5f6; }

    /* Topic wiki section - dark mode */
    .topic-wiki-section {
        background: linear-gradient(135deg, #1b3a1e 0%, #2e4d32 100%);
        border-color: #4caf50;
    }

    .topic-wiki-header {
        background: rgba(0,0,0,0.2);
        border-color: #4caf50;
    }

    .topic-wiki-title {
        color: #81c784;
    }

    .topic-wiki-content {
        background: #1a1a1a;
    }

    .topic-wiki-content .inline-wiki-card {
        background: #2a2a2a;
    }

    .yago-alternatives {
        background: #333;
        border-color: #444;
    }

    .yago-alt-btn {
        background: #1e3a5f;
        color: #90caf9;
        border-color: #1565c0;
    }

    .yago-alt-btn:hover {
        background: #1976d2;
        color: white;
    }

    /* Dark mode: Saved answers section */
    .saved-answers-section {
        background: linear-gradient(135deg, #3e2723 0%, #4e342e 100%);
        border-color: #8d6e63;
    }

    .saved-answers-badge {
        color: #ffcc80;
    }

    .saved-answers-count {
        color: #ffab91;
        background: rgba(255, 152, 0, 0.15);
    }

    .saved-answer-card {
        background: #2a2a2a;
        border-color: #5d4037;
    }

    .saved-answer-card:hover {
        border-color: #ff9800;
        box-shadow: 0 2px 6px rgba(255, 152, 0, 0.2);
    }

    .saved-answer-title {
        color: #90caf9;
    }

    .saved-answer-url {
        color: #888;
    }

    .saved-answer-text {
        color: #ddd;
    }

    /* Dark mode: Markdown styling for saved answers */
    .saved-answer-markdown h2 {
        color: #fff;
        border-bottom-color: #555;
    }

    .saved-answer-markdown h3 {
        color: #eee;
    }

    .saved-answer-markdown h4 {
        color: #ddd;
    }

    .saved-answer-markdown code {
        background: #3a3a3a;
        color: #e0e0e0;
    }

    .saved-answer-markdown a {
        color: #64b5f6;
    }

    .saved-answer-votes {
        color: #aaa;
    }

    /* Dark mode: Result card enhanced layout */
    .result-name { color: #fff; }
    .result-subject { color: #aaa; }
    .result-subject em { color: #64b5f6; }
    .result-uri { color: #777; }
    .result-type { background: #444; color: #aaa; }
    .result-meta { color: #bbb; }

    /* Dark mode: Entity input (base) */
    .facts-entity-input {
        background: #2a2a2a;
        border-color: #555;
        color: #eee;
    }
    .facts-entity-input:focus {
        border-color: #42a5f5;
    }

    /* Dark mode: Entity input colors by role */
    .facts-entity-input.entity-topic {
        background: #1b5e20;
        border-color: #2e7d32;
        color: #a5d6a7;
    }
    .facts-entity-input.entity-property {
        background: #0d47a1;
        border-color: #1565c0;
        color: #90caf9;
    }
    .facts-entity-input.entity-filter {
        background: #bf360c;
        border-color: #e65100;
        color: #ffcc80;
    }
    .facts-entity-input.entity-rank {
        background: #4a148c;
        border-color: #7b1fa2;
        color: #ce93d8;
    }
    .facts-entity-input.entity-count {
        background: #b71c1c;
        border-color: #c62828;
        color: #ef9a9a;
    }
    .facts-entity-input.entity-skip {
        background: #424242;
        border-color: #757575;
        color: #bdbdbd;
    }

    .facts-entity-arrow { color: #aaa; }
    .facts-chip-arrow { color: #aaa; }

    .facts-entity-dropdown,
    .facts-role-type-dropdown,
    .facts-types-submenu {
        background: #333;
        border-color: #555;
    }

    .facts-entity-dropdown-item:hover,
    .facts-role-item:hover,
    .facts-type-item:hover {
        background: #444;
    }

    .facts-entity-dropdown-empty { color: #777; }
    .facts-entity-dropdown-item .entity-popularity { color: #888; }

    /* Dark mode: Role/Type chips */
    .facts-role-type-chip { background: #333; border-color: #555; }
    .facts-label-topic { background: #1b5e20; color: #a5d6a7; border-color: #2e7d32; }
    .facts-label-property { background: #0d47a1; color: #90caf9; border-color: #1565c0; }
    .facts-label-filter { background: #e65100; color: #ffcc80; border-color: #ff9800; }
    .facts-label-rank { background: #4a148c; color: #ce93d8; border-color: #7b1fa2; }
    .facts-label-count { background: #b71c1c; color: #ef9a9a; border-color: #c62828; }
    .facts-label-skip { background: #424242; color: #bdbdbd; border-color: #757575; }

    .facts-role-item.selected,
    .facts-type-item.selected { background: #1e3a5f; }

    .facts-dropdown-divider { background: #444; }
    .facts-remove-item:hover { background: #4a2020; }

    /* Dark mode: Expected type chip */
    .facts-expected-type-chip .facts-chip-arrow {
        color: #aaa;
    }

    .facts-expected-type-label {
        background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
        box-shadow: 0 2px 8px rgba(90, 103, 216, 0.4);
    }
}
/* ========== FACTS INTENT STYLES - END ========== */

@media (max-width: 800px) {
                #subscribe-modal button  {
                margin: auto;
                margin-top: 10px;
            }
            #email-subscribe {
                margin: auto;
            }
}