/* ============================================================
   AI Chat — design system
   Canvas gần đen, phân tầng bằng luminance, viền hairline,
   một accent duy nhất cho trạng thái tương tác.
   ============================================================ */
:root {
  --bg: #0b0c0f;
  --side: #101114;
  --surface: #17181c;
  --surface-2: #1f2126;
  --surface-3: #26282e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e6e8eb;
  --text-strong: #f5f6f7;
  --muted: #9aa0a8;
  --faint: #6b7178;
  --accent: #5e6ad2;
  --accent-hover: #6d78e0;
  --accent-soft: rgba(94, 106, 210, 0.14);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --success: #3fb68b;
  --code-bg: #131417;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv01", "ss03";
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
.hidden, [hidden] { display: none !important; }
::selection { background: rgba(94, 106, 210, 0.35); }
:focus-visible { outline: 2px solid rgba(94, 106, 210, 0.65); outline-offset: 2px; border-radius: var(--radius-s); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Overlay màn hình auth/admin */
.screen {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center; padding: 20px;
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(10px);
}
#screen-admin { display: block; overflow-y: auto; background: var(--bg); z-index: 600; }

/* ==================== APP ==================== */
.app {
  height: 100vh; display: flex;
  background: var(--bg);
}

/* ==================== AUTH ==================== */
.auth-card {
  width: min(400px, 100%); padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: rise-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.auth-logo {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center;
}
.auth-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-strong); }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 22px; }
.auth-tabs { display: flex; padding: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-m); margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: color 0.15s, background 0.15s; }
.auth-tab.active { background: var(--surface-2); color: var(--text-strong); }
.auth-tab:hover:not(.active) { color: var(--text); }
.auth-form { display: grid; gap: 10px; }
.auth-form input, .add-model input, .add-model select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-m);
  outline: none;
  transition: border-color 0.15s;
}
.auth-form input:focus, .add-model input:focus, .add-model select:focus { border-color: var(--accent); }
.auth-form input::placeholder, .add-model input::placeholder { color: var(--faint); }
.btn-auth, .btn-primary {
  border: 0; background: var(--accent); color: #fff;
  border-radius: var(--radius-s);
  padding: 11px 18px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background 0.15s;
}
.btn-auth:hover, .btn-primary:hover { background: var(--accent-hover); }
.btn-auth:active, .btn-primary:active { transform: translateY(0.5px); }
.auth-msg, .admin-msg, .err-msg {
  margin-top: 12px; padding: 9px 12px;
  border-radius: var(--radius-s);
  background: var(--danger-soft); border: 1px solid rgba(229, 72, 77, 0.3);
  color: #ff9a96; font-size: 13px;
}
.auth-note { color: var(--faint); font-size: 12px; margin-top: 18px; line-height: 1.5; }
.auth-guest { margin-top: 10px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 10px; transition: color 0.15s; }
.auth-guest:hover { color: var(--text-strong); }

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 288px; min-width: 288px;
  background: var(--side);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 10px 10px 8px; gap: 4px;
  transition: width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), min-width 0.22s;
}
.brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; }
.logo {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 7px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { flex: 1; font-size: 14.5px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.01em; white-space: nowrap; }
.sidebar-collapse { margin-left: auto; }
.btn-new, .btn-admin-nav {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: none; color: var(--text); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.btn-new { background: var(--accent-soft); border-color: rgba(94, 106, 210, 0.25); color: var(--text-strong); }
.btn-new:hover { background: rgba(94, 106, 210, 0.22); }
.btn-admin-nav { color: var(--muted); }
.btn-admin-nav:hover { background: var(--surface-2); color: var(--text-strong); }
.guest-save-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 6px 4px 4px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  color: var(--muted); font-size: 12.5px; line-height: 1.45;
  background: rgba(255, 255, 255, 0.02);
}
.guest-save-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--faint); }
.link-btn { border: 0; background: none; color: var(--accent); font-size: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--accent-hover); }
.threads { flex: 1; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; display: flex; flex-direction: column; gap: 1px; }
.thread {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--muted); font-size: 13px; cursor: pointer;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.thread:hover { background: var(--surface-2); color: var(--text); }
.thread.active { background: var(--surface-2); color: var(--text-strong); }
.t-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-del {
  opacity: 0; border: 0; background: none; color: var(--faint);
  width: 24px; height: 24px; border-radius: var(--radius-s);
  display: grid; place-items: center; cursor: pointer;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.t-del svg { width: 14px; height: 14px; }
.thread:hover .t-del { opacity: 1; }
.t-del:hover { color: var(--danger); background: var(--danger-soft); }
.sidebar-signin {
  align-self: flex-start; margin: 6px 4px 2px;
  border: 1px solid var(--border-strong); background: none; color: var(--text);
  border-radius: var(--radius-s); padding: 8px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.sidebar-signin:hover { background: var(--surface-2); border-color: var(--accent); }
.sidebar-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; padding: 10px 8px 2px;
  border-top: 1px solid var(--border);
  color: var(--faint); font-size: 12px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.sidebar.collapsed { width: 64px; min-width: 64px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .guest-save-note,
.sidebar.collapsed .threads, .sidebar.collapsed .sidebar-signin,
.sidebar.collapsed .sidebar-foot, .sidebar.collapsed .btn-new span,
.sidebar.collapsed .btn-admin-nav { font-size: 0; }
.sidebar.collapsed .btn-new, .sidebar.collapsed .btn-admin-nav { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .brand { padding: 0; justify-content: center; }
.sidebar.collapsed .sidebar-collapse { margin: 0; }

/* ==================== MAIN / TOPBAR ==================== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
#btn-menu { display: none; }
.topbar-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.guest-nav, .topbar-right { display: flex; align-items: center; gap: 8px; }
.guest-nav { gap: 16px; }
.guest-nav a { color: var(--muted); text-decoration: none; font-size: 13.5px; transition: color 0.15s; }
.guest-nav a:hover { color: var(--text-strong); }
.signin-pill {
  border: 1px solid var(--border-strong); background: none; color: var(--text-strong);
  border-radius: var(--radius-s); padding: 7px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.signin-pill:hover { background: var(--surface-2); border-color: var(--accent); }
.icon-btn {
  width: 34px; height: 34px; border: 0; background: transparent;
  color: var(--muted); border-radius: var(--radius-s);
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text-strong); }
.icon-btn[hidden] { display: none; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-strong); font-size: 12px; font-weight: 600;
  display: grid; place-items: center; text-transform: uppercase; user-select: none;
}

/* ==================== MESSAGES ==================== */
.messages {
  flex: 1; overflow-y: auto; scroll-behavior: smooth;
  background: radial-gradient(1100px 520px at 50% 24%, rgba(94, 106, 210, 0.055), transparent 62%);
}
.welcome {
  min-height: calc(100% - 16px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px 120px; text-align: center;
  animation: rise-in 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.welcome-icon {
  width: 40px; height: 40px; margin-bottom: 20px;
  border-radius: 11px; background: var(--accent-soft);
  border: 1px solid rgba(94, 106, 210, 0.3);
  color: var(--accent-hover); font-size: 14px; font-weight: 700;
  display: grid; place-items: center; letter-spacing: 0.02em;
}
.welcome h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); }
.greet-gradient { margin: 6px 0 28px; font-size: 15px; color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 8px; width: min(600px, 100%); }
.chip {
  padding: 13px 15px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.02); color: var(--text);
  font-size: 13.5px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); background: var(--surface-2); }
.chip:active { transform: translateY(0.5px); }
.chip-icon { margin-right: 8px; color: var(--muted); }
.msg {
  width: min(760px, 100%); margin: 0 auto;
  padding: 18px 24px; display: flex; gap: 14px; align-items: flex-start;
  animation: rise-in 220ms ease both;
}
.msg.user { flex-direction: row-reverse; }
.msg .avatar {
  width: 30px; height: 30px; flex: 0 0 30px; margin-top: 2px;
  border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--muted); user-select: none;
}
.msg.user .avatar { background: var(--accent); border-color: var(--accent); color: #fff; }
.bubble, .content { line-height: 1.65; overflow-wrap: anywhere; }
.msg.user .bubble { color: var(--text-strong); font-size: 15px; padding-top: 4px; white-space: pre-wrap; }
.content { flex: 1; min-width: 0; font-size: 15px; color: var(--text); padding-top: 2px; }
.content p { margin: 7px 0; }
.content h1, .content h2, .content h3 { margin: 14px 0 7px; line-height: 1.3; color: var(--text-strong); }
.content h1 { font-size: 19px; } .content h2 { font-size: 17px; } .content h3 { font-size: 15.5px; }
.content ul, .content ol { margin: 7px 0; padding-left: 22px; }
.content li { margin: 3px 0; }
.content a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.content blockquote { border-left: 2px solid var(--border-strong); padding: 2px 0 2px 12px; margin: 9px 0; color: var(--muted); }
.content table { border-collapse: collapse; margin: 10px 0; }
.content th, .content td { border: 1px solid var(--border); padding: 6px 11px; font-size: 13.5px; text-align: left; }
.content th { background: var(--surface-2); }
.content code, .admin-table code {
  background: var(--code-bg); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 5px;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace; font-size: 13px;
}
.content pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px 16px; overflow-x: auto; margin: 11px 0; }
.content pre code { border: 0; padding: 0; font-size: 13px; line-height: 1.55; }
.msg-actions { display: flex; gap: 2px; margin-top: 8px; opacity: 0; transition: opacity 0.15s; }
.msg.assistant:hover .msg-actions { opacity: 1; }
.action-btn {
  border: 0; background: none; color: var(--faint);
  width: 28px; height: 28px; border-radius: var(--radius-s);
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.action-btn svg { width: 15px; height: 15px; }
.action-btn:hover { background: var(--surface-2); color: var(--text-strong); }
.reasoning { margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-m); padding: 8px 12px; background: rgba(255, 255, 255, 0.015); }
.reasoning summary { cursor: pointer; font-size: 12.5px; color: var(--faint); user-select: none; display: flex; align-items: center; gap: 6px; }
.reasoning summary svg { width: 12px; height: 12px; transition: transform 0.15s; color: var(--faint); }
.reasoning[open] summary svg { transform: rotate(90deg); }
.reasoning-body { margin-top: 8px; font-size: 13px; color: var(--muted); white-space: pre-wrap; max-height: 240px; overflow-y: auto; }
.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.16s; }
.typing span:nth-child(3) { animation-delay: 0.32s; }
.attached-img { max-width: 320px; max-height: 320px; border-radius: var(--radius-m); margin-top: 10px; border: 1px solid var(--border); display: block; }

/* ==================== COMPOSER ==================== */
.composer-wrap { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 4px 0 14px; position: relative; }
.composer {
  display: flex; align-items: flex-end; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-l);
  padding: 8px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.18); }
.composer textarea {
  flex: 1; resize: none; max-height: 180px; padding: 10px 8px;
  border: 0; outline: 0; background: none; color: var(--text);
  font-size: 15px; line-height: 1.5;
}
.composer textarea::placeholder { color: var(--faint); }
.btn-attach, .btn-send {
  width: 38px; height: 38px; flex: 0 0 38px;
  border: 0; border-radius: var(--radius-s);
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.btn-attach { background: transparent; color: var(--muted); }
.btn-attach:hover { background: var(--surface-2); color: var(--text-strong); }
.btn-attach:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-attach svg { width: 18px; height: 18px; }
.btn-send { background: var(--accent); color: #fff; }
.btn-send:hover { background: var(--accent-hover); }
.btn-send:active { transform: scale(0.96); }
.btn-send svg { width: 16px; height: 16px; }
.disclaimer { text-align: center; color: var(--faint); font-size: 11.5px; margin-top: 8px; }

/* ==================== ATTACHMENTS ==================== */
.attach-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.attach-item { position: relative; }
.attach-item img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-m); border: 1px solid var(--border); display: block; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  max-width: 220px; padding: 9px 30px 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  background: var(--surface); color: var(--text); font-size: 13px;
}
.file-icon { color: var(--muted); display: grid; place-items: center; }
.file-icon svg { width: 16px; height: 16px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-files { margin: 8px 0; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-s); color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.message-files span { display: inline-flex; align-items: center; gap: 6px; }
.message-files svg { width: 13px; height: 13px; color: var(--faint); }
.attach-x {
  position: absolute; right: -5px; top: -5px;
  width: 19px; height: 19px; border: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--muted);
  font-size: 12px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
}
.attach-x:hover { background: var(--danger); color: #fff; }
.main:has(.welcome) .composer-wrap { animation: rise-in 380ms 60ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ==================== ADMIN ==================== */
.admin-wrap { width: min(920px, 100%); margin: 0 auto; padding: 24px 20px 60px; }
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.admin-head h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-strong); }
.btn-ghost {
  padding: 7px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  background: none; color: var(--muted); font-size: 13px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-strong); }
.admin-card {
  padding: 20px 22px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-l);
  background: var(--surface);
}
.admin-card h2 { font-size: 14.5px; font-weight: 600; color: var(--text-strong); margin-bottom: 4px; letter-spacing: -0.01em; }
.admin-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.admin-table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.admin-table th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--faint); padding: 7px 10px; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.admin-table tr:last-child td { border-bottom: none; }
.add-model { display: flex; gap: 8px; flex-wrap: wrap; }
.add-model select, .add-model input { flex: 1; min-width: 180px; }
.btn-del { border: 0; background: none; color: var(--faint); width: 26px; height: 26px; border-radius: var(--radius-s); display: grid; place-items: center; cursor: pointer; transition: background 0.12s, color 0.12s; }
.btn-del:hover { color: var(--danger); background: var(--danger-soft); }
.btn-del svg { width: 14px; height: 14px; }
.badge { font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-admin { background: var(--accent-soft); color: var(--accent-hover); border-color: rgba(94, 106, 210, 0.35); }

/* ==================== TOGGLE ==================== */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  cursor: pointer; transition: background 0.18s, border-color 0.18s;
}
.slider::before {
  content: ""; position: absolute; width: 14px; height: 14px;
  left: 2px; top: 2px; border-radius: 50%;
  background: #fff; transition: transform 0.18s;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:disabled + .slider { opacity: 0.4; cursor: not-allowed; }
.slider.vision { display: grid; place-items: center; font-size: 10px; color: var(--muted); background: var(--surface-3); }
.slider.vision::before { display: none; }
.switch input:checked + .slider.vision { background: rgba(94, 106, 210, 0.35); border-color: var(--accent); color: #fff; }

/* ==================== MOTION ==================== */
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 760px) {
  .sidebar {
    position: fixed; z-index: 100; inset: 0 auto 0 0;
    transform: translateX(-105%);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  #btn-menu { display: grid; }
  .guest-nav a { display: none; }
  .topbar { padding: 0 10px; }
  .topbar-title { font-size: 13px; }
  .chips { grid-template-columns: 1fr; }
  .welcome { justify-content: flex-start; padding-top: 12vh; }
  .welcome h1 { font-size: 24px; }
  .msg { padding: 14px 14px; }
  .composer-wrap { width: calc(100% - 16px); padding-bottom: 8px; }
  .admin-card { padding: 16px; }
  .add-model > * { min-width: 100% !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
