/* Choose AI on the web. The website's colours and type, the apps' chat. */

:root {
  --bg: #000000;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #232327;
  --hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f7;
  --text-2: rgba(245, 245, 247, 0.72);
  --text-3: rgba(245, 245, 247, 0.50);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.14);
  --purple: #8e6cf0;
  --green: #30d158;
  --warning: #ffd60a;
  --danger: #ff5c6c;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --side: 280px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border-strong); color: var(--text); background: var(--surface-2);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #2b95ff; }
.btn-ghost { background: transparent; }

/* ── Loading ───────────────────────────────────────── */
.loading { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sign-in ───────────────────────────────────────── */
.signin {
  min-height: 100%; display: grid; place-items: center; padding: 40px 16px;
  background: radial-gradient(1100px 520px at 50% -10%, rgba(10, 132, 255, .16), transparent 60%), var(--bg);
}
.signin-card { width: 100%; max-width: 440px; text-align: center; }
.signin-logo { border-radius: 16px; margin-bottom: 18px; }
.signin h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
.signin-lead { color: var(--text-2); margin: 0 0 26px; }
.btn-google { width: 100%; max-width: 320px; }
.btn-google svg { width: 18px; height: 18px; stroke: none; }
.signin-error {
  margin: 16px auto 0; max-width: 380px; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  color: var(--text); background: rgba(255, 92, 108, .08); border: 1px solid rgba(255, 92, 108, .35);
}
.signin-points { list-style: none; padding: 0; margin: 28px auto 22px; max-width: 360px; text-align: left; color: var(--text-2); font-size: 14px; }
.signin-points li { position: relative; padding-left: 22px; margin: 7px 0; }
.signin-points li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.fine { color: var(--text-3); font-size: 13px; margin: 0; }
.fine.trademarks { margin-top: 14px; font-size: 11.5px; line-height: 1.5; }

/* ── The app ───────────────────────────────────────── */
.app { display: flex; height: 100%; height: 100dvh; overflow: hidden; }

.sidebar {
  width: var(--side); flex: none; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); min-height: 0;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; white-space: nowrap; }
.brand img { border-radius: 7px; }
.brand:hover { text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.side-close { display: none; }

.new-chat {
  display: flex; align-items: center; gap: 8px; margin: 2px 12px 12px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-weight: 600; font-size: 14px;
}
.new-chat:hover { background: var(--hover); border-color: var(--border-strong); }
.list-title { padding: 0 16px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.chat-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; min-height: 0; }
.chat-item {
  position: relative; display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 8px 8px 8px 10px; border-radius: 10px; color: var(--text-2); text-align: left; font-size: 14px;
}
.chat-item:hover, .chat-item.active { background: var(--hover); color: var(--text); }
.chat-item.active { background: var(--accent-soft); }
.chat-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-source { flex: none; font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.chat-delete { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--text-3); opacity: 0; }
.chat-delete svg { width: 15px; height: 15px; }
.chat-item:hover .chat-delete, .chat-item.active .chat-delete, .chat-delete:focus-visible, .chat-delete.confirm { opacity: 1; }
.chat-delete:hover { color: var(--danger); background: rgba(255, 92, 108, .1); }
.chat-delete.confirm { width: auto; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--danger); background: rgba(255, 92, 108, .12); }
.list-empty { padding: 10px 12px; color: var(--text-3); font-size: 13px; }
.sync-note { margin: 0 14px 8px; font-size: 12px; color: var(--text-3); }
.sync-note p { margin: 0 0 4px; }
.sync-note.warn { color: var(--warning); }
.sync-note .link-btn { font-size: 12px; color: var(--text); text-decoration: underline; }
/* A chat in the list that isn't synced: on its way, or needing a look. */
.chat-sync { flex: none; display: grid; place-items: center; width: 16px; height: 16px; color: var(--text-3); }
.chat-sync svg { width: 14px; height: 14px; }
.chat-sync.warn { color: var(--warning); }
.chat-sync.busy svg, .chat-status.busy .chat-status-icon svg { animation: spin 1.1s linear infinite; }
/* Under the open chat: where it stands, and what can be done about it. */
.chat-status { max-width: 760px; margin: 0 auto; padding: 0 20px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; font-size: 12px; color: var(--text-3); }
.chat-status-icon { display: grid; place-items: center; }
.chat-status-icon svg { width: 14px; height: 14px; }
.chat-status.warn { justify-content: flex-start; color: var(--warning); }
.chat-status-text { min-width: 0; }
.chat-status .link-btn { font-size: 12px; color: var(--text); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .chat-sync.busy svg, .chat-status.busy .chat-status-icon svg { animation: none; }
}

.account { border-top: 1px solid var(--border); padding: 12px 14px 14px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; font-weight: 700; font-size: 14px;
}
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 12px 0 6px; font-size: 13px; }
.plan-name { font-weight: 650; }
.tokens-left { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--purple)); transition: width .4s; }
.meter.low span { background: var(--warning); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch {
  appearance: none; flex: none; width: 34px; height: 20px; border-radius: 999px; margin: 0;
  background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .15s;
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--green); border-color: var(--green); }
.switch:checked::after { transform: translateX(14px); }
.account-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.link-btn { font-size: 13px; color: var(--text-2); padding: 2px 0; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
#deleteSynced:hover { color: var(--danger); }

/* ── Main column ───────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.menu { display: none; }
.modes { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.mode { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.mode svg { width: 14px; height: 14px; }
.mode:hover { color: var(--text); }
.mode.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
#modeCode { color: var(--text-3); }
#modeCode:hover { color: var(--text-2); }
.model-pick { margin-left: auto; min-width: 0; position: relative; }
.model-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 250px; height: 34px; padding: 0 8px 0 10px;
  border-radius: 10px; font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--border);
}
.model-btn:hover { border-color: var(--border-strong); }
.model-btn[aria-expanded="true"] { border-color: var(--border-strong); background: var(--surface-3); }
.model-btn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-btn .chev { width: 16px; height: 16px; color: var(--text-3); }
.model-logo { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.model-logo img { width: 18px; height: 18px; display: block; }
.model-logo svg { width: 16px; height: 16px; color: var(--text-2); }
.model-menu {
  position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; width: 290px; max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; border-radius: 14px; outline: none;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
}
.model-group + .model-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.model-group-title { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-3); }
.model-opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.model-opt.active { background: var(--hover); }
.model-opt[aria-disabled="true"] { cursor: default; color: var(--text-3); }
.model-opt[aria-disabled="true"] .model-logo { opacity: .45; }
.model-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-opt-mark { display: inline-grid; width: 16px; flex: none; color: var(--accent); }
.model-opt-mark svg { width: 15px; height: 15px; }
.model-opt[aria-disabled="true"] .model-opt-mark { color: var(--text-3); }
.model-note { margin: 6px 4px 2px; padding: 8px 6px 2px; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.45; color: var(--text-3); }

.thread { flex: 1; overflow-y: auto; min-height: 0; }
.empty { max-width: 680px; margin: 0 auto; padding: 14vh 20px 20px; text-align: center; }
.empty img { border-radius: 12px; opacity: .95; }
.empty h2 { font-size: 26px; letter-spacing: -0.02em; margin: 14px 0 22px; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.suggestions button {
  padding: 12px 14px; text-align: left; border: 1px solid var(--border); border-radius: 14px; color: var(--text-2);
  background: var(--surface); font-size: 14px; transition: border-color .15s, color .15s;
}
.suggestions button:hover { border-color: var(--border-strong); color: var(--text); }

.messages { max-width: 760px; margin: 0 auto; padding: 24px 20px 8px; }
.msg { margin: 0 0 22px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble {
  max-width: 82%; padding: 10px 15px; border-radius: 18px 18px 6px 18px; background: var(--surface-3);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.assistant .meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12.5px; color: var(--text-3); }
.msg.assistant .meta > img { border-radius: 5px; }
.msg-error {
  margin-top: 8px; padding: 10px 13px; border-radius: 12px; font-size: 14px;
  background: rgba(255, 92, 108, .07); border: 1px solid rgba(255, 92, 108, .3); color: var(--text);
}
.msg-error a { font-weight: 600; }
.thinking { display: inline-flex; gap: 4px; padding: 8px 0; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Replies: what lib/markdown.js writes */
.prose { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose li.task { list-style: none; margin-left: -20px; display: flex; gap: 8px; align-items: baseline; }
.prose .check { flex: none; width: 13px; height: 13px; border: 1.5px solid var(--text-3); border-radius: 4px; transform: translateY(2px); }
.prose .check.done { background: var(--green); border-color: var(--green); }
.prose h3, .prose h4, .prose h5 { margin: 18px 0 8px; line-height: 1.35; }
.prose .md-h1 { font-size: 20px; } .prose .md-h2 { font-size: 17px; } .prose .md-h3 { font-size: 15.5px; }
.prose blockquote { margin: 0 0 12px; padding: 2px 0 2px 14px; border-left: 3px solid var(--purple); color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.prose code { font: 13px/1.5 var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose .table { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { padding: 8px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose .math-block { margin: 0 0 12px; overflow-x: auto; overflow-y: hidden; }
.prose .math-raw { white-space: pre-wrap; }
.prose .math-line { display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: middle; }
.code { margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 12px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.code-copy { font-size: 12px; color: var(--text-2); padding: 2px 8px; border-radius: 6px; }
.code-copy:hover { background: var(--hover); color: var(--text); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 13px/1.55 var(--mono); }
.code pre code { background: none; border: 0; padding: 0; }

/* ── Composer ──────────────────────────────────────── */
.composer {
  display: flex; align-items: flex-end; gap: 8px; width: calc(100% - 40px); max-width: 760px; margin: 10px auto 0;
  padding: 8px 8px 8px 16px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: rgba(10, 132, 255, .6); box-shadow: 0 0 0 3px rgba(10, 132, 255, .12); }
.composer textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: none; color: var(--text);
  font: inherit; font-size: 15px; line-height: 1.5; padding: 7px 0; max-height: 220px;
}
.composer textarea::placeholder { color: var(--text-3); }
.send {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; transition: background .15s, opacity .15s;
}
.send svg { stroke-width: 2.2; }
.send:disabled { opacity: .35; }
.send .i-stop { display: none; fill: currentColor; stroke: none; }
.send.running { background: var(--text); color: var(--bg); }
.send.running .i-send { display: none; }
.send.running .i-stop { display: block; }
.disclaimer { margin: 8px 0 12px; text-align: center; font-size: 12px; color: var(--text-3); }

/* ── Modal ─────────────────────────────────────────── */
/* The <dialog> itself is the dimmed full-window layer, so a click outside the
   card lands on it; the browser's own ::backdrop stays clear. */
.modal {
  position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; border: 0;
  place-items: center; padding: 16px; color: inherit; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px);
}
.modal[open] { display: grid; }
.modal::backdrop { background: transparent; }
.modal-card {
  width: 100%; max-width: 440px; padding: 26px 24px 20px; border-radius: 20px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.modal-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.modal-icon svg { width: 24px; height: 24px; }
.modal-icon.warn { background: rgba(255, 92, 108, .12); color: var(--danger); }
.modal h2 { margin: 0 0 8px; font-size: 19px; }
.modal p { margin: 0 0 20px; color: var(--text-2); font-size: 14.5px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.modal-actions .btn { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #ff7482; }

/* Connected apps: one account, the same Composio connections as the apps. */
.connector-entry { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin: 2px 0 10px; border-radius: 10px; color: var(--text-2); text-align: left; }
.connector-entry:hover { background: var(--hover); color: var(--text); }
#connectorCount { font-size: 12px; color: var(--text-3); }
.connect-apps { flex: none; align-self: end; margin-bottom: 4px; }
.connectors-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border-strong); border-radius: 20px; color: var(--text); background: var(--surface); }
.connectors-dialog::backdrop { background: #0009; backdrop-filter: blur(6px); }
.connectors-card { padding: 24px; }
.connectors-card header { display: flex; align-items: flex-start; gap: 16px; }
.connectors-card header > div { flex: 1; }
.connectors-card h2 { margin: 0 0 8px; font-size: 22px; }
.connectors-card header p, .connector-footnote { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: 0 0 18px; }
.connector-controls { display: flex; gap: 10px; }
.connector-controls input { min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.connector-notice { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.connector-notice:empty { display: none; }
.connector-list h3 { color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 24px 0 6px; }
.connector-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.connector-row > div:first-child { flex: 1; min-width: 0; }
.connector-row b, .connector-row small { display: block; }
.connector-row b { font-size: 14px; }
.connector-row small { font-size: 12px; color: var(--text-3); margin-top: 4px; overflow-wrap: anywhere; }
.connector-row .connector-connected { color: #5dd99a; }
.connector-row .connector-error { color: var(--danger); }
.connector-row .btn, .connector-controls .btn { padding: 8px 12px; font-size: 12px; flex: none; }
.connector-row button:disabled { opacity: .5; cursor: default; }
.connector-disconnect p { font-size: 13px; margin: 0 0 12px; }
.connector-disconnect button + button { margin-left: 8px; }
.connector-footnote { margin: 22px 0 0; }
.tool-status { font-size: 12px; color: var(--text-3); margin: 12px 0; }
.tool-status:empty { display: none; }
#modalBody { white-space: pre-wrap; max-height: 48dvh; overflow: auto; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 520px) { .connectors-card { padding: 18px; } .connector-row { gap: 10px; } }

.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, .55); }

/* ── Phones and small windows ──────────────────────── */
@media (max-width: 820px) {
  .sidebar {
    position: fixed; z-index: 20; inset: 0 auto 0 0; width: min(86vw, 320px);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 10px 0 40px rgba(0, 0, 0, .5);
  }
  .app.side-open .sidebar { transform: none; }
  .side-close, .menu { display: inline-grid; }
  .top { padding: 8px 10px; gap: 6px; }
  .mode { padding: 0 9px; }
  .model-btn { max-width: 170px; }
  .messages { padding: 18px 16px 6px; }
  .chat-status { padding: 0 16px 14px; }
  .composer { width: calc(100% - 32px); }
  .empty { padding-top: 9vh; }
}
@media (max-width: 480px) {
  .mode span { display: none; }
  #modeCode::after { content: "Code"; }
  .model-btn { max-width: 150px; }
  .model-menu { position: fixed; top: 56px; left: 16px; right: 16px; width: auto; }
  .suggestions { grid-template-columns: 1fr; }
  .msg.user .bubble { max-width: 90%; }
}

.profile-menu{position:relative}.profile-menu summary{list-style:none;cursor:pointer;border-radius:8px}.profile-menu summary::-webkit-details-marker{display:none}.profile-menu summary::after{content:'⌄';margin-left:auto;color:var(--text-3)}.profile-actions{margin-top:8px;padding:8px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.profile-actions button{display:block;width:100%;text-align:left;padding:8px 10px}.profile-actions button[aria-current=page]{color:var(--accent)}
