:root { --bg: #09090b; --card: #18181b; --accent: #3b82f6; --text: #fafafa; --muted: #71717a; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); height: 100dvh; overflow: hidden; }

.app-wrapper { display: flex; height: 100dvh; }

/* SIDEBAR */
.sidebar { width: 280px; background: #000; border-right: 1px solid #27272a; display: flex; flex-direction: column; padding: 1.25rem; transition: transform 0.3s ease; z-index: 100; }
.user-profile { display: flex; align-items: center; gap: 10px; margin-bottom: 2rem; background: var(--card); padding: 10px; border-radius: 12px; }
.user-profile img { width: 40px; height: 40px; border-radius: 50%; background: #27272a; }

.new-btn { background: var(--accent); color: #fff; border: none; padding: 10px; border-radius: 8px; font-weight: 600; margin-bottom: 1rem; cursor: pointer; }
.project-item { padding: 10px; border-radius: 8px; color: var(--muted); cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.project-item.active { background: #27272a; color: #fff; }

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; height: 100%; position: relative; }
.header { height: 60px; border-bottom: 1px solid #27272a; display: flex; align-items: center; padding: 0 1rem; justify-content: space-between; }
#modelSelect { background: #27272a; color: #fff; border: none; padding: 5px 10px; border-radius: 15px; font-size: 12px; }

.chat-pane { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 1.5rem; scroll-behavior: smooth; }

.bubble-row { display: flex; margin-bottom: 1.5rem; width: 100%; }
.bubble-row.user { justify-content: flex-end; }
.bubble { max-width: 85%; padding: 0.8rem 1.2rem; border-radius: 1.2rem; background: var(--card); line-height: 1.5; font-size: 0.95rem; }
.bubble-row.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble-row.ai .bubble { border-bottom-left-radius: 4px; }

/* INPUT */
.input-area { padding: 1rem; }
.input-container { background: var(--card); border-radius: 1.5rem; padding: 8px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid #27272a; }
textarea { flex: 1; background: transparent; border: none; color: #fff; outline: none; resize: none; max-height: 200px; font-size: 16px; }
.plus-btn { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.send-btn { background: #fff; color: #000; width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer; }

/* UPLOAD MENU */
.upload-menu { position: absolute; bottom: 80px; left: 20px; background: var(--card); border: 1px solid #27272a; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.upload-menu label { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 10px; }

/* AUTH OVERLAY */
.overlay { position: fixed; inset: 0; background: #000; z-index: 1000; display: none; align-items: center; justify-content: center; }
.overlay.active { display: flex; }
.auth-card { background: var(--card); padding: 2.5rem; border-radius: 1.5rem; width: 90%; max-width: 380px; text-align: center; }
.logo-large { width: 60px; height: 60px; background: var(--accent); border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; margin: 0 auto 1.5rem; }
.auth-inputs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 1.5rem; }
.auth-inputs input { background: #09090b; border: 1px solid #27272a; padding: 12px; border-radius: 8px; color: #fff; }
.primary-btn { width: 100%; background: #fff; color: #000; padding: 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; }
#authSwitch { margin-top: 1rem; font-size: 13px; color: var(--muted); cursor: pointer; }

.d-none { display: none; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; height: 100%; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .menu-btn { display: block; background: none; border: none; color: #fff; font-size: 20px; }
}