/* ═══════════════════════════════════════════════════════════════
   Health Explorer — Styles
   Reuses CSS variables from chatbot.css (:root)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Container & Layout ──────────────────────────────────────── */
.health-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf3 100%);
    font-family: 'Inter', sans-serif;
    color: var(--text-color, #333);
}

/* ─── Header ──────────────────────────────────────────────────── */
.health-brandbar {
    background: #ffffff;
    border-bottom: 1px solid #e6e8e6;
    padding: 10px 20px;
    text-align: center;
}

.health-brandbar-link {
    display: inline-block;
    line-height: 0;
}

.health-brandbar-logo {
    height: 34px;
    width: auto;
}

.health-brandbar-link:focus-visible {
    outline: 2px solid #2d5a3d;
    outline-offset: 3px;
    border-radius: 2px;
}

@media (max-width: 600px) {
    .health-brandbar {
        padding: 8px 16px;
    }

    .health-brandbar-logo {
        height: 28px;
    }
}

.health-header {
    background: linear-gradient(135deg, #2d5a3d 0%, #3d7a52 100%);
    color: white;
    padding: 24px 0 20px;
    text-align: center;
    position: relative;
}

.health-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.health-back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    text-decoration: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.health-back-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.health-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.health-logo i {
    font-size: 26px;
    color: #a8d5ba;
}

.health-logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.health-subtitle {
    margin-top: 6px;
    font-size: 14px;
    opacity: 0.85;
    font-weight: 300;
}

/* ─── Search Section ──────────────────────────────────────────── */
.health-search-section {
    padding: 0 20px;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.health-search-wrap {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 20px 24px;
}

.health-search-input-wrap {
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border-radius: 12px;
    border: 2px solid transparent;
    padding: 4px 4px 4px 16px;
    transition: border-color 0.2s;
}

.health-search-input-wrap:focus-within {
    border-color: #3d7a52;
}

.health-search-icon {
    color: #999;
    font-size: 16px;
    flex-shrink: 0;
}

#health-query {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    color: var(--text-color, #333);
}

#health-query::placeholder {
    color: #aaa;
}

.health-search-btn {
    background: linear-gradient(135deg, #2d5a3d, #3d7a52);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

.health-search-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
}

.health-search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Suggestions */
.health-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.suggestions-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.suggestion-chip {
    background: #eef5f0;
    color: #2d5a3d;
    border: 1px solid #c8dece;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.suggestion-chip:hover {
    background: #2d5a3d;
    color: white;
    border-color: #2d5a3d;
}

/* ─── Loading State ───────────────────────────────────────────── */
.health-loading {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

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

.health-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #3d7a52;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.loading-subtext {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
}

/* ─── Intro / Empty State ─────────────────────────────────────── */
.health-intro {
    padding: 40px 20px 60px;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.intro-icon {
    font-size: 48px;
    color: #3d7a52;
    margin-bottom: 16px;
}

.intro-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2d5a3d;
    margin-bottom: 12px;
}

.intro-content > p {
    font-size: 15px;
    color: #666;
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.intro-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.intro-feature {
    background: white;
    border-radius: 12px;
    padding: 24px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.intro-feature i {
    font-size: 24px;
    color: #3d7a52;
    margin-bottom: 10px;
}

.intro-feature h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.intro-feature p {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
}

.intro-sources h3 {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.sources-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.source-badge {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-badge i {
    color: #3d7a52;
}

.source-badge.egw {
    border-color: #c8a84e;
    background: #fefbf2;
}

.source-badge.egw i {
    color: #c8a84e;
}

/* ─── Error State ─────────────────────────────────────────────── */
.health-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.health-error i {
    font-size: 36px;
    color: #d9534f;
    margin-bottom: 16px;
}

.health-error p {
    font-size: 15px;
    color: #555;
    margin-bottom: 16px;
}

.health-retry-btn {
    background: #3d7a52;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* ─── Fixed Medical Disclaimer ─────────────────────────────────
   Server-rendered, never LLM output, always visible.            */
.health-disclaimer {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 860px;
    margin: 20px auto 0;
    padding: 14px 18px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
}

.health-disclaimer-icon {
    color: #b45309;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.health-disclaimer-body {
    min-width: 0;
}

.health-disclaimer-lead {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #78350f;
    line-height: 1.45;
}

.health-disclaimer-detail {
    margin: 0;
    font-size: 13px;
    color: #92400e;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .health-disclaimer {
        margin: 16px 16px 0;
        padding: 12px 14px;
    }

    .health-disclaimer-lead { font-size: 13px; }
    .health-disclaimer-detail { font-size: 12px; }
}

/* ─── Results Area ────────────────────────────────────────────── */
.health-results {
    max-width: 860px;
    margin: 32px auto 60px;
    padding: 0 20px;
}

/* ─── LLM Response ────────────────────────────────────────────── */
.health-llm-response {
    background: white;
    border-radius: 16px;
    padding: 32px 36px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    line-height: 1.75;
    font-size: 15px;
    margin-bottom: 24px;
}

.health-llm-response h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2d5a3d;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f0ea;
}

.health-llm-response h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 20px 0 10px;
}

.health-llm-response p {
    margin-bottom: 12px;
}

.health-llm-response strong {
    color: #2d5a3d;
}

.health-llm-response ul,
.health-llm-response ol {
    margin: 8px 0 12px 20px;
}

.health-llm-response li {
    margin-bottom: 6px;
}

.health-llm-response blockquote {
    border-left: 4px solid #c8a84e;
    background: #fefbf2;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

/* ─── Section Cards (applied by JS) ───────────────────────────── */
.health-section {
    background: white;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #ddd;
}

.health-section h3 {
    margin-top: 0;
    font-size: 17px;
}

/* Root Causes — neutral blue-gray */
.section-root-causes {
    border-left-color: #4a76a8;
}

.section-root-causes h3 {
    color: #4a76a8;
}

/* Her Principle — warm amber */
.section-principle {
    border-left-color: #c8a84e;
    background: #fffdf6;
}

.section-principle h3 {
    color: #a88b2a;
}

/* Addressing Root Cause — teal */
.section-addressing {
    border-left-color: #3d9a7a;
}

.section-addressing h3 {
    color: #2d7a5a;
}

/* Where They Align — green */
.section-align {
    border-left-color: #4caf50;
    background: #f6fdf6;
}

.section-align h3 {
    color: #388e3c;
}

/* Where They Differ — neutral gray */
.section-differ {
    border-left-color: #9e9e9e;
    background: #fafafa;
}

.section-differ h3 {
    color: #616161;
}

/* Disclaimer */
.section-disclaimer {
    border-left-color: #bbb;
    background: #f9f9f9;
    font-size: 13px;
    color: #888;
}

.section-disclaimer h3 {
    color: #999;
}

/* ─── EGW Quote Cards ─────────────────────────────────────────── */
.section-egw-quotes {
    border-left-color: #c8a84e;
    background: #fffdf6;
}

.section-egw-quotes h3 {
    color: #a88b2a;
    margin-bottom: 16px;
}

.egw-quote-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.egw-quote-card.egw-quote-hidden {
    display: none;
}

.egw-quote-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.egw-citation-badge {
    background: #2d5a3d;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.egw-namespace {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.egw-score {
    font-size: 11px;
    color: #aaa;
    margin-left: auto;
}

.egw-quote-text {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    margin: 0;
    border-left: 3px solid #c8a84e;
    padding-left: 14px;
    font-style: italic;
}

.egw-show-more-btn {
    display: block;
    width: 100%;
    background: #f7f4e8;
    color: #a88b2a;
    border: 1px solid #e8dfc0;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background 0.2s;
}

.egw-show-more-btn:hover {
    background: #efe8d0;
}

/* ─── Meta Bar ────────────────────────────────────────────────── */
.health-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 12px;
    color: #aaa;
}

.meta-left,
.meta-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.meta-keywords i,
.meta-time i {
    margin-right: 4px;
}

/* ─── Text overflow safety ─────────────────────────────────────── */
.health-llm-response,
.health-section,
.egw-quote-card,
.egw-quote-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.health-llm-response li,
.health-section li {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ─── Responsive: Tablet (≤ 768px) ────────────────────────────── */
@media (max-width: 768px) {
    /* Header */
    .health-header {
        padding: 18px 0 16px;
    }

    .health-header-inner {
        padding: 0 50px;
    }

    .health-back-link {
        top: 16px;
        left: 12px;
    }

    .health-logo h1 {
        font-size: 20px;
    }

    .health-logo i {
        font-size: 22px;
    }

    .health-subtitle {
        font-size: 12px;
    }

    /* Search */
    .health-search-section {
        padding: 0 12px;
        margin-top: -16px;
    }

    .health-search-wrap {
        padding: 14px 16px;
        border-radius: 12px;
    }

    .health-search-input-wrap {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .health-search-icon {
        display: none;
    }

    #health-query {
        width: 100%;
        font-size: 14px;
        padding: 10px;
    }

    .health-search-btn {
        width: 100%;
        padding: 12px 20px;
    }

    /* Suggestions */
    .health-suggestions {
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
    }

    .suggestion-chip {
        padding: 4px 12px;
        font-size: 11px;
    }

    /* Intro */
    .health-intro {
        padding: 28px 16px 40px;
    }

    .intro-icon {
        font-size: 36px;
    }

    .intro-content h2 {
        font-size: 20px;
    }

    .intro-content > p {
        font-size: 14px;
    }

    .intro-features {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .intro-feature {
        padding: 16px 12px;
    }

    .intro-feature i {
        font-size: 20px;
    }

    .intro-feature h3 {
        font-size: 14px;
    }

    .intro-feature p {
        font-size: 12px;
    }

    .source-badge {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Results */
    .health-results {
        padding: 0 10px;
        margin: 20px auto 40px;
    }

    .health-llm-response {
        padding: 18px 16px;
        border-radius: 12px;
        font-size: 14px;
        line-height: 1.65;
    }

    .health-llm-response h2 {
        font-size: 17px;
    }

    .health-llm-response h3 {
        font-size: 15px;
    }

    .health-llm-response ul,
    .health-llm-response ol {
        margin: 6px 0 10px 14px;
        padding-left: 0;
    }

    .health-llm-response li {
        font-size: 13px;
        line-height: 1.6;
    }

    .health-llm-response blockquote {
        padding: 10px 12px;
        margin: 10px 0;
        font-size: 13px;
    }

    /* Section cards */
    .health-section {
        padding: 16px 14px;
        border-radius: 10px;
        margin-bottom: 14px;
        border-left-width: 4px;
    }

    .health-section h3 {
        font-size: 15px;
    }

    .health-section p,
    .health-section li {
        font-size: 13px;
        line-height: 1.6;
    }

    .health-section ul,
    .health-section ol {
        padding-left: 16px;
    }

    .health-section blockquote {
        padding: 8px 10px;
        font-size: 13px;
        margin: 8px 0;
    }

    /* EGW quote cards */
    .egw-quote-card {
        padding: 12px 14px;
    }

    .egw-citation-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .egw-namespace {
        font-size: 10px;
    }

    .egw-score {
        font-size: 10px;
    }

    .egw-quote-text {
        font-size: 13px;
        padding-left: 10px;
    }

    /* Meta bar */
    .health-meta-bar {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    /* Loading */
    .loading-text {
        font-size: 14px;
    }

    .loading-subtext {
        font-size: 12px;
        padding: 0 10px;
    }

    .health-spinner {
        width: 40px;
        height: 40px;
    }
}

/* ─── Responsive: Small Phone (≤ 480px) ───────────────────────── */
@media (max-width: 480px) {
    .health-header-inner {
        padding: 0 44px;
    }

    .intro-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sources-grid {
        gap: 6px;
    }

    .source-badge {
        padding: 5px 8px;
        font-size: 10px;
    }

    /* Tighter section cards */
    .health-section {
        padding: 14px 12px;
    }

    .egw-quote-card {
        padding: 10px 10px;
    }

    .egw-quote-meta {
        gap: 4px;
    }

    .egw-score {
        margin-left: 0;
        display: block;
        width: 100%;
    }
}

/* ─── Responsive: Extra Small (≤ 360px) ───────────────────────── */
@media (max-width: 360px) {
    .health-logo h1 {
        font-size: 18px;
    }

    .health-logo i {
        font-size: 20px;
    }

    .health-subtitle {
        font-size: 11px;
    }

    .health-search-wrap {
        padding: 12px;
    }

    #health-query {
        font-size: 13px;
    }

    .health-llm-response {
        padding: 14px 12px;
        font-size: 13px;
    }

    .health-llm-response h3 {
        font-size: 14px;
    }

    .health-section {
        padding: 12px 10px;
    }

    .health-section h3 {
        font-size: 14px;
    }

    .intro-content h2 {
        font-size: 18px;
    }

    .intro-content > p {
        font-size: 13px;
    }

    .egw-quote-text {
        font-size: 12px;
        padding-left: 8px;
        border-left-width: 2px;
    }

    .suggestion-chip {
        padding: 3px 10px;
        font-size: 10px;
    }

    .suggestions-label {
        font-size: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   BRIEF OVERVIEW
   ═══════════════════════════════════════════════════════════════ */

.health-brief-overview {
    background: linear-gradient(135deg, rgba(45, 90, 61, 0.08), rgba(45, 90, 61, 0.03));
    border: 1px solid rgba(45, 90, 61, 0.15);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.health-brief-overview h3 {
    color: #2d5a3d;
    font-size: 16px;
    margin: 0 0 12px 0;
}

.health-brief-overview .overview-text {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

/* ═══════════════════════════════════════════════════════════════
   INVESTIGATION QUESTION CARDS
   ═══════════════════════════════════════════════════════════════ */

.health-investigation {
    margin-bottom: 24px;
}

.health-investigation h3 {
    color: #2d5a3d;
    font-size: 16px;
    margin: 0 0 14px 0;
}

.health-question-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.health-question-card {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.health-question-card:hover {
    border-color: #2d5a3d;
    background: rgba(45, 90, 61, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.health-question-card.active {
    border-color: #2d5a3d;
    background: rgba(45, 90, 61, 0.08);
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.15);
}

.health-question-card .card-label {
    font-size: 15px;
    font-weight: 600;
    color: #1a3d28;
    margin-bottom: 8px;
    line-height: 1.4;
}

.health-question-card .card-hints {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.health-question-card .hint-egw,
.health-question-card .hint-science {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

.health-question-card .hint-egw i {
    color: #8B6914;
    margin-right: 4px;
    width: 12px;
}

.health-question-card .hint-science i {
    color: #2d5a3d;
    margin-right: 4px;
    width: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   FOCUSED ANALYSIS (Phase 2)
   ═══════════════════════════════════════════════════════════════ */

#health-focused-result:empty {
    display: none;
}

.health-focused-header {
    margin-bottom: 16px;
}

.health-focused-header h2 {
    color: #2d5a3d;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(45, 90, 61, 0.2);
}

.health-focused-header h2 i {
    margin-right: 8px;
    color: #8B6914;
}

.health-focused-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.health-focused-loading p {
    margin-top: 12px;
    color: #666;
    font-size: 15px;
}

.health-focused-error {
    background: rgba(244, 67, 54, 0.08);
    border: 1px solid rgba(244, 67, 54, 0.2);
    border-radius: 8px;
    padding: 16px;
    color: #d32f2f;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   RESEARCH MORE (collapsible)
   ═══════════════════════════════════════════════════════════════ */

.health-research-more {
    margin-top: 24px;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.health-research-more-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(45, 90, 61, 0.06);
    border: 1px solid rgba(45, 90, 61, 0.15);
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #2d5a3d;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.health-research-more-toggle:hover {
    background: rgba(45, 90, 61, 0.12);
    border-color: rgba(45, 90, 61, 0.3);
}

.health-research-more-toggle i {
    transition: transform 0.3s;
}

.health-research-more-content {
    margin-top: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE: Question Cards, Focused, Research More
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .health-question-cards {
        grid-template-columns: 1fr;
    }

    .health-question-card {
        padding: 14px 16px;
    }

    .health-brief-overview {
        padding: 16px 18px;
    }

    .health-focused-header h2 {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .health-question-card .card-label {
        font-size: 14px;
    }

    .health-question-card .hint-egw,
    .health-question-card .hint-science {
        font-size: 11px;
    }

    .health-research-more-toggle {
        padding: 10px 14px;
        font-size: 13px;
    }

    .health-brief-overview {
        padding: 14px;
    }

    .health-brief-overview h3 {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   REFERENCE LINKS & CITATION BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.reference-link {
    color: #2d5a3d;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
}

.reference-link:hover {
    color: #1a3d28;
    text-decoration-style: solid;
}

a.egw-citation-badge.reference-link {
    color: white;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.5);
    cursor: pointer;
}

a.egw-citation-badge.reference-link:hover {
    text-decoration-color: white;
    background: #1a3d28;
}

.cite-ref-btn,
.verify-ref-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #999;
    padding: 2px 4px;
    margin-left: 2px;
    border-radius: 4px;
    transition: all 0.2s;
    vertical-align: middle;
}

.cite-ref-btn:hover {
    color: #c8a84e;
    background: rgba(200, 168, 78, 0.1);
}

.verify-ref-btn:hover {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.verify-ref-btn.verified {
    color: #4caf50;
}

.verify-ref-btn.unverified {
    color: #f44336;
}

/* ═══════════════════════════════════════════════════════════════
   LANGUAGE SELECTOR
   ═══════════════════════════════════════════════════════════════ */

.health-lang-wrap {
    position: absolute;
    top: 20px;
    right: 20px;
    display: block;
}

.health-language-switcher {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.health-language-switcher:hover,
.health-language-switcher:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.health-language-switcher option {
    background: #2d5a3d;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   SOURCE PANEL (slide-out)
   ═══════════════════════════════════════════════════════════════ */

.health-source-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0;
    background: #1a1a3a;
    color: #e0e0e0;
    z-index: 1000;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
}

.health-source-panel.open {
    width: 420px;
    opacity: 1;
    visibility: visible;
    border-left: 1px solid #2d2d5b;
}

.health-source-panel.dual-mode.open {
    width: 750px;
}

/* Shift results when panel is open */
.health-results.source-open {
    margin-right: 430px;
    transition: margin-right 0.3s ease;
}

.health-source-panel-header {
    padding: 16px;
    border-bottom: 1px solid #2d2d5b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.health-source-panel-header h3 {
    margin: 0;
    color: #fff;
    font-size: 15px;
}

.health-source-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-source-cite-btn {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.health-source-cite-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

.health-source-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.health-source-panel-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.health-source-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
}

/* Loading state inside source panel */
.health-source-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.health-source-loading p {
    color: #888;
    margin-top: 12px;
    font-size: 14px;
}

.health-source-empty {
    padding: 30px 20px;
    text-align: center;
    color: #888;
}

.health-source-empty strong {
    color: #a5b4fc;
}

/* English mode: book title + paragraphs */
.health-source-book-title {
    font-size: 16px;
    font-weight: 700;
    color: #a5b4fc;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2d2d5b;
}

.health-source-paragraphs {
    /* scrollable area for paragraphs */
}

.source-paragraph {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.source-paragraph.highlight {
    background: rgba(99, 102, 241, 0.15);
    border-left-color: #6366f1;
}

.source-para-ref {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
}

/* Dual-column translation mode */
.health-source-dual-container {
    display: flex;
    gap: 16px;
    height: 100%;
}

.health-source-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.health-source-column-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #2d2d5b;
}

.health-source-column-text {
    flex: 1;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   CITATION MODAL
   ═══════════════════════════════════════════════════════════════ */

.health-citation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.health-citation-modal.active {
    display: flex;
}

.health-citation-modal-content {
    background: #1a1a3a;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.health-citation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.health-citation-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.health-citation-modal-header h3 i {
    color: #6366f1;
}

.health-citation-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.health-citation-modal-close:hover {
    color: #fff;
}

.health-citation-ref-display {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 16px;
    text-align: center;
}

.health-citation-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.health-citation-tab {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #999;
    border: 1px solid #2d2d5b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.health-citation-tab.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: #6366f1;
}

.health-citation-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.health-citation-format {
    display: none;
}

.health-citation-format.active {
    display: block;
}

.health-citation-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 10px;
    font-style: italic;
    min-height: 50px;
}

.health-citation-copy-btn {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.2s;
}

.health-citation-copy-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

.health-citation-loading {
    text-align: center;
    color: #888;
    padding: 12px;
    font-size: 13px;
}

.health-citation-status {
    text-align: center;
    color: #f44336;
    font-size: 13px;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   SOURCE PANEL + CITATION MODAL RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .health-source-panel.open {
        width: 50%;
    }

    .health-results.source-open {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .health-source-panel {
        width: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .health-source-panel.open {
        width: 100%;
    }

    .health-source-panel.dual-mode.open {
        width: 100%;
    }

    .health-results.source-open {
        margin-right: 0;
    }

    /* Stack dual columns vertically on mobile */
    .health-source-dual-container {
        flex-direction: column;
    }

    .health-source-column {
        max-height: 45vh;
    }

    .health-citation-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .health-lang-wrap {
        top: 16px;
        right: 12px;
    }

    .health-language-switcher {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .health-source-panel-header {
        padding: 12px;
    }

    .health-source-content {
        padding: 12px;
        font-size: 13px;
    }

    .health-citation-modal-content {
        padding: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MERGED HEALTH TOOL — perspective, flow, callouts, chat
   ═══════════════════════════════════════════════════════════════ */

/* Elements hidden with the `hidden` attribute must stay hidden even when a
   rule elsewhere sets display on them (the dialogs are display:flex when open). */
[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Inspiration-first theming ------------------------------- */
.health-perspective-inspiration .health-header {
    background: linear-gradient(135deg, #2c3e6b 0%, #3b5998 50%, #2d5a3d 100%);
}

.health-perspective-inspiration .health-search-btn {
    background: linear-gradient(135deg, #2c3e6b, #3b5998);
}

.health-perspective-inspiration .health-search-btn:hover {
    background: linear-gradient(135deg, #1e2d4f, #2c4a85);
}

.health-perspective-inspiration .health-question-card:hover,
.health-perspective-inspiration .health-question-card.active {
    border-color: #3b5998;
    box-shadow: 0 4px 20px rgba(59, 89, 152, 0.15);
}

.health-perspective-inspiration .health-question-card.active {
    background: linear-gradient(135deg, rgba(44, 62, 107, 0.04), rgba(59, 89, 152, 0.08));
}

.health-perspective-inspiration .suggestion-chip:hover {
    background: #3b5998;
    color: #fff;
}

.health-perspective-inspiration .section-principle {
    border-left-color: #2c3e6b !important;
}

.health-perspective-inspiration .section-addressing {
    border-left-color: #2d5a3d !important;
}

/* --- Perspective control ------------------------------------- */
.health-perspective-bar {
    max-width: 900px;
    margin: 18px auto 0;
    padding: 0 20px;
}

.health-perspective-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.health-perspective-switch {
    display: inline-flex;
    background: #fff;
    border: 1px solid #d8dee7;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.perspective-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 18px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #475569;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.perspective-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.perspective-btn.active {
    background: #2d5a3d;
    color: #fff;
}

.health-perspective-inspiration .perspective-btn.active {
    background: #3b5998;
}

.perspective-btn:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

.health-perspective-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 10px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.health-perspective-help:hover {
    color: #1e293b;
}

.health-perspective-note {
    max-width: 720px;
    margin: 10px auto 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

/* --- Urgent-care line ---------------------------------------- */
.health-urgent-line {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: #b45309;
}

.health-urgent-link {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.health-urgent-link:hover {
    color: #92400e;
}

/* --- Step indicator ------------------------------------------ */
.health-steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    max-width: 900px;
    margin: 18px auto 0;
    padding: 0 20px;
}

.health-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #eef2f7;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.health-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.health-step.active {
    background: #e6f0ea;
    color: #2d5a3d;
}

.health-step.active .health-step-num {
    background: #2d5a3d;
}

.health-step.done {
    color: #475569;
}

.health-step.done .health-step-num {
    background: #94a3b8;
}

.health-perspective-inspiration .health-step.active {
    background: #e8edf7;
    color: #2c3e6b;
}

.health-perspective-inspiration .health-step.active .health-step-num {
    background: #3b5998;
}

/* --- Next-step banner and source warning --------------------- */
.health-next-step,
.health-source-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.55;
}

.health-next-step {
    background: #eef6f1;
    border-left: 4px solid #2d5a3d;
    color: #1f3d2b;
}

.health-perspective-inspiration .health-next-step {
    background: #eef1f9;
    border-left-color: #3b5998;
    color: #1e2d4f;
}

.health-source-warning {
    background: #fef6e7;
    border-left: 4px solid #d97706;
    color: #7c4a03;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #2d5a3d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.health-perspective-inspiration .card-cta {
    color: #3b5998;
}

/* --- Phase 2 loading copy ------------------------------------ */
.health-focused-loading-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

/* --- Source snippets above the fold -------------------------- */
.health-source-preview {
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.health-source-preview h3 {
    font-size: 15px;
    margin: 0 0 12px;
    color: #2d5a3d;
}

.health-perspective-inspiration .health-source-preview h3 {
    color: #2c3e6b;
}

.health-source-preview-card {
    margin: 0 0 14px;
    padding: 0 0 0 14px;
    border-left: 3px solid #cbd5e1;
}

.health-source-preview-card:last-child {
    margin-bottom: 0;
}

.health-source-preview-card blockquote {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    font-style: italic;
}

.health-source-preview-card figcaption {
    font-size: 13px;
    font-weight: 600;
}

/* --- Paired source callouts ---------------------------------- */
.health-callout-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 14px 0;
}

.health-callout {
    padding: 14px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border-top: 3px solid #cbd5e1;
    font-size: 14px;
    line-height: 1.65;
}

.health-callout h4 {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.health-callout p:last-child {
    margin-bottom: 0;
}

.health-callout.callout-science {
    background: #f2f7fd;
    border-top-color: #3b82f6;
}

.health-callout.callout-science h4 {
    color: #1d4ed8;
}

.health-callout.callout-egw {
    background: #f4f8f5;
    border-top-color: #2d5a3d;
}

.health-callout.callout-egw h4 {
    color: #2d5a3d;
}

.health-callout.callout-herbal {
    background: #f6faf3;
    border-top-color: #65a30d;
}

.health-callout.callout-herbal h4 {
    color: #4d7c0f;
}

/* --- Jump links ---------------------------------------------- */
.health-jump-links {
    max-width: 900px;
    margin: 0 auto 16px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.health-jump-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.health-jump-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.health-jump-links a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    text-decoration: none;
}

.health-jump-links a:hover,
.health-jump-links a:focus-visible {
    background: #2d5a3d;
    color: #fff;
}

/* --- Follow-up chat (salvaged from TrueHealth, made responsive) -- */
.health-chat-section {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 20px;
}

.health-chat-header {
    background: linear-gradient(135deg, #2d5a3d, #3d7a52);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    user-select: none;
    min-height: 44px;
    transition: filter 0.2s;
}

.health-perspective-inspiration .health-chat-header {
    background: linear-gradient(135deg, #2c3e6b, #3b5998);
}

.health-chat-header:hover {
    filter: brightness(0.94);
}

.health-chat-header:focus-visible {
    outline: 3px solid #facc15;
    outline-offset: 2px;
}

.health-chat-header span {
    flex: 1;
}

.health-chat-toggle-icon {
    transition: transform 0.3s;
}

.health-chat-section.open .health-chat-toggle-icon {
    transform: rotate(180deg);
}

.health-chat-section:not(.open) .health-chat-header {
    border-radius: 12px;
}

.health-chat-body {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.health-chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-chat-welcome {
    text-align: center;
    color: #64748b;
    padding: 20px;
    font-size: 0.9rem;
}

.health-chat-welcome i {
    font-size: 1.8rem;
    color: #2d5a3d;
    margin-bottom: 8px;
    display: block;
}

.health-perspective-inspiration .health-chat-welcome i {
    color: #3b5998;
}

.health-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.health-chat-bubble.user {
    align-self: flex-end;
    background: #2d5a3d;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.health-perspective-inspiration .health-chat-bubble.user {
    background: #3b5998;
}

.health-chat-bubble.assistant {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.health-chat-bubble.assistant p {
    margin: 0 0 8px;
}

.health-chat-bubble.assistant p:last-child {
    margin-bottom: 0;
}

.health-chat-bubble.assistant a {
    color: #2d5a3d;
}

.health-chat-bubble.typing {
    align-self: flex-start;
    background: #f1f5f9;
    color: #94a3b8;
    font-style: italic;
}

.health-chat-input-wrap {
    display: flex;
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px;
    gap: 8px;
    background: #fafbfc;
}

.health-chat-input-wrap input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
}

.health-chat-input-wrap input:focus {
    border-color: #2d5a3d;
}

.health-chat-send-btn {
    background: #2d5a3d;
    color: #fff;
    border: none;
    border-radius: 8px;
    min-width: 48px;
    min-height: 44px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: filter 0.2s;
}

.health-perspective-inspiration .health-chat-send-btn {
    background: #3b5998;
}

.health-chat-send-btn:hover {
    filter: brightness(0.92);
}

.health-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sticky affordance: the chat sits below a Phase 2 answer several screens long */
.health-chat-fab {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 900;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: #2d5a3d;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
    cursor: pointer;
}

.health-perspective-inspiration .health-chat-fab {
    background: #3b5998;
}

/* --- Touch targets ------------------------------------------- */
.cite-ref-btn,
.verify-ref-btn {
    min-width: 32px;
    min-height: 32px;
    padding: 6px 8px;
}

.verify-ref-btn.verified {
    color: #2e7d32;
}

.verify-ref-btn.unverified {
    color: #c62828;
}

.verify-ref-btn.verify-failed {
    color: #ef6c00;
}

.egw-show-more-btn,
.health-research-more-toggle,
.suggestion-chip,
.health-retry-btn {
    min-height: 44px;
}

/* --- Responsive ---------------------------------------------- */
@media (max-width: 900px) {
    .health-callout-pair {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .health-lang-wrap {
        position: static;
        display: flex;
        justify-content: center;
        padding: 10px 20px 0;
    }

    .health-perspective-switch {
        width: 100%;
        justify-content: center;
    }

    .perspective-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 13px;
    }

    .perspective-btn i {
        display: none;
    }

    .health-steps {
        gap: 8px;
    }

    .health-step {
        padding: 6px 10px;
        font-size: 12px;
    }

    .health-chat-section {
        padding: 0 12px;
    }

    .health-chat-messages {
        max-height: 55vh;
    }

    .health-chat-bubble {
        max-width: 92%;
    }

    .cite-ref-btn,
    .verify-ref-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .health-chat-header {
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    .health-chat-input-wrap {
        padding: 8px;
    }

    .health-jump-links ul {
        gap: 6px;
    }

    .health-jump-links a {
        font-size: 12px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .health-perspective-bar {
        padding: 0 12px;
    }

    .health-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .health-source-preview {
        padding: 12px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .health-chat-toggle-icon,
    .perspective-btn,
    .health-chat-header {
        transition: none;
    }
}
