#aihd-app {
    display: flex;
    height: 85vh;
    min-height: 600px;
    background: #212121; /* رنگ پایه تیره */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    direction: rtl;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    color: #ececf1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* پنل کناری */
#aihd-sidebar {
    width: 260px;
    background: #171717;
    padding: 16px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #2f2f2f;
}

.aihd-brand {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    padding: 0 8px;
    color: #fff;
}

.aihd-brand span {
    color: #10a37f;
}

#aihd-new-chat {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid #4d4d4d;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

#aihd-new-chat:hover {
    background: #2a2a2a;
}

/* بخش اصلی چت */
#aihd-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #212121;
}

#aihd-messages-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

#aihd-messages {
    display: flex;
    flex-direction: column;
}

/* ردیف‌های پیام (معماری مشابه ChatGPT) */
.aihd-msg-row {
    padding: 24px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.aihd-msg-row.assistant {
    background: #444654; /* بک‌گراند متمایز برای هوش مصنوعی */
}

.aihd-msg-row.user {
    background: transparent;
}

.aihd-msg-inner {
    width: 100%;
    max-width: 750px;
    display: flex;
    gap: 16px;
}

/* آواتارها */
.aihd-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    color: #fff;
}

.aihd-msg-row.user .aihd-avatar {
    background: #5436da;
}

.aihd-msg-row.assistant .aihd-avatar {
    background: #10a37f;
}

.aihd-msg-content {
    line-height: 1.7;
    font-size: 15px;
    flex: 1;
    word-wrap: break-word;
}

.aihd-msg-content strong {
    color: #fff;
}

.aihd-msg-content a {
    color: #10a37f;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* نشانگر پردازش */
.typing {
    color: #b4b4b4;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ناحیه ورودی پایین صفحه */
#aihd-input-wrapper {
    padding: 24px;
    background: linear-gradient(180deg, rgba(33,33,33,0) 0%, #212121 40%);
}

.aihd-input-box {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: #40414f;
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    gap: 8px;
}

#aihd-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    resize: none;
    outline: none;
    padding: 8px;
    font-size: 15px;
    font-family: inherit;
    max-height: 200px;
    line-height: 1.5;
}

#aihd-input::placeholder {
    color: #8e8ea0;
}

#aihd-send {
    background: #10a37f;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: 0.2s ease;
}

#aihd-send:hover {
    background: #0e8c6b;
}

.aihd-footer-text {
    text-align: center;
    font-size: 11px;
    color: #7d7d7d;
    margin-top: 12px;
}

/* اسکرول‌بار */
#aihd-messages-container::-webkit-scrollbar { width: 6px; }
#aihd-messages-container::-webkit-scrollbar-thumb { background: #565869; border-radius: 10px; }