/* OmniChat — brand canon from business / cabinet (tokens.css + app sidebar) */
:root {
  /* Canon surfaces (tokens.css) — flat, no grid/glow */
  --omni-bg: #161410;
  --omni-bg-deep: #100e0c;
  --omni-bg-elevated: #1e1b17;
  --omni-surface: #27231e;
  --omni-surface-hover: #312c26;

  --omni-text: #f2f0eb;
  --omni-text-secondary: #9a9690;
  --omni-text-muted: #5c5a56;

  --omni-accent: #d4893a;
  --omni-accent-hover: #e49a4c;
  --omni-accent-dim: rgba(212, 137, 58, 0.18);
  --omni-accent-line: rgba(212, 137, 58, 0.55);
  --omni-metal: #8a8680;
  --omni-metal-bright: #c4bfb6;

  --omni-success: #3dba7a;
  --omni-danger: #e0544a;

  --omni-border: rgba(138, 134, 128, 0.28);
  --omni-border-strong: rgba(138, 134, 128, 0.45);

  --omni-radius-sm: 10px;
  --omni-radius: 16px;
  --omni-radius-lg: 22px;
  --omni-radius-pill: 999px;

  --omni-font-ui: "Onest", system-ui, sans-serif;
  --omni-font-display: "Geologica", system-ui, sans-serif;
  --omni-font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --sidebar-collapsed-w: 64px;
  --sidebar-expanded-w: 228px;
  --sidebar-icon-slot: 40px;
  --sidebar-logo: 40px;
  --sidebar-rail-pad: 12px;
  --sidebar-motion-dur: 0.24s;
  --sidebar-motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-label-dur: 0.16s;
  --sidebar-label-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ws-topbar-h: 5.25rem;

  color-scheme: dark;
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--omni-text);
  font-family: var(--omni-font-ui);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
  background: var(--omni-bg);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--omni-bg);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  background: transparent;
  transition: background var(--sidebar-motion-dur) var(--sidebar-label-ease);
}
.app-shell:has(.app-sidebar:is(:hover, .app-sidebar--expanded))::before,
body.is-side-open .app-shell::before {
  background: rgba(0, 0, 0, 0.52);
}

.app-shell-dim {
  position: fixed;
  inset: 0;
  z-index: 46;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
body.is-side-open .app-shell-dim {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Sidebar (canon rail) ---- */
.app-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-collapsed-w);
  padding: 0 var(--sidebar-rail-pad) 14px;
  background: var(--omni-bg-deep);
  border-right: 1px solid var(--omni-border);
  overflow: hidden;
  transition:
    width var(--sidebar-motion-dur) var(--sidebar-motion-ease),
    transform var(--sidebar-motion-dur) var(--sidebar-motion-ease),
    filter var(--sidebar-motion-dur) var(--sidebar-label-ease);
}
.app-sidebar:is(:hover, .app-sidebar--expanded) {
  width: var(--sidebar-expanded-w);
  filter: drop-shadow(10px 0 22px rgba(0, 0, 0, 0.38));
}

.side-brand {
  display: grid;
  grid-template-columns: var(--sidebar-icon-slot) minmax(0, 1fr);
  align-items: center;
  flex: 0 0 var(--ws-topbar-h);
  height: var(--ws-topbar-h);
  min-height: var(--ws-topbar-h);
  margin: 0;
  padding: 0;
  text-decoration: none;
  color: var(--omni-text);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.side-brand-logo {
  grid-column: 1;
  justify-self: center;
  width: var(--sidebar-logo);
  height: var(--sidebar-logo);
  border-radius: 10px;
  display: block;
  object-fit: contain;
}
.side-brand-name {
  grid-column: 2;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font: 800 1.05rem/1.1 var(--omni-font-display);
  letter-spacing: 0.08em;
  transition:
    opacity var(--sidebar-label-dur) var(--sidebar-label-ease),
    max-width var(--sidebar-label-dur) var(--sidebar-label-ease);
}
.app-sidebar:is(:hover, .app-sidebar--expanded) .side-brand { column-gap: 12px; }
.app-sidebar:is(:hover, .app-sidebar--expanded) .side-brand-name {
  max-width: 140px;
  opacity: 1;
  transition-delay: 0.06s;
}

.side-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0.85rem 0 0;
}
.side-nav__indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.85rem;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--omni-accent-dim) 88%, transparent);
  box-shadow: inset 0 0 0 1px rgba(228, 154, 76, 0.12);
  pointer-events: none;
  z-index: 0;
}

.side-nav button,
.side-nav-link {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-icon-slot) minmax(0, 1fr);
  align-items: center;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0;
  column-gap: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--omni-text);
  font-family: var(--omni-font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    column-gap var(--sidebar-label-dur) var(--sidebar-label-ease),
    color 0.15s ease,
    background 0.18s ease;
}
.app-sidebar:is(:hover, .app-sidebar--expanded) .side-nav button,
.app-sidebar:is(:hover, .app-sidebar--expanded) .side-nav-link,
.app-sidebar:is(:hover, .app-sidebar--expanded) .side-foot .side-nav-link {
  column-gap: 10px;
  transition-delay: 0.06s;
}
.side-nav button:hover,
.side-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.side-nav button.is-active {
  color: var(--omni-accent-hover);
}

.side-nav-ico {
  grid-column: 1;
  justify-self: center;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}
.side-nav-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-nav-lab {
  grid-column: 2;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition:
    opacity var(--sidebar-label-dur) var(--sidebar-label-ease),
    max-width var(--sidebar-label-dur) var(--sidebar-label-ease);
}
.app-sidebar:is(:hover, .app-sidebar--expanded) .side-nav-lab {
  max-width: 140px;
  opacity: 1;
  transition-delay: 0.06s;
}

.side-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Main frame: nearly full width between rail and right edge ---- */
.app-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 18px 28px 16px;
  width: 100%;
  box-sizing: border-box;
  transition: padding-left var(--sidebar-motion-dur) var(--sidebar-motion-ease);
}

/* Empty = GPT-like centered hero; with messages = thread + dock bottom */
.stage {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 12px;
  height: 100%;
}
.hero-title {
  display: none;
  margin: 0;
  text-align: center;
  font-family: var(--omni-font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  letter-spacing: -0.02em;
  color: var(--omni-text);
}
.suggestions {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  appearance: none;
  border: 0;
  background: var(--omni-surface);
  color: var(--omni-text-secondary);
  font: 500 0.82rem var(--omni-font-ui);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.chip:hover {
  color: var(--omni-text);
  background: var(--omni-surface-hover);
}

.app-frame.is-empty .stage {
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: stretch;
  gap: 14px;
  padding-bottom: 8vh;
}
.app-frame.is-empty .hero-title { display: block; }
.app-frame.is-empty .thread { display: none; }
.app-frame.is-empty .suggestions { display: flex; }
.app-frame.is-empty .dock {
  width: min(52rem, 100%);
  margin-inline: auto;
}
.app-frame.is-empty .controls { align-items: center; }

.app-frame:not(.is-empty) .hero-title,
.app-frame:not(.is-empty) .suggestions { display: none !important; }

/* Viewport corner — not tied to content column */
.btn-login {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--omni-radius-pill);
  background: #f2f0eb;
  color: #14110e;
  font: 700 0.88rem var(--omni-font-ui);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-login:hover {
  background: #fff;
  color: #14110e;
}

.topbar {
  display: none;
  align-items: center;
  min-height: 0;
}

.side-burger {
  appearance: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--omni-radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--omni-text);
  cursor: pointer;
  flex-shrink: 0;
}
.side-burger-bars,
.side-burger-bars::before,
.side-burger-bars::after {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}
.side-burger-bars::before,
.side-burger-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.side-burger-bars::before { top: -5px; }
.side-burger-bars::after { top: 5px; }
body.is-side-open .side-burger {
  border-color: rgba(212, 137, 58, 0.45);
  color: var(--omni-accent-hover);
}

.dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.consent {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 14px 16px;
  border-radius: var(--omni-radius-lg);
  border: 1px solid var(--omni-border);
  background: var(--omni-bg-elevated);
}
.consent[hidden] { display: none !important; }
.consent-copy { flex: 1 1 240px; min-width: 0; }
.consent-title {
  margin: 0 0 6px;
  font: 700 0.95rem/1.25 var(--omni-font-ui);
  color: var(--omni-text);
}
.consent-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--omni-text-secondary);
}
.consent-text a {
  color: var(--omni-accent);
  text-decoration: none;
}
.consent-text a:hover { text-decoration: underline; }
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.btn-ghost,
.btn-solid {
  appearance: none;
  border-radius: var(--omni-radius-pill);
  font: 700 0.82rem var(--omni-font-ui);
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost {
  border: 1px solid rgba(242, 240, 235, 0.35);
  background: transparent;
  color: var(--omni-text);
}
.btn-ghost:hover { border-color: #fff; }
.btn-solid {
  border: 0;
  background: #f2f0eb;
  color: #14110e;
}
.btn-solid:hover { background: #fff; }

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.modes {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modes::-webkit-scrollbar { display: none; }
.modes > .mode,
.modes > .mode-cluster {
  flex-shrink: 0;
}
.app-frame.is-empty .modes {
  justify-content: center;
}

/* Общение + extras — один овал, без «пилюля в пилюле» */
.mode-cluster {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  vertical-align: middle;
  transition:
    border-color 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    background 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    padding 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    gap 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
.mode-cluster.is-open {
  gap: 2px;
  padding: 3px;
  border-color: rgba(212, 137, 58, 0.32);
  background: color-mix(in srgb, var(--omni-surface) 55%, transparent);
}
.mode-cluster .mode[data-mode="chat"] {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.mode-cluster.is-open .mode[data-mode="chat"] {
  border-color: transparent;
  box-shadow: none;
}
.mode-cluster.is-open .mode[data-mode="chat"].active {
  border-color: transparent;
}

/* width via 0fr→1fr — ровнее, чем max-width */
.chat-extras {
  display: grid;
  grid-template-columns: 0fr;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-columns 0.4s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.28s ease;
}
.mode-cluster.is-open .chat-extras {
  grid-template-columns: 1fr;
  opacity: 1;
  pointer-events: auto;
  transition:
    grid-template-columns 0.42s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.32s ease 0.04s;
}
.chat-extras-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  padding-left: 0;
  transition: padding-left 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
.mode-cluster.is-open .chat-extras-track {
  padding-left: 4px;
}

.mode-opt {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  white-space: nowrap;
  border-color: transparent !important;
  background: transparent;
  color: var(--omni-text-secondary);
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 0.28s ease,
    transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
    background 0.18s ease,
    color 0.18s ease;
}
.mode-cluster.is-open .mode-opt {
  opacity: 1;
  transform: translateX(0);
}
.mode-cluster.is-open .mode-opt:nth-child(1) {
  transition-delay: 0.05s, 0.05s, 0s, 0s;
}
.mode-cluster.is-open .mode-opt:nth-child(2) {
  transition-delay: 0.1s, 0.1s, 0s, 0s;
}
.mode-cluster:not(.is-open) .mode-opt {
  transition-delay: 0s;
}
.mode-cluster.is-open .mode-opt:hover {
  color: var(--omni-text);
  background: rgba(255, 255, 255, 0.06);
}
.mode-cluster.is-open .mode-opt[aria-pressed="true"] {
  color: var(--omni-accent-hover);
  background: var(--omni-accent-dim);
}
@media (prefers-reduced-motion: reduce) {
  .mode-cluster,
  .chat-extras,
  .chat-extras-track,
  .mode-opt {
    transition: none !important;
  }
  .mode-opt { transform: none; opacity: 1; }
}
.mode {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--omni-border);
  background: transparent;
  color: var(--omni-text);
  font: 600 0.82rem var(--omni-font-ui);
  padding: 7px 12px;
  border-radius: var(--omni-radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mode-ico {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.mode-ico svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Auto = favicon O (ring + core) */
.mode[data-mode="auto"] .mode-ico-ring {
  stroke: var(--omni-accent);
  stroke-width: 2.75;
}
.mode[data-mode="auto"] .mode-ico-core {
  fill: var(--omni-metal-bright);
  stroke: none;
}
.mode[data-mode="auto"].active .mode-ico-ring {
  stroke: #fff;
}
.mode[data-mode="auto"].active .mode-ico-core {
  fill: #fff;
  opacity: 0.7;
}
.mode-lab { line-height: 1; }
.mode:hover { border-color: var(--omni-accent-line); }
.mode.active {
  background: var(--omni-accent);
  color: #fff;
  border-color: var(--omni-accent);
}
.mode-opt {
  gap: 6px;
  padding-inline: 11px;
}
.mode-opt .mode-ico {
  width: 14px;
  height: 14px;
}
.mode-opt .mode-ico svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.65;
}
.plus-item.is-on {
  color: var(--omni-accent-hover);
  background: var(--omni-accent-dim);
}

.thread {
  overflow: auto;
  min-height: 0;
  padding: 8px 2px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}
/* Ref photo 2 / GPT: compact flat user pill; assistant = prose, no card */
.msg {
  max-width: min(56rem, 100%);
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}
.msg.user {
  align-self: flex-end;
  width: fit-content;
  max-width: min(72%, 42rem);
  padding: 8px 16px;
  border-radius: 22px;
  background: #3a322a;
  color: var(--omni-text);
}
.msg.msg-enter {
  animation: msg-enter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.msg.user.msg-enter {
  transform-origin: 100% 100%;
}
@keyframes msg-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.msg.assistant {
  align-self: stretch;
  width: 100%;
  max-width: min(56rem, 100%);
  padding: 0;
  color: var(--omni-text);
  white-space: normal;
}
.msg.assistant .md {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--omni-text);
}
.msg.assistant .md > :first-child { margin-top: 0; }
.msg.assistant .md > :last-child { margin-bottom: 0; }
.msg.assistant .md p {
  margin: 0 0 0.75em;
}
.msg.assistant .md strong { font-weight: 700; color: #fff; }
.msg.assistant .md em { font-style: italic; }
.msg.assistant .md ul,
.msg.assistant .md ol {
  margin: 0.35em 0 0.85em;
  padding-left: 1.35em;
}
.msg.assistant .md li { margin: 0.25em 0; }
.msg.assistant .md li::marker { color: var(--omni-accent); }
.msg.assistant .md h1,
.msg.assistant .md h2,
.msg.assistant .md h3 {
  margin: 0.9em 0 0.4em;
  font-family: var(--omni-font-display);
  font-weight: 650;
  line-height: 1.25;
  color: #fff;
}
.msg.assistant .md h1 { font-size: 1.25rem; }
.msg.assistant .md h2 { font-size: 1.12rem; }
.msg.assistant .md h3 { font-size: 1.02rem; }
.msg.assistant .md a {
  color: var(--omni-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.msg.assistant .md code {
  font-family: var(--omni-font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--omni-surface);
  color: var(--omni-accent-hover);
}
.msg.assistant .md .md-pre {
  margin: 0.55em 0 0.9em;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--omni-bg-elevated);
  border: 1px solid var(--omni-border);
}
.msg.assistant .md .md-pre code {
  padding: 0;
  background: transparent;
  color: var(--omni-text);
  font-size: 0.84rem;
  white-space: pre;
}
.msg.assistant .md .md-math {
  margin: 0.7em 0;
  overflow-x: auto;
  padding: 0.15em 0;
}
.msg.assistant .md .katex {
  color: #f2f0eb;
  font-size: 1.08em;
}
.msg.assistant .md .katex-display {
  margin: 0.55em 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.msg.assistant .md .md-math-fallback {
  color: var(--omni-accent-hover);
}

/* Pending status: Думаю / Рисую / Видео */
.status-msg {
  max-width: min(56rem, 100%);
  padding: 2px 0;
}
.status-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--omni-text-secondary);
  font: 600 0.95rem var(--omni-font-ui);
}
.status-lab {
  letter-spacing: 0.01em;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.status-phrase {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
/* Светло-белый ↔ блекло-серый */
.status-shimmer {
  color: #f2f0eb;
  animation: status-pulse 1.55s ease-in-out infinite;
}
.status-dots {
  display: inline-block;
  min-width: 1.15em;
  text-align: left;
}
@keyframes status-pulse {
  0%, 100% { color: #f2f0eb; }
  50% { color: #6e6a64; }
}
.status-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--omni-text-muted);
}
.status-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--omni-accent);
}
.status-ico svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-draw .draw-frame {
  opacity: 0.45;
}
.ico-draw .draw-stroke {
  fill: none;
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: draw-stroke 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.ico-draw .draw-brush {
  opacity: 0.85;
  animation: draw-brush 1.6s ease-in-out infinite;
}
.ico-draw .draw-tip {
  fill: currentColor;
  stroke: none;
  animation: draw-tip 1.6s ease-in-out infinite;
}
@keyframes draw-stroke {
  0% { stroke-dashoffset: 28; opacity: 0.25; }
  35% { stroke-dashoffset: 0; opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -4; opacity: 0.2; }
}
@keyframes draw-brush {
  0% { transform: translate(0, 0); }
  40% { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); }
}
@keyframes draw-tip {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  40% { transform: translate(1.5px, -1.5px) scale(1.15); opacity: 1; }
}

.ico-think .think-d {
  fill: currentColor;
  stroke: none;
  animation: think-bounce 1.05s ease-in-out infinite;
}
.ico-think .d2 { animation-delay: 0.15s; }
.ico-think .d3 { animation-delay: 0.3s; }
@keyframes think-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.ico-video .vid-frame,
.ico-video .vid-play {
  animation: vid-pulse 1.4s ease-in-out infinite;
}
@keyframes vid-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ico-draw .draw-stroke,
  .ico-draw .draw-brush,
  .ico-draw .draw-tip,
  .ico-think .think-d,
  .ico-video .vid-frame,
  .ico-video .vid-play,
  .status-shimmer,
  .msg.msg-enter {
    animation: none !important;
  }
  .ico-draw .draw-stroke { stroke-dashoffset: 0; opacity: 1; }
  .status-shimmer { color: var(--omni-text-secondary); }
}
.msg.system {
  align-self: center;
  color: var(--omni-text-secondary);
  font-size: 0.85rem;
  padding: 2px 4px;
}
.msg .meta {
  margin-top: 8px;
  font-size: 0.72rem;
  font-family: var(--omni-font-mono);
  color: var(--omni-text-muted);
}
.msg img, .msg video {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  margin-top: 10px;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 6px 6px 6px;
  border: 1px solid var(--omni-border);
  border-radius: var(--omni-radius-lg);
  background: var(--omni-surface);
}
.composer-plus-wrap {
  position: relative;
  flex-shrink: 0;
}
.composer-plus {
  appearance: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--omni-border);
  border-radius: var(--omni-radius-pill);
  background: transparent;
  color: var(--omni-text);
  font: 600 1.25rem/1 var(--omni-font-ui);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.composer-plus:hover,
.composer-plus[aria-expanded="true"] {
  border-color: var(--omni-accent-line);
  color: var(--omni-accent-hover);
  background: var(--omni-accent-dim);
}
.plus-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 30;
  min-width: max(100%, 180px);
  width: max-content;
  padding: 6px;
  border-radius: var(--omni-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--omni-bg-elevated);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
.plus-menu[hidden] { display: none !important; }
.plus-item {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--omni-radius);
  background: transparent;
  color: var(--omni-text);
  font: 600 0.92rem/1.2 var(--omni-font-ui);
  text-align: left;
  cursor: pointer;
}
.plus-item:hover { background: rgba(255, 255, 255, 0.06); }
.plus-item--gated { color: var(--omni-text-secondary); font-weight: 500; font-size: 0.88rem; }
.plus-ico {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}
.plus-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plus-sep {
  height: 1px;
  margin: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
}
.plus-hint {
  margin: 2px 12px 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--omni-text-muted);
}
.composer textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--omni-text);
  font: 500 0.95rem/1.35 var(--omni-font-ui);
  max-height: 120px;
  min-height: 22px;
  padding: 6px 2px;
}
.composer textarea::placeholder { color: var(--omni-text-muted); }
.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--omni-accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.08s ease;
}
.send svg {
  width: 16px;
  height: 16px;
  display: block;
}
.send:hover { background: var(--omni-accent-hover); }
.send:active { transform: scale(0.96); }
.send:disabled {
  opacity: 0.45;
  cursor: wait;
}

@media (min-width: 921px) {
  .app-frame {
    padding-left: calc(var(--sidebar-collapsed-w) + 18px);
    padding-right: 28px;
    grid-template-rows: 1fr;
  }
  /* When rail opens — keep a small gap from the menu edge */
  .app-shell:has(.app-sidebar:is(:hover, .app-sidebar--expanded)) .app-frame,
  body.is-side-open .app-frame {
    padding-left: calc(var(--sidebar-expanded-w) + 18px);
  }
  .topbar { display: none !important; }
  .app-shell-dim { display: none !important; }
  .side-burger { display: none !important; }
}

@media (max-width: 920px) {
  .topbar { display: flex; }
  .side-burger { display: inline-flex; }
  .btn-login {
    top: 12px;
    right: 12px;
  }
  .app-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-expanded-w) - 8px));
    width: var(--sidebar-expanded-w);
  }
  body.is-side-open .app-sidebar {
    transform: translateX(0);
    filter: drop-shadow(10px 0 22px rgba(0, 0, 0, 0.38));
  }
  body.is-side-open .app-sidebar .side-brand { column-gap: 12px; }
  body.is-side-open .app-sidebar .side-brand-name,
  body.is-side-open .app-sidebar .side-nav-lab {
    max-width: 140px;
    opacity: 1;
  }
  body.is-side-open .app-sidebar .side-nav button,
  body.is-side-open .app-sidebar .side-nav-link,
  body.is-side-open .app-sidebar .side-foot .side-nav-link {
    column-gap: 10px;
  }
  .app-frame { padding: 14px 14px 12px; gap: 12px; }
}
