/* ── Gallifai ──────────────────────────────────────────────────────────── */
:root {
  /* Discord's dark grey ramp: sidebar darkest, chat surface lightest. */
  --bg: #313338;
  --bg-side: #2b2d31;
  --bg-raised: #393b41;
  --bg-input: #383a40;
  --bg-hover: #404249;
  --line: #404249;
  --line-soft: #26282c;
  --text: #e3e5e8;
  --text-dim: #b5bac1;
  --text-faint: #8b919a;
  --accent: #c9ced6;
  --accent-2: #9096a0;
  --accent-soft: rgba(255, 255, 255, .09);
  --accent-ring: rgba(255, 255, 255, .13);
  --ok: #46c98a;
  --warn: #e8b95a;
  --err: #f2838d;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --side-w: 268px;
  --readable: 46rem;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell { display: flex; height: 100dvh; }

.side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--bg-side);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  transition: margin-left .28s var(--ease);
}
.shell.collapsed .side { margin-left: calc(-1 * var(--side-w)); }

.side-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 8px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  margin-right: auto; padding: 4px 6px;
  text-decoration: none; color: var(--text);
  font-weight: 650; letter-spacing: -.02em; font-size: 16px;
}
.brand-mark { width: 22px; height: 22px; flex: 0 0 22px; display: block; }
.brand-text { color: var(--text); }

.side-nav { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 1px; }

/* Flat rows — no rounded "card" behind each item. */
.nav-row, .conv-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--text-dim); text-align: left; cursor: pointer;
  font-size: 14.5px;
  transition: background .14s, color .14s;
}
.nav-row:hover, .conv-row:hover { background: var(--bg-hover); color: var(--text); }
.nav-row svg, .conv-row svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: thin; }
.side-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 10px 10px 6px;
}
.conv-list { display: flex; flex-direction: column; gap: 1px; }
.conv-row { display: block; }
.conv-row .conv-title {
  display: block; max-height: 20px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.conv-row.active { background: var(--bg-raised); color: var(--text); }
.conv-row .row-actions { display: none; }
.conv-row:hover .row-actions { display: inline-flex; }

.conv-skeleton { display: flex; flex-direction: column; gap: 9px; padding: 8px 10px; }
.conv-skeleton i {
  display: block; height: 11px; border-radius: 4px;
  background: linear-gradient(90deg, #2a2c31, #34363c, #2a2c31);
  background-size: 240% 100%;
  animation: shimmer 1.5s infinite linear;
}
.conv-skeleton i:nth-child(2) { width: 78%; }
.conv-skeleton i:nth-child(3) { width: 62%; }
.conv-skeleton i:nth-child(4) { width: 88%; }
@keyframes shimmer { to { background-position: -240% 0; } }

.side-foot { padding: 8px; border-top: 1px solid var(--line-soft); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 8px;
  background: none; border: 0; border-radius: var(--r-md);
  cursor: pointer; text-align: left;
  transition: background .14s;
}
.user-chip:hover { background: var(--bg-hover); }

/* True circles. */
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 12.5px; font-weight: 700;
  letter-spacing: .02em;
}
.avatar.lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 15px; }
/* The assistant's mark sits directly on the chat surface — no disc behind it. */
.avatar.mark { background: none; box-shadow: none; }
.avatar.mark img { width: 24px; height: 24px; display: block; }
.user-meta { min-width: 0; display: flex; flex-direction: column; }
.user-name { font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { font-size: 11.5px; color: var(--text-faint); }

.icon-btn {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--text-dim); cursor: pointer;
  transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── Main column ───────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.topbar {
  height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mobile-only { display: none; }

.model-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 999px;
  background: none; border: 0; cursor: pointer;
  color: var(--text-dim); font-size: 14.5px; font-weight: 550;
  transition: background .14s, color .14s;
}
.model-pill:hover { background: var(--bg-raised); color: var(--text); }
.model-pill svg { width: 16px; height: 16px; }
.model-pill-label { max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.route-badge {
  font-size: 11.5px; color: var(--text-faint);
  font-family: var(--mono);
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
}

.stage { flex: 1; overflow-y: auto; display: flex; flex-direction: column; scroll-behavior: smooth; }

.hero {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px; padding: 24px 20px 8px; min-height: 0;
}
.hero-title {
  margin: 0; font-size: clamp(24px, 3.4vw, 31px);
  font-weight: 600; letter-spacing: -.025em; text-align: center;
}
.hero-title { animation: rise .45s var(--ease) both; }
.hero-slots { animation: rise .45s .08s var(--ease) both; }
.hero .composer-slot { animation: rise .45s .14s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.hero-slots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; max-width: 40rem; }
.slot {
  padding: 8px 14px; border-radius: 999px;
  background: none; border: 1px solid var(--line);
  color: var(--text-dim); font-size: 13.5px; cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.slot:hover { border-color: #4a4d54; color: var(--text); background: var(--bg-raised); }

.thread { width: 100%; max-width: var(--readable); margin: 0 auto; padding: 8px 20px 40px; }

/* ── Messages ──────────────────────────────────────────────────────────── */
.msg { display: flex; gap: 14px; padding: 16px 0; animation: msgIn .34s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  background: var(--bg-raised); border-radius: var(--r-lg);
  padding: 10px 16px; max-width: 78%;
  white-space: pre-wrap; word-break: break-word;
}
.msg.assistant { align-items: flex-start; }
.msg .gutter { width: 30px; flex: 0 0 30px; }
.msg-body { min-width: 0; flex: 1; }

.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .85em; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.3em 0 .5em; font-weight: 620; letter-spacing: -.02em; line-height: 1.3; }
.md h1 { font-size: 1.34em; } .md h2 { font-size: 1.19em; } .md h3 { font-size: 1.07em; }
.md ul, .md ol { margin: 0 0 .9em; padding-left: 1.35em; }
.md li { margin: .22em 0; }
.md a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.md a:hover { border-bottom-color: var(--accent); }
.md blockquote {
  margin: 0 0 .9em; padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line); color: var(--text-dim);
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md code {
  font-family: var(--mono); font-size: .87em;
  background: #2b2d31; border: 1px solid var(--line-soft);
  padding: .1em .38em; border-radius: 5px;
}
.md table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .93em; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.md th { background: var(--bg-raised); font-weight: 600; }

pre.code {
  position: relative;
  margin: 0 0 1em; padding: 14px 16px;
  background: #1e1f22; border: 1px solid var(--line);
  border-radius: var(--r-md); overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.62;
}
pre.code code { background: none; border: 0; padding: 0; font-size: inherit; }
pre.code::before {
  content: attr(data-lang);
  position: absolute; top: 7px; right: 44px;
  font-size: 10.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .07em;
}
pre.code .copy {
  position: absolute; top: 6px; right: 7px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px;
  color: var(--text-faint); cursor: pointer; opacity: 0;
  transition: opacity .14s, background .14s, color .14s;
}
pre.code:hover .copy { opacity: 1; }
pre.code .copy:hover { background: var(--bg-hover); color: var(--text); }
pre.code .copy svg { width: 15px; height: 15px; }

/* Inline actions are bare icons, not buttons. */
.msg-actions { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .16s; }
.msg:hover .msg-actions, .msg-actions.pinned { opacity: 1; }
.act-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px;
  color: var(--text-faint); cursor: pointer;
}
.act-btn:hover { background: var(--bg-hover); color: var(--text); }
.act-btn svg { width: 15px; height: 15px; }

.msg-tag { font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

/* Typing indicator: three dots, not the word "loading". */
.typing { display: inline-flex; gap: 4px; align-items: center; height: 22px; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  animation: pulse 1.15s infinite var(--ease);
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.skeleton-lines { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.skeleton-lines i {
  height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, #2a2c31, #34363c, #2a2c31);
  background-size: 240% 100%; animation: shimmer 1.5s infinite linear;
}
.skeleton-lines i:nth-child(1) { width: 68%; }
.skeleton-lines i:nth-child(2) { width: 92%; }
.skeleton-lines i:nth-child(3) { width: 44%; }

/* ── Composer ──────────────────────────────────────────────────────────── */
.dock { padding: 0 20px 12px; width: 100%; max-width: var(--readable); margin: 0 auto; }
.composer-slot { width: 100%; }
.hero .composer-slot { width: 100%; max-width: var(--readable); margin: 0 auto; }
/* The hero mounts the composer inside the suggestion row; keep it full width. */
.hero-slots .composer { width: 100%; }

/* Two rows: prompt on top, controls underneath — the Grok layout. */
.composer {
  display: flex; flex-direction: column;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 2px 6px 6px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.composer:focus-within {
  border-color: #4a4d54;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .34), 0 0 0 3px var(--accent-ring);
}
.hero .composer { border-radius: 28px; box-shadow: 0 12px 40px rgba(0, 0, 0, .34); }

.comp-input {
  width: 100%; min-width: 0; flex: 0 0 auto;
  background: none; border: 0; outline: none; resize: none;
  max-height: 34vh; padding: 13px 8px 5px;
  font-size: 16px; line-height: 1.55;
  color: var(--text);
}
.comp-input::placeholder { color: var(--text-faint); }

.comp-bar { display: flex; align-items: center; gap: 4px; padding-top: 2px; }
.comp-bar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.comp-icon, .comp-send {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  transition: background .16s, color .16s, opacity .16s, transform .16s var(--ease);
}
.comp-icon { background: none; color: var(--text-dim); }
.comp-icon:hover { background: var(--bg-hover); color: var(--text); }
.comp-icon svg, .comp-send svg { width: 19px; height: 19px; }
.comp-send { background: var(--text); color: var(--bg); }
.comp-send:disabled { opacity: .28; cursor: default; }
.comp-send:not(:disabled):hover { transform: translateY(-1px); }
/* Stop state reuses the send button. */
.comp-send.stop { background: var(--text); color: var(--bg); }
.comp-icon.live { background: var(--accent-soft); color: var(--accent); }

.comp-ghost {
  display: inline-flex; align-items: center; gap: 3px;
  height: 34px; padding: 0 10px;
  background: none; border: 1px solid transparent; border-radius: 999px;
  color: var(--text-dim); font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.comp-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: var(--line); }
.comp-ghost svg { width: 15px; height: 15px; opacity: .75; }
.dock-hint {
  text-align: center; font-size: 11.5px; color: var(--text-faint);
  padding: 9px 4px 0;
}

/* ── Scrim / modal / sheets ────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 10, .74);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.auth-card {
  position: relative;
  width: min(440px, 100%);
  background: #2b2d31;
  border: 1px solid #404249;
  border-radius: 24px;
  padding: 30px 26px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: pop .22s var(--ease);
  text-align: center;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.auth-card h2 { margin: 0 0 6px; font-size: 24px; font-weight: 620; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 22px; color: var(--text-dim); font-size: 14.5px; }
.auth-close { position: absolute; top: 14px; right: 14px; }

.auth-accounts { display: flex; flex-direction: column; gap: 10px; }
.account-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: #383a40; border: 1px solid #404249;
  border-radius: 16px; cursor: pointer; text-align: left;
  transition: background .14s, border-color .14s, transform .14s;
}
.account-row:hover { background: #404349; border-color: #56585e; transform: translateY(-1px); }
.account-row .a-meta { min-width: 0; flex: 1; }
.account-row .a-name { display: block; font-weight: 600; font-size: 15px; }
.account-row .a-mail { display: block; font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row .a-x { color: var(--text-faint); background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; }
.account-row .a-x:hover { color: var(--text); background: rgba(255, 255, 255, .07); }

.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-faint); font-size: 12px; letter-spacing: .06em;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #404249; }

.auth-actions { display: flex; flex-direction: column; gap: 10px; }
.auth-btn {
  width: 100%; padding: 14px;
  background: #383a40; border: 1px solid #404249; border-radius: 14px;
  color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background .14s, border-color .14s;
}
.auth-btn:hover { background: #404349; border-color: #56585e; }

.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-dim); letter-spacing: .01em; }
.field input, .field select, .sheet textarea {
  width: 100%; padding: 12px 14px;
  background: #2b2d31; border: 1px solid #3f4147; border-radius: 12px;
  color: var(--text); outline: none; font-size: 15px;
  transition: border-color .14s, box-shadow .14s;
}
.field input:focus, .field select:focus, .sheet textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.auth-error {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 122, 133, .1); border: 1px solid rgba(255, 122, 133, .32);
  color: #ffb3ba; font-size: 13.5px;
}
.auth-primary {
  margin-top: 4px; padding: 13px;
  background: var(--text); color: #1e1f22;
  border: 0; border-radius: 12px; font-weight: 650; font-size: 15px; cursor: pointer;
  transition: opacity .14s, transform .14s;
}
.auth-primary:hover { transform: translateY(-1px); }
.auth-primary:disabled { opacity: .5; cursor: default; transform: none; }
.auth-link {
  background: none; border: 0; color: var(--text-dim);
  font-size: 13.5px; cursor: pointer; padding: 6px;
}
.auth-link:hover { color: var(--text); }

/* Sheets: full-bleed on phones, centered card on desktop. */
.sheet {
  width: min(560px, 100%);
  max-height: min(84dvh, 860px);
  display: flex; flex-direction: column;
  background: var(--bg-side);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  animation: pop .22s var(--ease);
}
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 620; letter-spacing: -.01em; }
.sheet-head .grow { margin-left: auto; }
.sheet-body { overflow-y: auto; padding: 8px 0 16px; }
.sheet-search { padding: 12px 18px 6px; }
.sheet-search input {
  width: 100%; padding: 10px 13px;
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); outline: none;
}
.sheet-group {
  font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); padding: 16px 20px 6px;
}
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 20px;
  background: none; border: 0; cursor: pointer; text-align: left;
  transition: background .13s;
}
.opt:hover { background: var(--bg-hover); }
.opt.selected { background: var(--bg-raised); }
.opt-main { min-width: 0; flex: 1; }
.opt-title { display: block; font-size: 14.5px; font-weight: 550; }
.opt-sub { display: block; font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .tick { color: var(--accent); width: 18px; flex: 0 0 18px; }
.opt[disabled] { opacity: .42; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 10.5px; padding: 2.5px 7px; border-radius: 999px;
  background: var(--bg-raised); border: 1px solid var(--line);
  color: var(--text-dim); white-space: nowrap;
}
.chip.on { border-color: rgba(70, 201, 138, .45); color: #9ce9c3; }
.chip.off { border-color: rgba(255, 122, 133, .34); color: #ffa7ae; }

.pane { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.pane h4 { margin: 0 0 4px; font-size: 14px; font-weight: 620; }
.pane p { margin: 0 0 12px; font-size: 13px; color: var(--text-faint); }
.key-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line-soft);
}
.key-row .k-name { font-size: 14px; font-weight: 550; min-width: 8.5rem; }
.key-row input[type=text], .key-row input[type=password] {
  flex: 1; min-width: 0; padding: 8px 11px;
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: 8px; outline: none; font-size: 13px;
  font-family: var(--mono);
}
.key-row input:focus { border-color: var(--accent); }
.mini-btn {
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  background: var(--bg-raised); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 12.5px; font-weight: 550;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.mini-btn:hover { background: var(--bg-hover); color: var(--text); }
.mini-btn.primary { background: var(--accent); border-color: var(--accent); color: #1e1f22; }
.mini-btn.primary:hover { background: #dfe3e8; color: #1e1f22; }
.test-out { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); padding-left: 2px; }
.test-out.ok { color: var(--ok); }
.test-out.err { color: var(--err); }

.toast-host {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: 999px;
  background: #2b2d31; border: 1px solid var(--line);
  color: var(--text); font-size: 13.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  animation: toastIn .2s var(--ease);
}
.toast.err { border-color: rgba(255, 122, 133, .4); color: #ffc2c7; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 70;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
  }
  .shell.collapsed .side { margin-left: 0; transform: translateX(-100%); }
  .mobile-only { display: grid; }
  .thread, .dock { padding-left: 14px; padding-right: 14px; }
  .comp-input { font-size: 15.5px; }
  .scrim { padding: 0; align-items: flex-end; }
  /* Full-bleed bottom sheet on phones. */
  .sheet {
    width: 100%; max-height: 92dvh;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    animation: slideUp .26s var(--ease);
  }
  .auth-card { width: 100%; border-radius: 22px 22px 0 0; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
  @keyframes slideUp { from { transform: translateY(100%); } }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
