/* ═══════════════════════════════════════════════════════════
   K-XpertAI CSS — Blue Theme (replaces orange/amber)
═══════════════════════════════════════════════════════════ */

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

:root {
  /* ── Blue accent palette (was orange/amber) ── */
  --accent:          #2563eb;
  --accent-hover:    #1d4ed8;
  --accent-light:    #3b82f6;
  --accent-dim:      rgba(37, 99, 235, 0.15);
  --accent-glow:     rgba(37, 99, 235, 0.25);

  /* ── Backgrounds ── */
  --bg:              #0d0f14;
  --bg-panel:        #111318;
  --bg-sidebar:      #0b0d11;
  --bg-input:        #161820;
  --bg-msg-ai:       #13151c;
  --bg-msg-user:     #1a2340;
  --bg-hover:        #1c1f2a;
  --bg-modal:        #161921;
  --bg-code:         #0e1016;

  /* ── Borders ── */
  --border:          #1e2230;
  --border-input:    #252840;
  --border-focus:    #2563eb;

  /* ── Text ── */
  --text:            #e8eaf2;
  --text-dim:        #9aa3c0;
  --text-muted:      #5a6380;
  --text-code:       #a8d8ff;

  /* ── Status ── */
  --green:           #22c55e;
  --red:             #ef4444;
  --yellow:          #f59e0b;

  /* ── Misc ── */
  --radius:          10px;
  --radius-lg:       14px;
  --shadow:          0 4px 24px rgba(0,0,0,.5);
  --shadow-sm:       0 2px 8px rgba(0,0,0,.3);
  --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sidebar-w:       260px;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ═══════════════════ SCROLLBAR ═══════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #252840; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #303560; }

/* ═══════════════════ LAYOUT ═══════════════════ */
body { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  transition: transform .25s ease;
  z-index: 100;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ═══════════════════ SIDEBAR ═══════════════════ */
.sidebar-top {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

.logo-icon {
  width: 30px; height: 30px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--accent-light);
  flex-shrink: 0;
}

.logo-icon img { width: 22px; height: 22px; object-fit: contain; }
.logo-text { color: var(--text); letter-spacing: -.3px; }

.new-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background .15s, transform .1s;
}
.new-chat-btn:hover { background: var(--accent-hover); }
.new-chat-btn:active { transform: scale(.98); }

.sidebar-label {
  padding: 14px 14px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 6px 12px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  transition: background .12s, color .12s;
  position: relative;
}
.chat-item:hover { background: var(--bg-hover); color: var(--text); }
.chat-item.active {
  background: var(--accent-dim);
  color: var(--accent-light);
  border: 1px solid rgba(37,99,235,.25);
}
.chat-item-txt {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.del-chat-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 12px; padding: 2px 4px;
  border-radius: 4px; opacity: 0; transition: opacity .15s, color .12s;
  flex-shrink: 0;
}
.chat-item:hover .del-chat-btn { opacity: 1; }
.del-chat-btn:hover { color: var(--red); }

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.model-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px;
  width: 100%; cursor: pointer; color: var(--text-dim);
  font-size: 12px; transition: background .12s, color .12s;
}
.model-badge:hover { background: var(--bg-input); color: var(--text); }
.model-lbl { flex: 1; text-align: left; font-size: 12px; }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; box-shadow: 0 0 6px var(--accent-glow); }
  50%      { opacity: .6; box-shadow: 0 0 12px var(--accent-glow); }
}

/* ═══════════════════ TOPBAR ═══════════════════ */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  min-height: 54px;
  flex-shrink: 0;
}

.menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 6px; border-radius: 6px;
  transition: background .12s, color .12s;
}
.menu-btn:hover { background: var(--bg-hover); color: var(--text); }

.topbar-title {
  flex: 1; font-size: 14px; font-weight: 600;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.prov-pill {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,.3);
  border-radius: 20px; padding: 4px 10px;
  color: var(--accent-light); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.prov-pill:hover { background: rgba(37,99,235,.22); }

.icon-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 7px; border-radius: 7px;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ═══════════════════ CHAT AREA ═══════════════════ */
.chat-area {
  flex: 1; overflow-y: auto; padding: 24px 0 16px;
}

.msgs-wrap {
  max-width: 780px; margin: 0 auto; padding: 0 20px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ═══════════════════ MESSAGES ═══════════════════ */
.msg { display: flex; flex-direction: column; gap: 6px; }

/* User message */
.msg-user {
  align-items: flex-end;
}
.msg-user .bubble {
  background: var(--bg-msg-user);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 16px 16px 4px 16px;
  padding: 11px 15px;
  max-width: 80%;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.msg-user .msg-actions,
.msg-ai .msg-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.msg-user .msg-actions { justify-content: flex-end; }

/* AI message */
.msg-ai { align-items: flex-start; }

.ai-hdr {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px;
}

.ai-av {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--accent-light); flex-shrink: 0;
}
.ai-av img { width: 18px; height: 18px; object-fit: contain; }

.ai-name {
  font-size: 12px; font-weight: 700;
  color: var(--accent-light); letter-spacing: .02em;
}

.ai-bubble {
  background: var(--bg-msg-ai);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
  padding: 13px 16px;
  max-width: 88%;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.ai-bubble.stream-cur::after {
  content: '▋';
  color: var(--accent);
  animation: blink .7s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* File chip in user bubble */
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(37,99,235,.12); border: 1px solid rgba(37,99,235,.2);
  border-radius: 6px; padding: 5px 10px;
  font-size: 12px; color: var(--accent-light);
  margin-bottom: 6px;
}

/* ═══════════════════ THINK BLOCK ═══════════════════ */
.think-block {
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 10px; overflow: hidden;
  max-width: 88%; margin-bottom: 4px;
  font-size: 12px;
}

.think-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px;
  cursor: pointer;
  user-select: none;
}
.think-head:hover { background: rgba(37,99,235,.06); }

.think-dots {
  display: flex; gap: 3px; align-items: center;
}
.think-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  animation: bounce-dot .8s ease-in-out infinite;
}
.think-dots span:nth-child(2) { animation-delay: .15s; }
.think-dots span:nth-child(3) { animation-delay: .3s; }
.think-dots.done span { animation: none; background: var(--green); }

@keyframes bounce-dot {
  0%,100% { transform: translateY(0); opacity: .5; }
  50%      { transform: translateY(-3px); opacity: 1; }
}

.think-lbl { flex: 1; color: var(--text-dim); font-size: 12px; }
.think-chev { color: var(--text-muted); font-size: 10px; transition: transform .2s; }
.think-chev.open { transform: none; }
.think-chev:not(.open) { transform: rotate(-90deg); }

.think-body { display: none; padding: 0 13px 10px; }
.think-body.open { display: block; }

.think-steps { display: flex; flex-direction: column; gap: 4px; }
.think-step {
  font-size: 11.5px; color: var(--text-muted);
  padding: 2px 0;
  border-left: 2px solid rgba(37,99,235,.3);
  padding-left: 8px;
}
.think-step:last-child { color: var(--accent-light); border-color: var(--accent); }

/* ═══════════════════ ACTION BUTTONS ═══════════════════ */
.act-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.act-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(37,99,235,.35);
  color: var(--accent-light);
}
.act-btn.speaking {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.3);
  color: var(--red);
}

/* ═══════════════════ IMAGE PREVIEW ═══════════════════ */
.img-preview {
  max-width: 280px; max-height: 200px;
  border-radius: 8px; display: block;
  border: 1px solid var(--border);
  margin-bottom: 6px; object-fit: cover;
}

/* ═══════════════════ GENERATED MEDIA ═══════════════════ */
.gen-img {
  max-width: 100%; border-radius: 10px;
  cursor: zoom-in; border: 1px solid var(--border);
  display: block; transition: opacity .4s, transform .2s;
}
.gen-img:hover { transform: scale(1.01); }

.gen-vid {
  max-width: 100%; border-radius: 10px;
  display: block; border: 1px solid var(--border);
  background: #000;
}

.media-loading {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 13px; padding: 8px 0;
}

.spin {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════ CODE BLOCKS ═══════════════════ */
.ai-bubble pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  margin: 10px 0; font-size: 13px;
}

.code-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-size: 11px; font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase; letter-spacing: .06em;
  font-family: var(--font-mono);
}

.copy-code {
  background: none; border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 8px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  transition: background .12s, color .12s;
}
.copy-code:hover { background: var(--accent-dim); color: var(--accent-light); }

.ai-bubble pre code {
  display: block; padding: 12px 14px;
  color: var(--text-code);
  font-family: var(--font-mono);
  font-size: 13px; line-height: 1.6;
  overflow-x: auto; white-space: pre;
}

.ai-bubble code:not(pre code) {
  background: rgba(37,99,235,.12);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 4px; padding: 1px 5px;
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--accent-light);
}

.ai-bubble p   { margin-bottom: 8px; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble ul  { padding-left: 18px; margin-bottom: 8px; }
.ai-bubble li  { margin-bottom: 4px; }
.ai-bubble strong { color: #c8d8ff; }

/* ═══════════════════ WELCOME SCREEN ═══════════════════ */
.welcome {
  text-align: center; padding: 48px 20px 32px;
}

.welcome-icon {
  font-size: 40px; margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.welcome h1 {
  font-size: 24px; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
  letter-spacing: -.4px;
}

.welcome p {
  font-size: 14px; color: var(--text-dim);
  max-width: 480px; margin: 0 auto 28px;
  line-height: 1.65;
}

.sugs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px; max-width: 560px; margin: 0 auto;
}

.sug {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px; text-align: left;
  cursor: pointer; color: var(--text);
  transition: background .15s, border-color .15s, transform .12s;
}
.sug:hover {
  background: var(--bg-hover);
  border-color: rgba(37,99,235,.4);
  transform: translateY(-1px);
}
.sug-icon { font-size: 18px; margin-bottom: 6px; }
.sug-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.sug-sub   { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

/* ═══════════════════ INPUT AREA ═══════════════════ */
.input-area {
  padding: 14px 20px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrap { max-width: 780px; margin: 0 auto; }

.input-box {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  transition: border-color .15s, box-shadow .15s;
}
.input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-row {
  display: flex; align-items: flex-end; padding: 12px 12px 0;
}

textarea#inp {
  flex: 1; background: none; border: none; outline: none;
  resize: none; color: var(--text);
  font-size: 14px; font-family: var(--font);
  line-height: 1.55; min-height: 22px; max-height: 180px;
  padding: 0 10px 0 0;
  overflow-y: auto;
}
textarea#inp::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent); border: none; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s, opacity .15s;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }

.input-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 10px; gap: 8px;
}

.input-tools { display: flex; gap: 4px; flex-wrap: wrap; }

.tool-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 5px 9px;
  border-radius: 7px; font-size: 12px;
  transition: background .12s, color .12s;
}
.tool-btn:hover { background: var(--bg-hover); color: var(--accent-light); }

.input-hint {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.input-hint kbd {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 10px;
  font-family: var(--font-mono); color: var(--text-dim);
}

/* ═══════════════════ MODALS ═══════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal, .gen-modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
  animation: modal-in .2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.modal-title {
  font-size: 16px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.modal-sub {
  font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 18px; line-height: 1.55;
}

.free-notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(34,197,94,.07);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 8px; padding: 11px 13px;
  font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 18px; line-height: 1.5;
}

.field-lbl {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .06em;
}
.opt-tag {
  background: rgba(37,99,235,.15); color: var(--accent-light);
  border-radius: 4px; padding: 1px 6px; font-size: 10px;
  text-transform: none; letter-spacing: 0; font-weight: 500;
}

.prov-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 8px; margin-bottom: 18px;
}

.prov-opt {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 10px;
  cursor: pointer; text-align: center;
  transition: background .12s, border-color .12s;
}
.prov-opt:hover { background: var(--bg-input); }
.prov-opt.sel {
  background: var(--accent-dim);
  border-color: rgba(37,99,235,.5);
}
.prov-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.prov-note { font-size: 11px; color: var(--text-muted); }

.modal-input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px; padding: 10px 13px;
  color: var(--text); font-size: 13px;
  font-family: var(--font); outline: none;
  transition: border-color .15s, box-shadow .15s;
  display: block; margin-bottom: 14px;
}
.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.modal-input::placeholder { color: var(--text-muted); }

.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}

.btn-ghost {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 16px;
  color: var(--text-dim); font-size: 13px; cursor: pointer;
  transition: background .12s, color .12s;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-primary {
  background: var(--accent); border: none;
  border-radius: 8px; padding: 8px 18px;
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ═══════════════════ VOICE PANEL ═══════════════════ */
.voice-panel {
  position: fixed; bottom: 90px; right: 20px;
  width: 280px; max-height: 360px;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px; overflow-y: auto;
  box-shadow: var(--shadow);
  z-index: 400;
  display: none;
}
.voice-panel.open { display: block; animation: modal-in .18s ease; }

.voice-panel-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
}
.voice-panel-close:hover { color: var(--text); }

.voice-panel-title {
  font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
}

.voice-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }

.voice-opt {
  display: flex; align-items: center;
  background: none; border: 1px solid transparent;
  border-radius: 7px; padding: 7px 10px;
  cursor: pointer; color: var(--text-dim);
  font-size: 12px; text-align: left;
  transition: background .12s, border-color .12s, color .12s;
}
.voice-opt:hover { background: var(--bg-hover); color: var(--text); }
.voice-opt.sel {
  background: var(--accent-dim);
  border-color: rgba(37,99,235,.3);
  color: var(--accent-light);
}

.voice-slider-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.voice-slider-row label { font-size: 11px; color: var(--text-dim); width: 34px; flex-shrink: 0; }
.voice-slider-row input[type=range] {
  flex: 1; accent-color: var(--accent); cursor: pointer;
}

/* ═══════════════════ TOAST ═══════════════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e2230; border: 1px solid var(--border);
  border-radius: 20px; padding: 8px 18px;
  font-size: 13px; color: var(--text);
  box-shadow: var(--shadow-sm);
  opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; z-index: 600; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════ SIDEBAR OVERLAY (mobile) ═══════════════════ */
.sb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 90;
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 720px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open { transform: none; }
  .sb-overlay.open { display: block; }
  .menu-btn { display: flex; }
  .topbar-title { font-size: 13px; }
  .sugs { grid-template-columns: 1fr; }
  .msgs-wrap { padding: 0 14px; }
  .input-area { padding: 10px 14px 16px; }
  .input-hint { display: none; }
  .ai-bubble, .think-block { max-width: 98%; }
}

@media (max-width: 440px) {
  .welcome h1 { font-size: 20px; }
  .prov-grid { grid-template-columns: 1fr; }
  .modal, .gen-modal { padding: 18px; }
}
