.diagnose-main {
    padding: 20px;
    min-height: calc(100vh - 140px);
}

.diagnose-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    height: calc(100vh - 160px);
    max-height: 800px;
}

.diagnose-sidebar {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-y: auto;
}

.diagnose-sidebar h2 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.diag-tips {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.diag-tips h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--accent);
}

.diag-tips ul {
    list-style: none;
    padding: 0;
}

.diag-tips li {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 6px 0;
    padding-right: 14px;
    position: relative;
    line-height: 1.5;
}

.diag-tips li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: var(--primary-light);
}

.chat-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

.msg.user {
    align-self: flex-start;
    flex-direction: row-reverse;
    margin-right: auto;
}

.msg.bot {
    align-self: flex-end;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.msg-bubble {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.msg.user .msg-bubble {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.5);
}

.chat-input-area textarea {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    line-height: 1.5;
}

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

.chat-input-area button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input-area button:hover {
    background: var(--primary-dark);
}

/* نتایج تشخیص */
.result-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.result-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.result-cat {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.conf {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
}

.conf.high {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.conf.mid {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.conf.low {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.result-symptoms {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.result-symptoms ul {
    margin: 4px 0 0;
    padding-right: 18px;
}

.result-tip {
    font-size: 0.85rem;
    color: #93c5fd;
    line-height: 1.5;
}

/* تایپینگ */
.typing .msg-bubble {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

@media (max-width: 768px) {
    .diagnose-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .diagnose-sidebar {
        max-height: 200px;
    }

    .chat-panel {
        min-height: 420px;
        height: 60vh;
    }
}

.ai-settings-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.ai-settings-btn:hover {
    border-color: var(--primary-light);
    color: var(--text);
}
