:root {
    --bg-color: #09090b;
    --panel-bg: #111827;
    --panel-elevated: #020617;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent-primary: #f97316;
    --accent-secondary: #22c55e;
    --bubble-user: #f97316;
    --bubble-assistant: #111827;
    --border-subtle: #1f2933;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 1.1rem;
    position: relative;
}

/* Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0%, #fed7aa, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1020;
    font-size: 1.25rem;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.35rem;
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.35rem 0 0.35rem;
    overflow: hidden;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    scroll-behavior: smooth;
}

/* Messages */
.message-row {
    display: flex;
    width: 100%;
}

.message-row.assistant {
    justify-content: flex-start;
}

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

.message-bubble {
    max-width: 80%;
    padding: 0.6rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.88rem;
    line-height: 1.35;
    word-wrap: break-word;
}

.message-bubble.assistant {
    background: var(--bubble-assistant);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 0.3rem;
}

.message-bubble.user {
    background: var(--bubble-user);
    color: #111827;
    border-bottom-right-radius: 0.3rem;
}

.message-meta {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.message-meta span.dot {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: var(--text-muted);
}

/* Suggestions */
.suggestions-row {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.suggestions-row::-webkit-scrollbar {
    display: none;
}

.chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
}

.chip i {
    font-size: 0.95rem;
}

/* Footer / Input */
.chat-footer {
    padding-top: 0.5rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--panel-elevated);
    border-radius: 999px;
    padding: 0.25rem 0.4rem 0.25rem 0.3rem;
    border: 1px solid var(--border-subtle);
}

#chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.input-icon-btn,
.send-btn {
    border: none;
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0.3rem;
    cursor: pointer;
    flex-shrink: 0;
}

.send-btn {
    background: var(--accent-primary);
    color: #0b1020;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
}

.send-btn:active {
    transform: scale(0.96);
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
}

.typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--text-muted);
    opacity: 0.5;
    animation: bounce 1.1s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.36s;
}

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

/* Utility */
.hidden {
    display: none !important;
}