:root {
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --bg4: #222;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text2: #999;
  --text3: #666;
  --accent: #a78bfa;
  --accent2: #8b5cf6;
  --green: #34d399;
  --red: #f87171;
  --orange: #fb923c;
  --blue: #60a5fa;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 2px 20px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button { font-family: var(--font); outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ============== AUTH PAGE ============== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d0d 70%);
}

.auth-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: var(--shadow);
}

.auth-box h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-box .subtitle {
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-box .field {
  margin-bottom: 16px;
}

.auth-box label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
  font-weight: 500;
}

.auth-box input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  transition: border 0.2s;
}

.auth-box input:focus {
  border-color: var(--accent);
}

.auth-box .btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
}

.auth-box .btn:hover { opacity: 0.9; }
.auth-box .btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-box .switch-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text2);
}

.auth-box .switch-link span {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

.auth-box .switch-link span:hover { text-decoration: underline; }

.auth-box .error {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

.pin-inputs {
  display: flex;
  gap: 8px;
}

.pin-inputs input {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
}

/* ============== MAIN LAYOUT ============== */
.app-layout {
  display: flex;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.3s;
}

.app-layout.visible { opacity: 1; }

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar.collapsed .sidebar-header h2 { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .sidebar-header button { font-size: 18px; }

.sidebar.collapsed .conversations-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  gap: 6px;
}

.sidebar.collapsed .conv-item {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  min-height: 36px;
  margin-bottom: 0;
}

.sidebar.collapsed .conv-item.active { border-left: none; box-shadow: 0 0 0 2px var(--accent); }

.sidebar.collapsed .conv-item .conv-title,
.sidebar.collapsed .conv-item .conv-meta,
.sidebar.collapsed .conv-item .conv-delete { display: none; }

.sidebar.collapsed .conv-item .conv-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg4);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}

.sidebar.collapsed .conv-item.active .conv-num { background: var(--accent); color: #fff; }

.conv-num { display: none; }

.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 8px; gap: 6px; flex-wrap: wrap; }
.sidebar.collapsed .sidebar-footer .user-info { display: none; }
.sidebar.collapsed .sidebar-footer .logout-btn { font-size: 14px; padding: 4px; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--bg4); color: var(--text); }

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.3s ease;
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-header button {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar-header button:hover {
  background: var(--bg4);
  color: var(--text);
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  transition: padding 0.3s ease;
}

.conv-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
  position: relative;
}

.conv-item:hover { background: var(--bg4); }
.conv-item.active { background: var(--bg4); border-left: 3px solid var(--accent); }

.conv-item .conv-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.conv-item .conv-meta {
  font-size: 11px;
  color: var(--text3);
}

.conv-item .conv-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  display: none;
  padding: 4px 6px;
  border-radius: 4px;
}

.conv-item:hover .conv-delete { display: block; }
.conv-item .conv-delete:hover { color: var(--red); background: rgba(248,113,113,0.1); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: padding 0.3s ease;
}

.sidebar-footer .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-footer .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-footer .user-name {
  font-size: 13px;
  font-weight: 500;
}

.sidebar-footer .user-balance {
  font-size: 11px;
  color: var(--text3);
}

.sidebar-footer .logout-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
}

.sidebar-footer .logout-btn:hover { color: var(--red); }

/* ============== CHAT AREA ============== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  height: 100vh;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header .conv-title-area {
  flex: 1;
}

.chat-header .conv-title-area h3 {
  font-size: 15px;
  font-weight: 600;
}

.chat-header .conv-title-area .conv-sys-prompt {
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  margin-top: 2px;
  display: inline-block;
}

.chat-header .conv-title-area .conv-sys-prompt:hover { color: var(--accent); }

.chat-header .conv-actions {
  display: flex;
  gap: 8px;
}

.chat-header .conv-actions button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.chat-header .conv-actions button:hover {
  background: var(--bg4);
  color: var(--text);
}

/* Messages */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

.message .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.message.user .avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.message.assistant .avatar {
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--border);
}

.message .bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.user .bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-bottom-right-radius: 4px;
}

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

.message .timestamp {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  text-align: right;
}

.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  gap: 12px;
}

.empty-chat .logo-big {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-chat p { font-size: 14px; }

/* Thinking indicator */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-self: flex-start;
  margin-left: 44px;
  color: var(--text3);
  font-size: 13px;
}

.thinking-indicator .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-cancel-generate {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
  margin-left: 8px;
}
.btn-cancel-generate:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Input area */
.input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  transition: border 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
}

.input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  resize: none;
  min-height: 24px;
  max-height: 150px;
  line-height: 1.5;
  padding: 4px 0;
}

.input-wrapper textarea::placeholder { color: var(--text3); }

.input-wrapper button {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.input-wrapper button:hover { color: var(--text); }

.input-wrapper .send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
}

.input-wrapper .send-btn:hover { opacity: 0.9; color: #fff; }
.input-wrapper .send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.input-wrapper .voice-btn { font-size: 18px; }
.input-wrapper .voice-btn.recording { color: var(--red); animation: pulse 1s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.input-queue-info {
  font-size: 11px;
  color: var(--text3);
  text-align: right;
  margin-top: 4px;
  padding-right: 4px;
}

/* ============== MODAL ============== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal .modal-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
}

.modal .field {
  margin-bottom: 16px;
}

.modal label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
  font-weight: 500;
}

.modal input, .modal textarea, .modal select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border 0.2s;
}

.modal textarea { min-height: 80px; resize: vertical; }

.modal input:focus, .modal textarea:focus { border-color: var(--accent); }

.modal .modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.modal .modal-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal .modal-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.modal .modal-actions .btn-secondary {
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal .modal-actions .btn-danger {
  background: var(--red);
  color: #fff;
}

.modal .modal-actions .btn-success {
  background: var(--green);
  color: #000;
}

.modal .modal-actions button:hover { opacity: 0.9; }

/* Payment frame */
.payment-frame {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 16px;
}

/* ============== NOTIFICATION ============== */
.notification {
  position: fixed;
  bottom: 130px;
  right: 20px;
  padding: 12px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  z-index: 200;
  animation: slideUp 0.3s;
  max-width: 350px;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.notification.info { border-left: 3px solid var(--blue); }
.notification.success { border-left: 3px solid var(--green); }
.notification.error { border-left: 3px solid var(--red); }

/* ============== INFO PAGE ============== */
.info-text {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
  padding: 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ============== INPUT TOOLBAR ============== */
.input-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.tool-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn:hover { background: var(--bg4); color: var(--text); }

.attach-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0;
}

.attach-btn:hover { opacity: 0.9; color: #fff; }

.search-btn.active { background: var(--green); color: #000; border-color: var(--green); }
.search-btn:not(.active) { background: var(--bg3); color: var(--accent); border-color: var(--accent); }

.gps-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.gps-btn:not(.active) { background: var(--bg3); color: var(--text2); }

.gps-notification {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  box-shadow: var(--shadow);
  z-index: 10;
  animation: fadeIn 0.3s;
}

/* ============== ATTACHED FILES ============== */
.attached-files {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.attached-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text2);
}

.attached-file button {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}

.attached-file button:hover { color: var(--red); }

/* ============== ATTACH MODAL ============== */
.attach-modal { max-width: 380px; }

.attach-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.attach-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.attach-option:hover {
  background: var(--bg4);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.attach-icon { font-size: 32px; }
.attach-label { font-size: 14px; font-weight: 600; color: var(--text); }
.attach-desc { font-size: 11px; color: var(--text3); }

/* ============== SETTINGS MODAL ============== */
.settings-modal {
  max-width: 520px;
  padding: 0;
  overflow: hidden;
}

.settings-header {
  padding: 28px 32px 0;
}

.settings-header h2 {
  font-size: 22px;
  margin-bottom: 2px;
}

.settings-header .modal-subtitle {
  margin-bottom: 20px;
}

.settings-balance-card {
  margin: 0 16px 20px;
  background: linear-gradient(135deg, rgba(167,139,250,0.12), rgba(96,165,250,0.08));
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.sbc-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.settings-balance-card .settings-balance-amount {
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 6px 0;
  line-height: 1.1;
}

.settings-balance-card .settings-balance-est {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 14px;
}

.settings-topup-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.settings-topup-btn:hover { opacity: 0.9; }

.settings-section {
  padding: 0 32px;
  margin-bottom: 20px;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  margin-bottom: 16px;
}

.settings-row-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}

.settings-row-desc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.settings-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  transition: border 0.2s;
}

.settings-input:focus { border-color: var(--accent); }

.settings-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  transition: border 0.2s;
}

.settings-textarea:focus { border-color: var(--accent); }

.settings-charcount {
  font-size: 11px;
  color: var(--text3);
  text-align: right;
  margin-top: 4px;
}

.settings-row-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.settings-actions {
  display: flex;
  gap: 10px;
  padding: 16px 32px 28px;
}

.settings-actions button {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.settings-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.settings-actions .btn-secondary {
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text2);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: #fff;
}

/* ============== MESSAGE IMAGE ============== */
.msg-image {
  margin-bottom: 8px;
}

.msg-image img {
  width: 230px;
  height: 230px;
  object-fit: cover;
  border-radius: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
  border: 1px solid var(--border);
}

.msg-image img:hover { opacity: 0.9; }

/* ============== MSG FOOTER ============== */
.msg-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.rollback-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.5;
}

.message:hover .rollback-btn { opacity: 1; }
.rollback-btn:hover { color: var(--orange); background: rgba(251,146,60,0.1); }

/* ============== CONFIRM MODAL ============== */
.confirm-modal { max-width: 400px; text-align: center; }

/* ============== SEARCH RESULTS (future) ============== */
.search-results-card {
  padding: 12px 16px;
  margin: 8px 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.search-results-card:hover { background: var(--bg4); border-color: var(--accent); }
.search-results-card a { color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 500; display: block; }
.search-results-card a:hover { text-decoration: underline; }
.search-results-card .snippet { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ============== SLASH HINT ============== */
.slash-hint {
  display: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  margin-bottom: 6px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.slash-hint-item {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
}

.slash-hint-item:hover {
  background: var(--bg4);
  color: var(--text);
}

.slash-hint-item .sh-cmd {
  color: var(--text2);
  font-weight: 500;
}

/* ============== SUMMARY BUBBLE ============== */
.summary-bubble {
  color: var(--text3);
  font-style: italic;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; z-index: 50; width: 100%; }
  .sidebar.collapsed { display: none; }
  .sidebar.open.collapsed { display: flex; width: 100%; }
  .message { max-width: 95%; }
  .auth-box { padding: 24px; }
  .modal { padding: 24px; }
  .msg-image img { width: 150px; height: 150px; }
  .attach-options { grid-template-columns: 1fr; }
}
