:root {
    --bg: #eef4ee;
    --surface: #ffffff;
    --surface2: #f4faf5;
    --border: #c3dfc6;
    --primary: #2a6e35;
    --primary-dark: #1a4a22;
    --user-bubble: #2a6e35;
    --bot-bubble: #e8f5e9;
    --bot-text: #1b3a20;
    --text: #1b3a20;
    --text-muted: #5a7a5e;
    --sidebar-bg: #e8f4ea;
    --sidebar-border: #c3dfc6;
    --shadow-lg: 0 8px 40px rgba(42, 110, 53, 0.16);
    --modal-overlay: rgba(0, 0, 0, 0.45);
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --bg: #0e1a0f;
    --surface: #162118;
    --surface2: #1e2e1f;
    --border: #2d4a30;
    --primary: #4caf50;
    --primary-dark: #388e3c;
    --user-bubble: #388e3c;
    --bot-bubble: #1e3320;
    --bot-text: #c8e6c9;
    --text: #d4edda;
    --text-muted: #7aab7e;
    --sidebar-bg: #111a12;
    --sidebar-border: #2d4a30;
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s, color 0.3s;
    overflow: hidden;
}

.app-wrapper {
    display: flex;
    width: 96vw;
    max-width: 1200px;
    height: 94vh;
    box-shadow: var(--shadow-lg);
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    position: relative;
}


/* ══ SIDEBAR ══ */

.sidebar-panel {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1.5px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width 0.28s ease, min-width 0.28s ease, opacity 0.2s ease, border 0.28s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    overflow: hidden;
}

.sidebar-panel.closed {
    width: 0;
    min-width: 0;
    opacity: 0;
    border-right: none;
}

.sidebar-top {
    padding: 16px 14px 12px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.sidebar-logo-text {
    font-family: 'Merriweather', serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.sidebar-close-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: var(--border);
    color: var(--primary);
}

.new-chat-btn {
    margin: 10px 10px 4px;
    padding: 9px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.new-chat-btn:hover {
    background: var(--primary-dark);
}

.history-section-label {
    padding: 8px 13px 3px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    flex-shrink: 0;
}

.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.history-item:hover {
    background: var(--border);
    color: var(--text);
}

.history-item.active {
    background: var(--primary);
    color: white;
}

.history-item .hi-text {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.hi-del-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.history-item:hover .hi-del-btn {
    opacity: 1;
}

.hi-del-btn:hover {
    color: #e53935;
    background: rgba(229, 57, 53, 0.1);
}


/* ══ SIDEBAR PROFILE ══ */

.sidebar-profile {
    border-top: 1px solid var(--sidebar-border);
    padding: 8px;
    flex-shrink: 0;
    position: relative;
}

.sidebar-profile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.sidebar-profile-btn:hover {
    background: var(--border);
}

.sp-avatar-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--border);
}

.sp-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sp-info {
    flex: 1;
    overflow: hidden;
}

.sp-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-email {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.sp-chevron {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 8px;
    right: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    padding: 16px;
    display: none;
    animation: slideUp 0.2s ease;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pd-avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
}

.pd-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.pd-avatar-fallback {
    font-size: 20px;
    line-height: 1;
}

.pd-info {
    flex: 1;
    overflow: hidden;
}

.pd-name-drop {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-email-drop {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.pd-stat-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pd-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.pd-stat-icon {
    font-size: 13px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.pd-stat-label {
    flex: 1;
    color: var(--text-muted);
}

.pd-stat-val {
    font-weight: 700;
    color: var(--primary);
    font-size: 12px;
    flex-shrink: 0;
}

.pd-action-btn {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text);
    margin-top: 7px;
    transition: all 0.18s;
    text-align: left;
}

.pd-action-btn:hover {
    background: var(--surface2);
}

.pd-logout:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pd-delete {
    color: #e53935;
    border-color: rgba(229, 57, 53, 0.25);
}

.pd-delete:hover {
    background: rgba(229, 57, 53, 0.08);
    border-color: #e53935;
}


/* ══ SIDEBAR OVERLAY ══ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}


/* ══ MAIN CHAT ══ */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
    transition: background 0.3s;
    min-width: 0;
}

.chat-header {
    background: var(--primary);
    padding: 0 14px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hamburger-btn {
    flex-shrink: 0;
}

.header-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.header-title {
    min-width: 0;
}

.header-title h1 {
    font-family: 'Merriweather', serif;
    font-size: 15px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title p {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1px;
    white-space: nowrap;
}

.title-mobile {
    display: none;
}

.title-desktop {
    display: inline;
}

.header-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.hdr-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 7px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}

.hdr-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.bk-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 9px;
    display: none;
    align-items: center;
    justify-content: center;
}

#login-header-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    height: 32px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

#login-header-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}


/* ══ SYMPTOM BAR ══ */

.symptom-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.symptom-bar::-webkit-scrollbar {
    display: none;
}

.symptom-chip {
    padding: 5px 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 30px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.symptom-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.symptom-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}


/* ══ CHAT BOX ══ */

.chat-box {
    flex: 1;
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 13px;
    background: var(--surface2);
    scroll-behavior: smooth;
}

.msg-row {
    display: flex;
    gap: 8px;
    animation: msgIn 0.28s ease;
}

.msg-row.user-row {
    justify-content: flex-end;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-avatar {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 3px;
}

.msg-content {
    max-width: 75%;
}

.message {
    padding: 11px 14px;
    border-radius: 13px;
    line-height: 1.65;
    font-size: 14px;
}

.message.user {
    background: var(--user-bubble);
    color: white;
    border-radius: 13px 13px 3px 13px;
}

.message.bot {
    background: var(--bot-bubble);
    color: var(--bot-text);
    border: 1px solid var(--border);
    border-radius: 3px 13px 13px 13px;
}

.msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.msg-row:hover .msg-actions {
    opacity: 1;
}

.msg-action-btn {
    padding: 3px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 10.5px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s;
}

.msg-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.related-topics {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.related-chip {
    padding: 3px 9px;
    background: var(--surface);
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
}

.related-chip:hover {
    background: var(--primary);
    color: white;
}


/* ══ TYPING INDICATOR ══ */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 11px 14px;
    background: var(--bot-bubble);
    border: 1px solid var(--border);
    border-radius: 3px 13px 13px 13px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}


/* ══ REPORT BAR ══ */

.report-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.report-btn {
    padding: 5px 13px;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.report-btn:hover {
    background: var(--primary);
    color: white;
}

.char-count {
    font-size: 11px;
    color: var(--text-muted);
}


/* ══ CHAT INPUT — TEXTAREA VERSION ══ */

.chat-input {
    display: flex;
    padding: 10px 14px;
    background: var(--surface);
    gap: 8px;
    /* align-items: flex-end so send button stays at bottom when textarea grows */
    align-items: flex-end;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}


/* ── Replaced <input> with <textarea> ── */

.chat-input textarea {
    flex: 1;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    outline: none;
    font-size: 13.5px;
    background: var(--surface2);
    color: var(--text);
    font-family: 'Source Sans 3', sans-serif;
    transition: border-color 0.2s;
    resize: none;
    overflow-y: hidden;
    min-height: 44px;
    max-height: 160px;
    line-height: 1.5;
    scrollbar-width: none;
}

.chat-input textarea::-webkit-scrollbar {
    display: none;
}

.chat-input textarea::placeholder {
    color: var(--text-muted);
}

.chat-input textarea:focus {
    border-color: var(--primary);
    background: var(--surface);
}

.send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* align-self: flex-end keeps button pinned to bottom of flex row */
    align-self: flex-end;
    transition: background 0.2s, transform 0.15s;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.08);
}

.send-btn:active {
    transform: scale(0.95);
}


/* ══ FOOTER ══ */

.footer {
    background: #0d0d0d;
    padding: 10px 20px 8px;
    text-align: center;
    flex-shrink: 0;
    border-top: 1px solid #1a1a1a;
}

.footer .disclaimer-heading {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.footer .disclaimer-text {
    font-size: 10.5px;
    line-height: 1.6;
    color: #bbbbbb;
    font-style: italic;
    font-family: 'Merriweather', serif;
}

.footer .copyright {
    margin-top: 6px;
    font-size: 10px;
    color: #4a7c59;
}


/* ══ MODALS ══ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: 15px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--border);
    animation: slideUp 0.22s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-family: 'Merriweather', serif;
    font-size: 15px;
    color: var(--text);
}

.modal-close {
    width: 27px;
    height: 27px;
    border: none;
    background: var(--surface2);
    border-radius: 7px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--border);
}

.modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    margin-top: 11px;
}

.modal select,
.modal textarea,
.modal input[type=text] {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text);
    font-size: 13px;
    font-family: 'Source Sans 3', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.modal select:focus,
.modal textarea:focus,
.modal input[type=text]:focus {
    border-color: var(--primary);
}

.modal textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.modal-btn {
    flex: 1;
    padding: 9px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.primary {
    background: var(--primary);
    color: white;
    border: none;
}

.modal-btn.primary:hover {
    background: var(--primary-dark);
}

.modal-btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

.modal-btn.secondary:hover {
    background: var(--surface2);
}


/* ══ BOOKMARKS ══ */

.bookmark-list {
    max-height: 290px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.bookmark-item {
    padding: 9px 11px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s;
}

.bookmark-item:hover {
    border-color: var(--primary);
}

.bk-text {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.5;
}

.bk-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.bk-copy {
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
    padding: 2px 10px;
    border: 1px solid var(--primary);
    border-radius: 12px;
    transition: all 0.15s;
}

.bk-copy:hover {
    background: var(--primary);
    color: white;
}

.bk-del {
    font-size: 11px;
    cursor: pointer;
    color: #e53935;
    padding: 2px 10px;
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 12px;
    transition: all 0.15s;
}

.bk-del:hover {
    background: rgba(229, 57, 53, 0.1);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 16px;
}


/* ══ TOAST ══ */

.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: #1b5e20;
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 12.5px;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}


/* ══ LOGIN MODAL ══ */

#login-modal a:hover {
    background: #f1f8f1 !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 110, 53, 0.15);
    transition: all 0.2s;
}

[data-theme="dark"] #login-modal a:hover {
    background: var(--surface2) !important;
    border-color: var(--primary) !important;
}


/* ══ SOURCE CITATION ══ */

.source-citation {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 5px 10px;
    border-top: 1px dashed var(--border);
    font-style: italic;
    background: var(--surface);
    border-radius: 0 0 8px 8px;
}


/* ══ RESPONSIVE — MOBILE ══ */

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        overflow: hidden;
    }
    .app-wrapper {
        width: 100vw;
        height: 100dvh;
        max-width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .sidebar-panel {
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        z-index: 200;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }
    .sidebar-panel.closed {
        width: 0;
        min-width: 0;
        box-shadow: none;
    }
    .chat-container {
        width: 100%;
    }
    .chat-header {
        padding: 0 10px;
        height: 52px;
    }
    .header-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .title-desktop {
        display: none;
    }
    .title-mobile {
        display: inline;
    }
    .header-title h1 {
        font-size: 13px;
    }
    .header-title p {
        display: none;
    }
    .hdr-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    #login-header-btn {
        font-size: 11px;
        padding: 0 10px;
        height: 28px;
    }
    .symptom-bar {
        padding: 6px 8px;
        gap: 5px;
    }
    .symptom-chip {
        padding: 4px 10px;
        font-size: 11px;
    }
    .chat-box {
        padding: 10px 10px;
        gap: 10px;
    }
    .msg-content {
        max-width: 88%;
    }
    .message {
        font-size: 13px;
        padding: 9px 12px;
    }
    .msg-actions {
        opacity: 1;
        gap: 3px;
        margin-top: 3px;
    }
    .msg-action-btn {
        padding: 2px 7px;
        font-size: 10px;
    }
    .source-citation {
        font-size: 10px;
        padding: 4px 8px;
    }
    .report-bar {
        padding: 5px 10px;
    }
    .report-btn {
        font-size: 10.5px;
        padding: 4px 10px;
    }
    .chat-input {
        padding: 8px 10px;
        gap: 6px;
    }
    .chat-input textarea {
        font-size: 13px;
        padding: 9px 13px;
        min-height: 40px;
        border-radius: 18px;
    }
    .send-btn {
        width: 38px;
        height: 38px;
    }
    .footer {
        padding: 8px 14px 7px;
    }
    .footer .disclaimer-heading {
        font-size: 10px;
    }
    .footer .disclaimer-text {
        font-size: 9.5px;
        line-height: 1.5;
    }
    .footer .copyright {
        font-size: 9px;
        margin-top: 4px;
    }
    .modal {
        width: 95%;
        padding: 18px;
        border-radius: 12px;
    }
    .profile-dropdown {
        left: 4px;
        right: 4px;
    }
    .sp-email {
        display: none;
    }
    .bk-copy,
    .bk-del {
        font-size: 10px;
        padding: 2px 8px;
    }
}

@media (max-width: 380px) {
    .header-title h1 {
        font-size: 11px;
    }
    .header-actions {
        gap: 3px;
    }
    .hdr-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .message {
        font-size: 12.5px;
        padding: 8px 10px;
    }
    .msg-content {
        max-width: 92%;
    }
    .chat-input textarea {
        font-size: 12px;
        padding: 8px 11px;
        min-height: 38px;
    }
    .send-btn {
        width: 35px;
        height: 35px;
    }
    .footer .disclaimer-text {
        font-size: 9px;
    }
}