:root,
html[data-theme="light"] {
  --ink: #0d1117;
  --muted: #4b5563;
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --teal-soft: #e6f4f1;
  --line: #e5e7eb;
  --bg: #f7f7f8;
  --sidebar: #f0f2f4;
  --white: #ffffff;
  --bad: #c0392b;
  --sidebar-w: 260px;
  --composer-max: 780px;
  --page-bg: #eceff2;
  --auth-grad-a: rgba(20,184,166,.2);
  --auth-grad-b: #f4f8f7;
  --auth-grad-c: #e8eeec;
}
html[data-theme="dark"] {
  --ink: oklch(0.97 0.005 260);
  --muted: oklch(0.7 0.015 260);
  --teal: oklch(0.88 0.21 122);
  --teal-2: oklch(0.84 0.2 122);
  --teal-soft: oklch(0.22 0.04 130);
  --line: oklch(1 0 0 / 12%);
  --bg: oklch(0.19 0.013 260);
  --sidebar: oklch(0.16 0.012 260);
  --white: oklch(0.205 0.014 260);
  --bad: oklch(0.62 0.2 25);
  --page-bg: oklch(0.14 0.012 260);
  --auth-grad-a: oklch(0.88 0.21 122 / 0.12);
  --auth-grad-b: oklch(0.16 0.012 260);
  --auth-grad-c: oklch(0.14 0.012 260);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
}
a { color: var(--teal); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.muted { color: var(--muted); }
.tiny { font-size: 0.8rem; }
.err { color: var(--bad); min-height: 1.2em; }
.warn { color: #b45309; }
.center { text-align: center; }

/* Auth */
.auth-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(700px 360px at 12% -8%, var(--auth-grad-a), transparent 55%),
    linear-gradient(180deg, var(--auth-grad-b), var(--auth-grad-c));
}
.auth-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 18px 50px rgba(15, 40, 40, 0.08);
}
.auth-card h1 { margin: 0.8rem 0 0.4rem; font-size: 1.5rem; }
.auth-card input {
  width: 100%; font: inherit; padding: 0.7rem 0.85rem; border: 1px solid var(--line);
  border-radius: 12px; margin-top: 0.45rem;
}
.email-fallback { margin-top: 0.9rem; font-size: 0.88rem; color: var(--muted); }
.email-fallback summary { cursor: pointer; }
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  text-decoration: none; color: inherit; font-weight: 800;
}
.brand img, .sidebar-brand img { border-radius: 9px; }
.btn {
  border: none; border-radius: 999px; padding: 0.85rem 1.2rem;
  font: inherit; font-weight: 800; cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.wide { width: 100%; margin-top: 1rem; display: inline-flex; justify-content: center; text-decoration: none; }
.btn.ghost {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  text-decoration: none;
}
.btn.compact { padding: 0.45rem 0.9rem; font-size: 0.85rem; margin: 0; width: auto; text-decoration: none; }
.post-auth-links { margin-top: 1rem; display: grid; gap: 0.55rem; }
.post-auth-links .ok { color: var(--teal); font-weight: 700; margin: 0; }
.welcome-banner {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  background: var(--teal-soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.welcome-banner span { flex: 1; min-width: 12rem; }

/* App shell — full viewport like ChatGPT */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  max-height: 100dvh;
  background: var(--white);
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 1rem 0.95rem 0.4rem;
  font-weight: 800; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.btn-new {
  margin: 0.55rem 0.85rem 0.35rem;
  height: 42px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--ink); font: inherit; font-weight: 700;
  cursor: pointer; text-align: left; padding: 0 0.9rem;
  flex-shrink: 0;
}
.btn-new:hover { border-color: var(--teal-2); color: var(--teal); }
.chat-list {
  flex: 1; min-height: 0; overflow: auto; padding: 0.45rem 0.55rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.chat-item {
  display: flex; align-items: center; gap: 0.2rem;
  padding: 0.15rem 0.2rem 0.15rem 0.15rem; border-radius: 12px;
  background: transparent; width: 100%; color: var(--ink);
}
.chat-item:hover { background: rgba(255,255,255,0.7); }
.chat-item.active { background: var(--white); box-shadow: 0 1px 0 var(--line); }
.chat-item-open {
  display: flex; align-items: center; gap: 0.65rem; flex: 1; min-width: 0;
  padding: 0.45rem 0.45rem; border: none; background: transparent;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.chat-item .av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal-soft) center/cover no-repeat;
  background-image: url("/cabinet/favicon.png");
}
.chat-item .meta { min-width: 0; flex: 1; }
.chat-item .t { font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-item .s { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-item-del {
  flex-shrink: 0; width: 32px; height: 32px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-size: 0.9rem; opacity: 0;
  color: var(--muted);
}
.chat-item:hover .chat-item-del,
.chat-item.active .chat-item-del,
.chat-item-del:focus {
  opacity: 1;
}
.chat-item-del:hover { background: #fde8e6; color: var(--bad); }
@media (hover: none) {
  .chat-item-del { opacity: 1; }
}

.sidebar-foot {
  border-top: 1px solid var(--line); padding: 0.75rem 0.85rem 1rem;
  flex-shrink: 0;
}
.me { display: flex; gap: 0.65rem; align-items: center; margin-bottom: 0.45rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #cbd5e1; }
.avatar.user-av {
  background: var(--teal-soft) center/cover no-repeat;
  background-image: url("/cabinet/favicon.png");
}
.me-name { margin: 0; font-weight: 700; font-size: 0.88rem; }
.me-bal { margin: 0.1rem 0 0; font-size: 0.78rem; color: var(--muted); }
.side-links { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.35rem 0; font-size: 0.8rem; }
.side-links a, .linkish {
  background: none; border: none; padding: 0; font: inherit; color: var(--teal);
  cursor: pointer; text-decoration: none; font-weight: 600;
}
.topup-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.topup-row.compact .topup {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0.3rem 0.55rem; font: inherit; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; color: var(--teal);
}

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.chat-head {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent);
}
html[data-theme="dark"] .chat-head {
  background: color-mix(in srgb, var(--white) 92%, var(--teal) 8%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.chat-head strong {
  flex: 1; font-size: 0.95rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.head-actions { display: inline-flex; align-items: center; gap: 0.45rem; margin-left: auto; flex-shrink: 0; }
.head-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 36px; padding: 0.4rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit; font-size: 0.8rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
}
.head-btn:hover {
  border-color: color-mix(in srgb, var(--teal) 50%, var(--line));
  background: var(--teal-soft);
  color: var(--teal);
}
.head-btn[data-theme-toggle] {
  min-width: 8.75rem;
}
a.head-btn {
  color: var(--ink);
}
html[data-theme="dark"] .head-btn {
  background: color-mix(in srgb, var(--white) 88%, var(--teal) 12%);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: none;
}
html[data-theme="dark"] .head-btn:hover {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
}
.head-btn-label { line-height: 1.1; }
#sidebarToggle.head-btn { margin-right: 0.15rem; }
.model-wrap select {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.75rem; font: inherit; font-size: 0.82rem; font-weight: 700;
  background: var(--white); color: var(--ink); max-width: 180px;
}
.ghost.icon-btn {
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font: inherit;
}
.pill {
  font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.55rem; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal);
}
.pill.bad { background: #fde8e6; color: var(--bad); }

.thread {
  flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column;
}
.empty-state {
  margin: auto; text-align: center; padding: 2rem 1.25rem; max-width: 560px;
}
.empty-state.hidden { display: none; }
.empty-state img { border-radius: 16px; margin-bottom: 0.75rem; }
.empty-state h2 { margin: 0 0 0.4rem; font-size: 1.6rem; letter-spacing: -0.03em; }
.suggest-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-top: 1.25rem;
}
.suggest {
  border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 0.85rem 0.9rem; font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
.suggest:hover { border-color: var(--teal-2); color: var(--teal); }

.messages {
  flex: 1; overflow: auto; padding: 1.25rem 1rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  max-width: var(--composer-max); width: 100%; margin: 0 auto;
}
.messages:empty { display: none; }
.row-msg { display: flex; gap: 0.7rem; align-items: flex-start; width: 100%; }
.row-msg.user { flex-direction: row-reverse; }
.bubble {
  border-radius: 18px; padding: 0.9rem 1.05rem; line-height: 1.55; font-size: 0.97rem;
  white-space: pre-wrap; max-width: min(100%, 640px);
}
.bubble.user {
  background: #0f766e; color: #fff; border-bottom-right-radius: 6px;
}
.bubble.assistant {
  background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px;
  box-shadow: 0 6px 18px rgba(15, 30, 40, 0.04);
}
.bubble.system { background: var(--teal-soft); color: var(--muted); border: 1px dashed rgba(15,118,110,.3); }
.bubble .md-body { white-space: normal; }
.bubble .md-body p { margin: 0 0 0.55rem; }
.bubble .md-body p:last-child { margin-bottom: 0; }
.bubble img.art, .bubble a.art-link {
  display: block; margin-top: 0.55rem; max-width: 100%; border-radius: 12px;
}
.msg-av {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; margin-top: 0.2rem;
  background: #e2e8f0 center/cover no-repeat;
}
.msg-av.bot { background-image: url("/cabinet/favicon.png"); background-color: #fff; }
.msg-av.user { background-color: #dbeafe; }

.attach {
  margin: 0 auto 0.35rem; width: min(100% - 2rem, var(--composer-max));
  font-size: 0.85rem; padding: 0.5rem 0.75rem;
  border-radius: 10px; background: var(--teal-soft); color: var(--teal);
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}
.attach-thumb {
  position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(15,118,110,.25); background: #fff;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: none;
  border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 11px;
  line-height: 18px; padding: 0;
}
.attach-name { font-weight: 650; }
.bubble-imgs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.bubble-imgs img {
  max-width: min(100%, 320px); max-height: 280px; border-radius: 14px; display: block;
  cursor: zoom-in; background:
    linear-gradient(45deg, #eceff1 25%, transparent 25%),
    linear-gradient(-45deg, #eceff1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eceff1 75%),
    linear-gradient(-45deg, transparent 75%, #eceff1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.art-box { margin-top: 0.35rem; }
.art-box img, .art-box video {
  max-width: min(100%, 420px); border-radius: 14px; display: block;
}
.art-box img {
  cursor: zoom-in;
  background:
    linear-gradient(45deg, #eceff1 25%, transparent 25%),
    linear-gradient(-45deg, #eceff1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eceff1 75%),
    linear-gradient(-45deg, transparent 75%, #eceff1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.art-box a { font-weight: 700; }
.file-card {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.65rem 0.75rem; border-radius: 14px;
  background: var(--bg, #f4f7f6); border: 1px solid var(--line, #e2e8e6);
  max-width: min(100%, 420px);
}
.file-card-icon { font-size: 1.35rem; line-height: 1; }
.file-card-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.file-card-meta strong { font-size: 0.92rem; }
.file-card-dl {
  flex-shrink: 0; font-weight: 700; font-size: 0.86rem;
  color: var(--teal, #0d7377); text-decoration: none;
  padding: 0.35rem 0.55rem; border-radius: 10px; background: #fff;
  border: 1px solid var(--line, #e2e8e6);
}
.file-card-dl:hover { background: var(--bg, #f4f7f6); }
.file-card-tip { margin: 0.35rem 0 0; }

.wait-row { width: 100%; }
.wait-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem;
  box-shadow: 0 10px 28px rgba(15, 30, 40, 0.06);
  display: grid;
  gap: 0.7rem;
}
.wait-card--think {
  width: auto;
  max-width: 320px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.wait-stage {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 20%, #1d3a38, #0f1a1c 70%);
  display: grid;
  place-items: center;
  min-height: 160px;
  aspect-ratio: 16 / 9;
}
.wait-card--image .wait-stage {
  aspect-ratio: 1;
  max-height: 260px;
  margin: 0 auto;
  width: min(100%, 260px);
}
.wait-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.14) 48%, transparent 72%);
  animation: waitShimmer 1.7s ease-in-out infinite;
}
.wait-icon {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.35rem;
  border: 1px solid rgba(255,255,255,.28);
  animation: waitPulse 1.5s ease-in-out infinite;
}
.wait-copy { display: grid; gap: 0.28rem; }
.wait-title { font-size: 0.98rem; letter-spacing: -0.02em; }
.wait-sub { margin: 0; color: var(--muted); font-size: 0.86rem; min-height: 1.25em; }
.wait-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; font-size: 0.78rem; color: var(--muted); font-weight: 650;
}
.wait-bar {
  height: 5px;
  background: #e8eeec;
  border-radius: 99px;
  overflow: hidden;
}
.wait-bar > span {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--teal-2));
  animation: waitSlide 1.35s ease-in-out infinite;
}
.wait-dots { display: flex; gap: 5px; }
.wait-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  animation: waitDot 1.05s ease-in-out infinite;
}
.wait-dots span:nth-child(2) { animation-delay: .15s; }
.wait-dots span:nth-child(3) { animation-delay: .3s; }
.composer.is-waiting { opacity: 0.55; pointer-events: none; }
@keyframes waitShimmer {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}
@keyframes waitSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
@keyframes waitPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.82; }
}
@keyframes waitDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.media-sheet {
  width: min(100%, var(--composer-max)); margin: 0 auto 0.55rem;
  border: 1px solid var(--line); border-radius: 16px; padding: 0.85rem 0.95rem;
  background: #fff; display: grid; gap: 0.55rem;
  box-shadow: 0 8px 24px rgba(15, 30, 40, 0.05);
}
.media-sheet.hidden { display: none !important; }
.media-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.media-field { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 650; }
.media-field textarea { width: 100%; min-height: 72px; resize: vertical; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.65rem; }
.media-row { display: flex; gap: 8px; flex-wrap: wrap; }
.media-row label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 650; flex: 1; }
.media-row select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); }
.icon-btn {
  width: 32px; height: 32px; border: none; background: transparent; cursor: pointer;
  font-size: 1.2rem; border-radius: 8px; color: var(--muted);
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.composer-wrap {
  padding: 0.35rem 1rem 1.1rem;
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.task-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  width: min(100%, var(--composer-max)); margin: 0 auto 0.45rem;
}
.model-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(100%, var(--composer-max));
  margin: 0 auto 0.45rem;
}
.model-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.model-picker-label { font-weight: 700; }
.model-picker select {
  border: 1px solid var(--line);
  background: var(--white, #fff);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
html[data-theme="dark"] .model-picker select {
  background: var(--white);
}
.mode-hint { margin-left: 0.25rem; }
.composer {
  display: flex; align-items: flex-end; gap: 0.35rem;
  border: 1px solid var(--line); border-radius: 22px; padding: 0.5rem 0.55rem;
  background: #fff; box-shadow: 0 10px 30px rgba(15, 30, 40, 0.06);
  width: min(100%, var(--composer-max)); margin: 0 auto;
}
.composer textarea {
  flex: 1; border: none; background: transparent; resize: none; font: inherit;
  padding: 0.55rem 0.35rem; max-height: 160px; outline: none; min-height: 24px;
}
.tool {
  width: 38px; height: 38px; border: none; border-radius: 12px; background: transparent;
  cursor: pointer; font-size: 1.05rem; display: grid; place-items: center; color: var(--muted);
}
.tool:hover { background: var(--bg); color: var(--ink); }
.tool.recording {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  animation: voice-pulse 1.1s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.send-fab {
  width: 40px; height: 40px; border: none; border-radius: 12px;
  background: var(--teal); color: #fff; font-size: 1rem; cursor: pointer;
}
.send-fab:hover { filter: brightness(0.92); }
html[data-theme="dark"] .composer {
  background: var(--white);
  box-shadow: none;
}
html[data-theme="dark"] .bubble.assistant,
html[data-theme="dark"] .bubble.system {
  background: var(--white);
}
html[data-theme="dark"] .sidebar { border-color: var(--line); }
label.tool { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(120%);
  background: #111827; color: #fff; padding: 0.7rem 1rem; border-radius: 999px;
  font-size: 0.88rem; font-weight: 600; opacity: 0; transition: .25s ease; z-index: 50;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 30;
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: 12px 0 40px rgba(0,0,0,.12);
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .suggest-grid { grid-template-columns: 1fr; }
  .model-wrap select { max-width: 130px; }
}
