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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #0f0f12;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.telegram-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: #0f0f12;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    background: #1f2c33;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #2b3b44;
    flex-shrink: 0;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-info {
    flex: 1;
}

.chat-name {
    color: white;
    font-weight: 600;
    font-size: 17px;
}

.chat-status {
    color: #89a2b8;
    font-size: 13px;
}

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

.bot-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-bubble {
    background: #1f2c33;
    padding: 10px 14px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    max-width: 85%;
    word-wrap: break-word;
}

.bot-message .message-bubble {
    background: #1f2c33;
    color: #e1e9f0;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-bubble {
    background: #2b6b9e;
    color: white;
    border-top-right-radius: 4px;
}

.message-text {
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-text b {
    color: #4f8cff;
}

.message-text code {
    background: #0f0f12;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
}

.message-time {
    font-size: 10px;
    color: #6c8ea0;
    margin-top: 4px;
    text-align: right;
}

.start-container {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 8px;
}

.start-btn {
    background: linear-gradient(135deg, #4f8cff, #2563ff);
    border: none;
    padding: 10px 28px;
    border-radius: 30px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.input-area {
    background: #1f2c33;
    padding: 10px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #2b3b44;
    flex-shrink: 0;
}

.attach-btn {
    background: #2b3b44;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #89a2b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-input {
    flex: 1;
    background: #2b3b44;
    border: none;
    padding: 10px 16px;
    border-radius: 24px;
    color: white;
    font-size: 15px;
    outline: none;
}

.message-input::placeholder {
    color: #6c8ea0;
}

.send-btn {
    background: linear-gradient(135deg, #4f8cff, #2563ff);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.command-suggestions {
    position: absolute;
    bottom: 70px;
    left: 16px;
    right: 16px;
    background: #1f2c33;
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.command-suggestions.show {
    display: block;
}

.command-item {
    padding: 12px 16px;
    border-bottom: 1px solid #2b3b44;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

.command-item:hover {
    background: #2b3b44;
}

.command-icon {
    width: 32px;
    height: 32px;
    background: #2b6b9e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.command-name {
    color: #4f8cff;
    font-weight: 600;
    font-size: 15px;
}

.command-desc {
    color: #89a2b8;
    font-size: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1f2c33;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #4f8cff;
    border-radius: 4px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #89a2b8;
    border-radius: 50%;
    animation: typing 1.9s infinite ease-in-out;
}

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

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #1f2c33;
    border-top-color: #4f8cff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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