:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f6f3ed;
  --sidebar: #f2efe8;
  --ink: #262624;
  --muted: #6b6862;
  --faint: #7c766c;
  --line: #e7e1d6;
  --line-soft: #efeae1;
  --accent: #c96442;
  --accent-ink: #a84f31;
  --accent-soft: #fbece5;
  --green: #3f7d58;
  --red: #b44237;
  --amber: #b07d24;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(38, 38, 36, .05), 0 8px 24px -12px rgba(38, 38, 36, .18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #1b1a18;
  --surface: #232220;
  --surface-2: #2a2825;
  --sidebar: #171614;
  --ink: #f5f2ec;
  --muted: #a8a29a;
  --faint: #9a948b;
  --line: #35332e;
  --line-soft: #2c2a26;
  --accent: #d97b57;
  --accent-ink: #e79273;
  --accent-soft: #33241d;
  --green: #6aa87f;
  --red: #d97a6d;
  --amber: #d6a45a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); color: var(--ink); }

svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------- auth ---------------- */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  background: var(--bg);
}
.auth-side {
  padding: 56px 6vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(201, 100, 66, .07), transparent 60%),
    var(--bg);
}
.auth-brand { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.auth-brand span { color: var(--accent); }
.auth-claim { max-width: 460px; }
.auth-claim h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 18px; font-weight: 640; text-wrap: balance; }
.auth-claim p { color: var(--muted); margin: 0; font-size: 15px; max-width: 44ch; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; color: var(--muted); font-size: 13.5px; }
.auth-point svg { color: var(--accent); margin-top: 2px; }
.auth-foot { color: var(--faint); font-size: 12px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 372px; }
.auth-card h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.tabs button { flex: 1; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 560; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 84px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 550;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-theme="dark"] .btn.primary { color: #201d1a; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.form-error { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); padding: 9px 11px; border-radius: 9px; font-size: 13px; margin-bottom: 12px; }
.form-ok { background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); padding: 9px 11px; border-radius: 9px; font-size: 13px; margin-bottom: 12px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-panel { padding: 28px 20px; align-items: flex-start; padding-top: 12vh; }
}

/* ---------------- app shell ---------------- */
.app { display: flex; height: 100dvh; overflow: hidden; }
.sidebar {
  width: 268px; flex: none; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  transition: transform .22s ease;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.brand { font-size: 16px; font-weight: 660; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.sb-close { display: none; color: var(--muted); padding: 4px; }
.new-chat {
  margin: 6px 12px 10px; padding: 9px 12px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px; font-weight: 550;
  transition: border-color .12s, background .12s;
}
.new-chat:hover { border-color: var(--accent); background: var(--accent-soft); }
.new-chat svg { color: var(--accent); }
.sb-search { margin: 0 12px 8px; position: relative; }
.sb-search svg { position: absolute; left: 10px; top: 9px; color: var(--faint); }
.sb-search input {
  width: 100%; padding: 7px 10px 7px 32px; border-radius: 9px; border: 1px solid transparent;
  background: color-mix(in srgb, var(--ink) 4%, transparent); font-size: 13px; outline: none;
}
.sb-search input:focus { border-color: var(--line); background: var(--surface); }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; min-height: 0; }
.chat-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); padding: 12px 8px 5px; font-weight: 600; }
.chat-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink); cursor: pointer; position: relative;
}
.chat-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.chat-item.active { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); font-weight: 550; }
.chat-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .pin { color: var(--accent); }
.chat-item .more { opacity: 0; color: var(--muted); padding: 2px; border-radius: 5px; }
.chat-item:hover .more, .chat-item.active .more { opacity: 1; }
.chat-item .more:hover { background: var(--line); }
.sb-foot { border-top: 1px solid var(--line); padding: 10px; }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; width: 100%; text-align: left; }
.sb-user:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.avatar { width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; }
.sb-user .nm { font-size: 13px; font-weight: 560; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user .em { font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--bg); }
.topbar {
  height: 54px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); position: relative; z-index: 3;
}
.topbar .ttl { font-size: 14px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.menu-btn { display: none; }

/* ---------------- stream ---------------- */
.stream { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; padding: 0 0 24px; }
.stream-inner { max-width: 760px; margin: 0 auto; padding: 0 22px; }

.welcome { max-width: 700px; margin: 0 auto; padding: clamp(28px, 9vh, 96px) 22px 0; }
.welcome h1 { font-size: clamp(25px, 3.2vw, 34px); letter-spacing: -.03em; margin: 0 0 8px; font-weight: 630; text-wrap: balance; }
.welcome h1 span { color: var(--accent); }
.welcome p.sub { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }
.suggests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.suggest {
  text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  display: flex; flex-direction: column; gap: 5px; transition: border-color .14s, transform .14s, box-shadow .14s;
}
.suggest:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow); }
.suggest .h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 580; }
.suggest .h svg { color: var(--accent); }
.suggest .d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.msg { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.msg:last-child { border-bottom: none; }
.msg .av { width: 27px; height: 27px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.msg.user .av { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.msg.assistant .av { background: var(--accent); color: #fff; }
html[data-theme="dark"] .msg.assistant .av,
html[data-theme="dark"] .avatar { color: #201d1a; }
.msg .body { flex: 1; min-width: 0; }
.msg .who { font-size: 12.5px; font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.msg .who .m { font-weight: 400; color: var(--faint); font-size: 11.5px; }
.msg.user .content { white-space: pre-wrap; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; width: fit-content; max-width: 100%; }
.msg .content { overflow-wrap: anywhere; }
.msg .att { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg .att img { max-width: min(100%, 340px); border-radius: 10px; border: 1px solid var(--line); display: block; }
.msg .att .file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--muted); background: var(--surface); }
.actions { display: flex; gap: 2px; margin-top: 8px; opacity: 0; transition: opacity .12s; }
.msg:hover .actions, .msg .actions.always { opacity: 1; }
.act { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: var(--faint); }
.act:hover { background: var(--surface-2); color: var(--ink); }
.msg-foot { font-size: 11px; color: var(--faint); margin-top: 7px; display: flex; gap: 10px; align-items: center; }

.thinking { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin: 0 0 10px; overflow: hidden; }
.thinking summary { list-style: none; cursor: pointer; padding: 7px 11px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary .dots { display: inline-flex; gap: 3px; }
.thinking summary .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: blink 1.1s infinite; }
.thinking summary .dots i:nth-child(2) { animation-delay: .18s; }
.thinking summary .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.thinking .th-body { padding: 0 12px 10px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; max-height: 320px; overflow-y: auto; border-top: 1px solid var(--line-soft); padding-top: 9px; }

.tool-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 9px 12px; margin: 0 0 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.tool-card .tc-ico { width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.tool-card .tc-t { font-weight: 560; color: var(--ink); }
.tool-card .tc-s { font-size: 11.5px; color: var(--faint); }
.tool-card.run .tc-ico svg { animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-card.err { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }

.gen-image { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); max-width: 520px; }
.gen-image img { display: block; width: 100%; height: auto; }
.gen-image .gi-foot { display: flex; align-items: center; gap: 8px; padding: 8px 11px; font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--line-soft); }
.gen-image .gi-foot .sp { flex: 1; }

.file-card { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--surface); margin: 8px 0; font-size: 13px; }
.file-card .fc-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.file-card .fc-n { font-weight: 550; }
.file-card .fc-s { font-size: 11px; color: var(--faint); }

/* markdown */
.md { font-size: 15px; line-height: 1.68; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { letter-spacing: -.02em; line-height: 1.28; margin: 22px 0 10px; font-weight: 620; }
.md h1 { font-size: 23px; }
.md h2 { font-size: 19.5px; }
.md h3 { font-size: 17px; }
.md h4 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md li > p { margin: 0; }
.md blockquote { margin: 0 0 12px; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); color: var(--muted); }
.md hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.md code { font-family: var(--mono); font-size: 12.8px; background: var(--surface-2); padding: 2px 5px; border-radius: 5px; border: 1px solid var(--line-soft); }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.md img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }

.code { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; margin: 0 0 14px; background: var(--surface); }
.code-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.code-head .lang { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 10.5px; }
.code-head .sp { flex: 1; }
.code-head button { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 3px 6px; border-radius: 5px; }
.code-head button:hover { background: var(--line); color: var(--ink); }
.code pre { margin: 0; padding: 12px 13px; overflow-x: auto; font-family: var(--mono); font-size: 12.6px; line-height: 1.6; }
.code pre code { background: none; border: none; padding: 0; font-size: inherit; }
.tok-k { color: #a4562f; }
.tok-s { color: #4c7a52; }
.tok-c { color: var(--faint); font-style: italic; }
.tok-n { color: #7a5aa8; }
html[data-theme="dark"] .tok-k { color: #e79a6d; }
html[data-theme="dark"] .tok-s { color: #9dc9a9; }
html[data-theme="dark"] .tok-n { color: #c3a6e8; }

/* ---------------- composer ---------------- */
.composer-wrap { padding: 8px 22px 14px; background: linear-gradient(to top, var(--bg) 62%, transparent); }
.composer { max-width: 760px; margin: 0 auto; }
.comp-box {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(38, 38, 36, .04), 0 10px 24px -18px rgba(38, 38, 36, .28);
  transition: border-color .14s, box-shadow .14s;
}
.comp-box:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.comp-files { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 12px 0; }
.comp-files:empty { display: none; }
.cf { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px 4px 8px; background: var(--surface-2); color: var(--muted); max-width: 210px; }
.cf .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf button { color: var(--faint); display: grid; place-items: center; }
.cf button:hover { color: var(--red); }
.comp-box textarea {
  width: 100%; border: none; outline: none; background: transparent; resize: none;
  padding: 14px 15px 6px; font-size: 15px; line-height: 1.55; max-height: 40vh; min-height: 54px;
}
.comp-box textarea::placeholder { color: var(--faint); }
.comp-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px;
  font-size: 12px; color: var(--muted); border: 1px solid transparent; white-space: nowrap;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.chip svg { width: 14px; height: 14px; }
.chip.sel { border-color: var(--line); }
.comp-bar .sp { flex: 1; }
.send-btn {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: #fff; transition: background .12s, transform .08s;
}
html[data-theme="dark"] .send-btn { color: #201d1a; }
.send-btn:hover { background: var(--accent-ink); }
.send-btn:disabled { background: var(--line); color: var(--faint); cursor: default; }
.send-btn.stop { background: var(--ink); }
.comp-hint { text-align: center; font-size: 11px; color: var(--faint); padding: 7px 0 0; }
.comp-hint kbd { font-family: var(--font); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 10.5px; }

/* ---------------- canvas ---------------- */
.canvas { width: min(46vw, 620px); flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: var(--surface); }
.canvas-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.canvas-head .ct { font-size: 13px; font-weight: 560; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-body { flex: 1; min-height: 0; background: var(--bg); }
.canvas-body iframe { width: 100%; height: 100%; border: none; background: #fff; }

/* ---------------- modal ---------------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(20, 19, 17, .42); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; z-index: 60; animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-height: 86vh; display: flex; flex-direction: column; animation: pop .14s ease; }
.modal.wide { max-width: 620px; }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 15px 16px 0; }
.modal-head h3 { font-size: 15.5px; margin: 0; flex: 1; letter-spacing: -.01em; }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-foot { padding: 0 16px 16px; display: flex; gap: 8px; justify-content: flex-end; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { color: var(--muted); }
.menu-item.danger { color: var(--red); }
.menu-item.danger svg { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.toast-host { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 999px; font-size: 12.5px; box-shadow: var(--shadow); animation: toastIn .18s ease; }
.toast.err { background: var(--red); color: #fff; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .canvas { width: min(50vw, 520px); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 50; transform: translateX(-102%); box-shadow: var(--shadow); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 19, 17, .4); z-index: 40; }
  .sb-close { display: grid; }
  .menu-btn { display: grid; }
  .stream-inner { padding: 0 15px; }
  .composer-wrap { padding: 6px 12px 10px; }
  .welcome { padding-top: 26px; }
  .suggests { grid-template-columns: 1fr; }
  .canvas { position: fixed; inset: 54px 0 0 0; width: 100%; z-index: 45; }
  .msg { gap: 10px; padding: 14px 0; }
  .msg .av { width: 24px; height: 24px; }
  .comp-box textarea { font-size: 16px; }
  .chat-item .more { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
