html { width: -webkit-fill-available; max-width: 420px; margin: auto; }
body { max-width: 420px !important; }
:root { --ion-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.profile-header { padding: 16px; }
.avatar-container { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.avatar-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 1px solid #dbdbdb; background: #f0f0f0; }
.stat-box { text-align: center; flex: 1; }
.stat-value { font-weight: bold; font-size: 1.1rem; display: block; }
.stat-label { font-size: 0.85rem; color: #666; }
.bio-section { margin-bottom: 16px; font-size: 0.95rem; }
.bio-name { font-weight: bold; }
.action-buttons { display: flex; gap: 8px; margin-bottom: 16px; }
.action-buttons ion-button { flex: 1; --border-radius: 8px; height: 35px; font-size: 0.85rem; text-transform: none; }
.repo-card { border: 0.5px solid #efefef; padding: 15px; height: 100%; display: flex; flex-direction: column; justify-content: space-between; background: white; border-radius: 8px; }
.repo-title { font-weight: bold; color: #385898; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-desc { font-size: 0.75rem; color: #666; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.repo-stats { font-size: 0.7rem; color: #999; display: flex; gap: 10px; }

/* Styles for AI Chat */
.chat-container { padding: 16px; background: #fff; height: auto; }
.chat-messages { max-height: 400px; overflow-y: auto; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-message { padding: 10px; border-radius: 12px; max-width: 85%; word-wrap: break-word; }
.user-message { background: #e1f5fe; align-self: flex-end; }
.ai-message { background: #f1f3f4; align-self: flex-start; }
.chat-input-area { margin-top: 24px; display: flex; gap: 8px; align-items: center; }
.chat-input { flex: 1; border: 1px solid #ccc; border-radius: 20px; padding: 8px 12px; font-size: 0.9rem; }
.chat-suggestions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggestion-chip { background: #f0f2f5; border-radius: 18px; padding: 8px 16px; font-size: 0.85rem; cursor: pointer; color: #385898; border: 1px solid #e1f5fe; transition: background 0.2s; }
.suggestion-chip:active { background: #e1f5fe; }
.mentioned-repo { background: #e8f0fe; border-radius: 8px; padding: 8px; margin-top: 8px; font-size: 0.8rem; }

/* Typing Indicator */
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 10px; background: #f1f3f4; border-radius: 12px; width: fit-content; align-self: flex-start; margin-bottom: 8px; }
.typing-dot { width: 6px; height: 6px; background: #999; border-radius: 50%; animation: typing 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Markdown tweaks */
.chat-message p { margin: 4px 0; }
.chat-message ul, .chat-message ol { padding-left: 20px; margin: 4px 0; }
.chat-message code { background: rgba(0,0,0,0.05); padding: 2px 4px; border-radius: 4px; font-family: monospace; }

/* Modal styles */ion-modal { --height: 100%; --border-radius: 0; --align-items: flex-end; }
ion-modal ion-toolbar { --background: #fff; --color: #000; }
#chat-modal .chat-messages { height: 100%; max-height: none; overflow-y: visible; }
#trigger-chat-modal { cursor: pointer; background: #f9f9f9; border-radius: 25px; padding: 5px 15px; margin-bottom: 20px; border: 1px solid #eee; }
#trigger-chat-modal input { pointer-events: none; border: none; background: transparent; }
