* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', sans-serif; }
body { margin: 0; padding: 0; display: flex; flex-direction: column; height: 100dvh; background-color: #0e1621; color: #fff; }

.tg-header { background-color: #17212b; padding: 10px 15px; display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,0.2); z-index: 10; }
.tg-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #42a5f5, #29b6f6); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px; margin-right: 12px; }
.tg-header-info { display: flex; flex-direction: column; }
.tg-title { font-size: 16px; font-weight: 600; }
.tg-subtitle { font-size: 13px; color: #7f91a4; margin-top: 2px; }

.logs-btn { margin-left: auto; background: none; border: none; font-size: 22px; cursor: pointer; color: #7f91a4; padding: 5px; }
.logs-btn:active { opacity: 0.7; }
.mr-10 { margin-right: 10px; }

.chat-container { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 8px; }
.message { max-width: 85%; padding: 8px 12px; font-size: 15px; line-height: 1.4; position: relative; word-wrap: break-word; animation: fadeIn 0.3s ease; cursor: pointer; transition: 0.2s; }
.message:active { opacity: 0.8; transform: scale(0.98); }
.message.bot { background-color: #182533; align-self: flex-start; border-radius: 12px 12px 12px 4px; }
.message.self { background-color: #2b5278; align-self: flex-end; border-radius: 12px 12px 4px 12px; }
.message-sender { font-size: 13px; font-weight: 600; margin-bottom: 3px; }

.reply-quote { background-color: rgba(0,0,0,0.2); border-left: 3px solid #42a5f5; padding: 4px 8px; margin-bottom: 6px; border-radius: 4px; font-size: 13px; color: #b0bec5; }
.reply-quote-sender { color: #42a5f5; font-weight: 600; margin-bottom: 2px; }

.sys-message { align-self: center; background-color: rgba(0,0,0,0.2); padding: 4px 10px; border-radius: 12px; font-size: 12px; color: #7f91a4; margin: 10px 0; text-align: center; }

.typing-indicator { font-size: 13px; color: #7f91a4; padding-left: 5px; margin-bottom: 5px; display: none; }

.reply-banner { background-color: #202b36; padding: 8px 15px; border-left: 3px solid #42a5f5; font-size: 13px; color: #7f91a4; display: flex; justify-content: space-between; align-items: center; }
.reply-banner.hidden { display: none; }
.reply-banner-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 90%; }
.reply-banner-close { cursor: pointer; font-size: 16px; color: #fff; }

.tg-input-area { background-color: #17212b; padding: 10px 15px; display: flex; align-items: center; gap: 10px; z-index: 11; }
.tg-menu-btn { background: transparent; border: none; font-size: 24px; cursor: pointer; color: #7f91a4; padding: 0 5px 0 0; outline: none; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.tg-menu-btn:active { transform: scale(0.9); }
.tg-menu-btn.active { color: #42a5f5; }
.tg-input-area input { flex: 1; background-color: #2b3a4c; border: none; border-radius: 20px; padding: 12px 15px; color: #fff; font-size: 16px; outline: none; min-width: 0; }
.tg-input-area input::placeholder { color: #7f91a4; }
.tg-send-btn { background-color: #2b5278; color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; flex-shrink: 0; }

.tg-bot-keyboard { background-color: #141c22; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: all 0.3s ease; max-height: 500px; opacity: 1; overflow: hidden; }
.tg-bot-keyboard.hidden { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; margin: 0; pointer-events: none; border: none; }

.tg-kb-row { display: flex; gap: 8px; width: 100%; }
.tg-kb-btn { flex: 1; background-color: #202b36; border: none; color: #fff; padding: 12px 0; border-radius: 6px; font-size: 14px; cursor: pointer; text-align: center; font-weight: 500; transition: background 0.2s; }
.tg-kb-btn.danger { color: #e53935; }
.tg-kb-btn.active-auto { background-color: #5c2b78; color: #fff; animation: pulse 2s infinite; }
.tg-kb-select { width: 100%; background-color: #202b36; border: none; color: #fff; padding: 12px 10px; border-radius: 6px; font-size: 14px; outline: none; appearance: none; text-align: center; }

.toggle-btn { flex: 1; background-color: #202b36; color: #7f91a4; padding: 12px 0; border-radius: 6px; font-size: 14px; text-align: center; font-weight: 500; }
.toggle-btn input { display: none; }
.toggle-btn.active { background-color: #2b5278; color: #fff; }

.dossier-block { background: #17212b; padding: 10px; border-radius: 6px; display: flex; flex-direction: column; gap: 8px; border: 1px solid #2b3a4c; }
.dossier-title { font-size: 12px; color: #7f91a4; text-align: center; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.dossier-inputs { display: flex; gap: 8px; }
.dossier-inputs input[type="text"] { flex: 1; padding: 10px; background: #2b3a4c; border: none; color: white; border-radius: 4px; font-size: 14px; outline: none; }
.dossier-inputs input[type="file"] { display: none; }
.dossier-file-label { flex: 1.5; padding: 10px; background: #2b3a4c; color: #7f91a4; text-align: center; border-radius: 4px; cursor: pointer; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dossier-file-label:active { background: #3c5068; }
.btn-upload-profile { background: #2b5278; margin-bottom: 8px; }
.btn-clear-summary { background: #f57c00; color: #fff; }

#logs-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 100; flex-direction: column; }
.logs-content { background: #17212b; margin: auto; width: 90%; max-height: 80%; border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.logs-header { padding: 15px; background: #202b36; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #0e1621; }
.logs-body { padding: 15px; overflow-y: auto; font-family: monospace; font-size: 12px; color: #00ff00; flex: 1; background: #0e1621; white-space: pre-wrap; word-break: break-all; }
.close-logs { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
