/* AI Haijun - Main Styles */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 52px;
  --header-height: 52px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: 0.2s ease;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
}

[data-theme="light"], :root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --bg-sidebar: #f9f9f9;
  --bg-hover: #ececec;
  --bg-active: #e3e3e3;
  --text-primary: #0d0d0d;
  --text-secondary: #676767;
  --text-muted: #8e8e8e;
  --border: #e5e5e5;
  --border-light: #ebebeb;
  --accent: #0285ff;
  --accent-hover: #0070d9;
  --btn-primary-bg: #0d0d0d;
  --btn-primary-text: #ffffff;
  --input-bg: #ffffff;
  --overlay: rgba(0,0,0,0.4);
  --modal-bg: #ffffff;
  --toggle-on: #0285ff;
  --toggle-off: #d1d1d1;
}

[data-theme="dark"] {
  --bg-primary: #212121;
  --bg-secondary: #171717;
  --bg-sidebar: #171717;
  --bg-hover: #2f2f2f;
  --bg-active: #3a3a3a;
  --text-primary: #ececec;
  --text-secondary: #b4b4b4;
  --text-muted: #8e8e8e;
  --border: #3a3a3a;
  --border-light: #2f2f2f;
  --accent: #0285ff;
  --accent-hover: #339dff;
  --btn-primary-bg: #ffffff;
  --btn-primary-text: #0d0d0d;
  --input-bg: #2f2f2f;
  --overlay: rgba(0,0,0,0.6);
  --modal-bg: #2f2f2f;
  --toggle-on: #0285ff;
  --toggle-off: #555555;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

.hidden { display: none !important; }

/* App Layout */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .btn-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .badge-new,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .guest-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .btn-upgrade,
.sidebar.collapsed .sidebar-conversations {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.sidebar.collapsed .sidebar-header-actions {
  flex-direction: column;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-user {
  flex-direction: column;
  gap: 4px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 8px 12px;
  gap: 8px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition);
}

.icon-btn:hover { background: var(--bg-hover); }
.icon-btn svg { width: 18px; height: 18px; }

.btn-label { font-size: 13px; color: var(--text-secondary); }

/* Sidebar Nav */
.sidebar-nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--transition);
  text-align: left;
  width: 100%;
  position: relative;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-secondary); }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--bg-active); font-weight: 500; }

.nav-section-label {
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 12px 4px;
  font-weight: 500;
}

.badge-new {
  font-size: 10px;
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
  font-weight: 600;
}

.nav-more-menu { padding: 0 8px; }

.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.conv-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition);
}

.conv-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.conv-item.active { background: var(--bg-active); color: var(--text-primary); }

/* Sidebar Footer */
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.sidebar-guest {
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.guest-text {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.guest-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

[data-theme="dark"] .sidebar-guest {
  background: var(--bg-secondary);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
  min-width: 0;
}

.user-profile-btn:hover { background: var(--bg-hover); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan { font-size: 12px; color: var(--text-muted); }

.btn-upgrade {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition);
}

.btn-upgrade:hover { background: var(--bg-hover); }

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-primary);
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  height: var(--header-height);
  flex-shrink: 0;
}

.main-header-left, .main-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tombol header untuk logged-out */
.header-auth-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.model-selector svg { width: 16px; height: 16px; color: var(--text-secondary); }

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  transition: opacity var(--transition);
}

.btn-primary:hover { opacity: 0.85; }

.btn-text {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
}

.btn-text:hover { background: var(--bg-hover); }

.btn-outline {
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-primary);
  transition: background var(--transition);
}

.btn-outline:hover { background: var(--bg-hover); }
.btn-full { width: 100%; }

.btn-upgrade-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.btn-upgrade-header svg { width: 16px; height: 16px; }
.btn-upgrade-header:hover { background: var(--bg-hover); }

.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.main-footer {
  padding: 8px 16px 16px;
  text-align: center;
  flex-shrink: 0;
}

.main-footer p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Logo section untuk halaman utama */
.chat-home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
  text-align: center;
  min-height: 0;
}

.chat-greeting {
  font-size: 25px;
  font-weight: 400;
  margin-bottom: 22px;
  text-align: center;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.5;
}

.chat-input-area {
  width: 100%;
  max-width: 768px;
  margin-bottom: 8px;
}

.chat-home .chat-input-area { max-width: 768px; }

.chat-input-box {
  max-width: 768px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid #d0d0d0;
  border-radius: 28px;
  padding: 8px 8px 8px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 26px rgba(0,0,0,.035);
  transition: border-color var(--transition), box-shadow var(--transition);
}

[data-theme="dark"] .chat-input-box {
  border-color: #3a3a3a;
}

.chat-input-box:focus-within {
  border-color: #0d0d0d;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .chat-input-box:focus-within {
  border-color: #ececec;
}

.chat-input-box textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  min-height: 28px;
  max-height: 120px;
  line-height: 1.5;
  color: var(--text-primary);
  padding: 0;
  font-size: 15px;
  padding: 2px 4px;
}

.chat-input-box textarea::placeholder { color: var(--text-muted); }
  .chat-input-box textarea.single-row { align-self: center; }

.chat-input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-action-btn {
  padding: 8px;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
}

.chat-action-btn:hover { background: var(--bg-hover); }
.chat-action-btn svg { width: 20px; height: 20px; }
.chat-action-btn i { font-size: 16px; width: 20px; height: 20px; }

.btn-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #b9b9b9;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
  border: none;
}

.btn-send:hover { transform: scale(1.05); }
.btn-send:disabled { cursor: not-allowed; background: #b9b9b9; transform: none; }
.btn-send.active { background: #0d0d0d; color: #ffffff; }
.btn-send:active { transform: scale(0.95); }
.btn-send svg { width: 18px; height: 18px; }

[data-theme="dark"] .btn-send {
  background: #555555;
}

[data-theme="dark"] .btn-send.active {
  background: #ececec;
  color: #0d0d0d;
}

/* Chat view (after first message) */
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  /* Scrollbar menempel di ujung kanan layar, bukan di dekat teks */
  scrollbar-gutter: stable;
}

.chat-messages::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.chat-view .message {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  padding: 0 16px;
}

.message-role {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.message-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  word-wrap: break-word;
}

.message.user .message-content {
  display: inline-block;
  background: var(--bg-active);
  border-radius: 18px;
  padding: 12px 16px;
}

.message.assistant .message-content {
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.message-actions button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
}

.message-actions button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-input-bottom {
  padding: 16px 0 24px;
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
  width: 100%;
}

.chat-input-bottom .chat-input-box {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.suggestion-chip {
  padding: 11px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-active);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: 1px solid transparent;
  user-select: none;
}

.suggestion-chip:hover {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Chat messages area */
.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-message.user .message-content {
  background: var(--bg-active);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 0 4px;
}

.chat-message.user .message-role { display: none; }

/* Loading / thinking indicator */
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  max-width: 80%;
  align-self: flex-start;
}

.chat-thinking-dots {
  display: flex;
  gap: 4px;
}

.chat-thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: thinkingBounce 1.4s infinite ease-in-out both;
}

.chat-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.chat-thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes thinkingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Scrollbar styling */
.chat-messages-area::-webkit-scrollbar { width: 6px; }
.chat-messages-area::-webkit-scrollbar-track { background: transparent; }
.chat-messages-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.suggestion-chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--transition);
}

.suggestion-chip:hover { background: var(--bg-hover); }

.chat-quick-actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  transition: background var(--transition);
}

.quick-action:hover { background: var(--bg-hover); color: var(--text-primary); }
.quick-action svg { width: 18px; height: 18px; }

/* Chat Messages */
.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  /* Scrollbar menempel di ujung kanan layar, bukan di dekat teks */
  scrollbar-gutter: stable;
}

.chat-messages::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.chat-view .message {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  padding: 0 16px;
}

.message-role {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.message-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.message-actions button {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.message-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-input-bottom {
  padding: 16px 0 24px;
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
}

.message.user { text-align: right; }
.message.user .message-content { display: inline-block; background: var(--bg-active); border-radius: 18px; padding: 10px 14px; text-align: left; }
.message.assistant .message-content { white-space: normal; }
.settings-modal-title { display:flex; justify-content:space-between; align-items:center; padding:18px 16px 12px; font-size:16px; }
.settings-modal-title .modal-close { position:static; }
.pricing-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:24px; }
.pricing-card { border:1px solid var(--border); border-radius:16px; padding:20px; display:flex; flex-direction:column; gap:12px; min-height:220px; }
.pricing-card.featured { border-color:var(--accent); box-shadow:var(--shadow-sm); }
.pricing-card strong { font-size:22px; }.pricing-card p { color:var(--text-secondary); line-height:1.5; flex:1; }
.profile-modal-inner { padding:28px; display:flex; flex-direction:column; gap:16px; position:relative; }
.profile-avatar-preview { width:72px; height:72px; background:var(--accent); color:#fff; border-radius:50%; display:grid; place-items:center; font-size:28px; overflow:hidden; }
.profile-avatar-preview img { width:100%; height:100%; object-fit:cover; }.profile-upload { width:max-content; }
.shortcut-list { margin-top:18px; }.shortcut-list p { display:flex; align-items:center; gap:6px; padding:10px 0; border-bottom:1px solid var(--border-light); }.shortcut-list span { margin-left:auto; color:var(--text-secondary); }
kbd { border:1px solid var(--border); border-radius:5px; padding:2px 6px; background:var(--bg-secondary); font-size:12px; }
.generic-modal textarea { width:100%; border:1px solid var(--border); border-radius:10px; padding:10px; margin:12px 0; resize:vertical; background:var(--input-bg); color:var(--text-primary); }

@media (max-width: 760px) { .pricing-grid { grid-template-columns:1fr; } }

/* Voice Banner */
.voice-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 32px;
  max-width: 600px;
  width: 100%;
  position: relative;
}

.voice-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  flex-shrink: 0;
}

.voice-banner-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.voice-banner-text p { font-size: 13px; color: var(--text-secondary); }

.voice-banner-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-voice-start {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

.banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.banner-close:hover { background: var(--bg-hover); }

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 99;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: flex !important; }
  .chat-greeting { font-size: 22px; }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none !important; }
}
  
  /* Auth / Login Page */
  .auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
  }
  .auth-page-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 24px;
  }
  .auth-page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
  }
  .auth-logo { width: 24px; height: 24px; }
  .auth-brand { font-size: 20px; font-weight: 600; color: var(--text-primary); }
  .auth-content { background: var(--bg-secondary); border-radius: 16px; padding: 24px; }
  .auth-content h2 { font-size: 22px; font-weight: 500; margin: 0 0 8px; color: var(--text-primary); }
  .auth-subtitle { font-size: 14px; color: var(--text-secondary); margin: 0 0 20px; line-height: 1.5; }
  .auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition);
    margin-bottom: 10px;
  }
  .auth-btn:hover { background: var(--bg-hover); }
  .auth-btn svg { width: 20px; height: 20px; }
  .auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
  }
  .auth-divider::before,
  .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
  .auth-divider::before { margin-right: 16px; }
  .auth-divider::after { margin-left: 16px; }
  .auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
  }
  .auth-input:focus { border-color: var(--accent); }
  .auth-submit {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: var(--btn-primary-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: opacity var(--transition);
  }
  .auth-submit:hover { opacity: 0.9; }
  .auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }
  .auth-form-group { margin-bottom: 16px; }
  .auth-form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
  .auth-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 0;
    cursor: pointer;
    margin-bottom: 16px;
  }
  .auth-back i { width: 18px; height: 18px; }
  .auth-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 16px; }
  .auth-footer { text-align: center; margin-top: 24px; }
  .auth-back-link {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
  }
  .auth-back-link:hover { text-decoration: underline; }
  .phone-input-group { display: flex; align-items: center; }
  .phone-prefix { padding: 12px 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-right: none; border-radius: 12px 0 0 12px; font-size: 14px; color: var(--text-primary); }
  .phone-input-group .auth-input { border-radius: 0 12px 12px 0; border-left: none; }
  .google-account { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
  .google-account:hover { background: var(--bg-hover); }
  .google-avatar { width: 40px; height: 40px; border-radius: 50%; background: #4285F4; color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
  .google-name { font-weight: 500; color: var(--text-primary); }
  .google-plan { font-size: 13px; color: var(--text-secondary); }
  .otp-inputs { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
  .otp-input { width: 44px; height: 48px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 20px; background: var(--bg-primary); color: var(--text-primary); }


/* Updated 2026-08-25 */
