/* =========================================================
   GEXI — public/chat/v2/chat.css  (Chat v2, C2)
   A clean, premium, Gemini-grade conversational UI. Mobile-first, light/dark,
   smooth micro-interactions. Calm surfaces, generous whitespace, one accent gradient.
   ========================================================= */

/* P2 — ONE DESIGN LANGUAGE. The assistant's tokens are now thin ALIASES onto the canonical brand
   :root (styles.css), via the proven frontdoor.css local-alias recipe (local-name: var(--brand)).
   All 131 in-file --cv-* references keep working — so app.js + markdown.js need ZERO change — but
   they now resolve to the gecko-green brand in BOTH light and dark: the brand tokens self-theme, so
   the old parallel `html[data-theme="dark"]` block is gone, and the off-brand blue→purple→pink
   --cv-grad is dead. styles.css MUST load before this file (it does — see chat.html). */
:root {
  --cv-bg:          var(--bg);
  --cv-surface:     var(--card-alt);     /* the calm side/input panel */
  --cv-surface-2:   var(--card-alt-2);
  --cv-elevate:     var(--card);
  --cv-fg:          var(--ink);
  --cv-muted:       var(--muted);
  --cv-faint:       var(--faint);
  --cv-line:        var(--line);
  --cv-user-bubble: var(--bubble-user);  /* gecko-green-tinted, our take on Gemini's bubble */
  --cv-accent:      var(--accent);
  --cv-grad:        var(--grad-creative);/* the on-brand gecko-green gradient */
  --cv-code-bg:     var(--code-bg);
  --cv-shadow:      var(--shadow-md);
  --cv-radius:      var(--radius-lg);
  --cv-maxw:        var(--content-readw);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cv-bg); color: var(--cv-fg);
  font: 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#cv-root { height: 100dvh; }

/* splash before hydrate */
.cv-splash { height: 100dvh; display: grid; place-items: center; }
.cv-mark {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--cv-grad); color: #fff; font-weight: 800; font-size: 26px;
  box-shadow: var(--cv-shadow); animation: cv-pulse 1.6s ease-in-out infinite;
}
@keyframes cv-pulse { 0%,100% { transform: scale(1); opacity: .9 } 50% { transform: scale(1.06); opacity: 1 } }

/* ---- app layout ---- */
.cv-app { display: flex; height: 100dvh; overflow: hidden; }

/* ---- sidebar ---- */
.cv-sidebar {
  width: 280px; flex: 0 0 280px; background: var(--cv-surface); border-right: 1px solid var(--cv-line);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 10px;
}
.cv-side-head { display: flex; align-items: center; padding: 6px 8px 2px; }
.cv-brand { font-weight: 700; font-size: 17px; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.cv-spark { background: var(--cv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cv-newchat {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 999px;
  border: 1px solid var(--cv-line); background: var(--cv-elevate); color: var(--cv-fg); cursor: pointer;
  font-size: 14.5px; font-weight: 600; transition: background .15s, box-shadow .15s, transform .1s;
}
.cv-newchat span { font-size: 18px; line-height: 1; }
.cv-newchat:hover { box-shadow: var(--cv-shadow); }
.cv-newchat:active { transform: translateY(1px); }
.cv-side-label { font-size: 11.5px; font-weight: 600; color: var(--cv-faint); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 2px; }
.cv-sessions { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.cv-side-empty { color: var(--cv-faint); font-size: 13.5px; padding: 8px 10px; }
.cv-session {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border-radius: 10px;
  border: none; background: transparent; color: var(--cv-fg); cursor: pointer; text-align: left; font-size: 14px;
  transition: background .12s;
}
.cv-session:hover { background: var(--cv-surface-2); }
.cv-session.is-active { background: var(--cv-surface-2); font-weight: 600; }
.cv-session-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-session-del { opacity: 0; color: var(--cv-faint); font-size: 12px; padding: 2px 4px; border-radius: 6px; transition: opacity .12s, background .12s, color .12s; }
.cv-session:hover .cv-session-del { opacity: 1; }
.cv-session-del:hover { background: rgba(127,127,127,.18); color: var(--cv-fg); }
@media (hover: none) { .cv-session-del { opacity: .6; } }
.cv-side-foot { display: flex; gap: 8px; padding: 8px 4px 2px; border-top: 1px solid var(--cv-line); }
.cv-side-foot a { flex: 1; text-align: center; padding: 9px; border-radius: 10px; color: var(--cv-muted); text-decoration: none; font-size: 13px; font-weight: 600; transition: background .12s; }
.cv-side-foot a:hover { background: var(--cv-surface-2); color: var(--cv-fg); }

.cv-scrim { display: none; }

/* ---- main column ---- */
.cv-main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.cv-header { display: none; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--cv-line); }
.cv-header-title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; display: flex; gap: 7px; align-items: center; justify-content: center; }
.cv-icon-btn { width: 40px; height: 40px; border-radius: 12px; border: none; background: transparent; color: var(--cv-fg); font-size: 18px; cursor: pointer; display: grid; place-items: center; transition: background .12s; text-decoration: none; }
.cv-icon-btn:hover { background: var(--cv-surface); }
.cv-back { font-size: 26px; line-height: 1; padding-bottom: 3px; }
.cv-hspace { width: 40px; height: 40px; flex: 0 0 auto; }

/* ---- thread ---- */
.cv-thread-wrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cv-thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; overscroll-behavior: contain; }
.cv-scrolldown {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--cv-line);
  background: var(--cv-elevate); color: var(--cv-fg); box-shadow: var(--cv-shadow); cursor: pointer;
  display: grid; place-items: center; font-size: 18px; animation: cv-rise .2s ease;
}
.cv-scrolldown:hover { background: var(--cv-surface); }
.cv-thread-inner { max-width: var(--cv-maxw); margin: 0 auto; padding: 24px 20px 8px; }

.cv-msg { animation: cv-rise .28s cubic-bezier(.2,.7,.3,1); margin-bottom: 22px; }
@keyframes cv-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cv-user { display: flex; justify-content: flex-end; }
.cv-user .cv-bubble {
  background: var(--cv-user-bubble); color: var(--cv-fg); padding: 11px 16px; border-radius: 20px 20px 6px 20px;
  max-width: 86%; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55;
}

.cv-assistant { display: flex; gap: 14px; }
.cv-avatar {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--cv-grad); color: #fff;
  display: grid; place-items: center; font-size: 15px; margin-top: 2px; box-shadow: var(--cv-shadow);
}
.cv-content { min-width: 0; flex: 1; padding-top: 2px; }

/* markdown */
.cv-md { word-wrap: break-word; }
.cv-md > :first-child { margin-top: 0; }
.cv-md > :last-child { margin-bottom: 0; }
.cv-md p { margin: 0 0 12px; }
.cv-md h3 { font-size: 18px; margin: 18px 0 8px; }
.cv-md h4 { font-size: 15.5px; margin: 16px 0 8px; }
.cv-md ul, .cv-md ol { margin: 0 0 12px; padding-left: 22px; }
.cv-md li { margin: 4px 0; }
.cv-md a { color: var(--cv-accent); text-decoration: none; }
.cv-md a:hover { text-decoration: underline; }
.cv-md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--cv-line); color: var(--cv-muted); }
.cv-md hr { border: none; border-top: 1px solid var(--cv-line); margin: 16px 0; }
.cv-md code { background: var(--cv-code-bg); border: 1px solid var(--cv-line); border-radius: 6px; padding: 1px 6px; font-family: "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.cv-code { margin: 0 0 14px; border: 1px solid var(--cv-line); border-radius: 12px; overflow: hidden; background: var(--cv-code-bg); }
.cv-code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--cv-line); }
.cv-code-lang { font-size: 11.5px; color: var(--cv-faint); text-transform: uppercase; letter-spacing: .05em; }
.cv-code-copy { border: none; background: transparent; color: var(--cv-muted); cursor: pointer; font-size: 12px; padding: 3px 8px; border-radius: 7px; transition: background .12s; }
.cv-code-copy:hover { background: var(--cv-surface-2); color: var(--cv-fg); }
.cv-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; max-height: 460px; overflow-y: auto; }   /* code canvas: long blocks scroll, not push */
.cv-code code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.6; }

.cv-err { color: var(--red); font-size: 14px; }
.cv-actions { margin-top: 8px; display: flex; gap: 8px; opacity: 0; transition: opacity .15s; }
.cv-assistant:hover .cv-actions { opacity: 1; }
.cv-act { border: 1px solid var(--cv-line); background: transparent; color: var(--cv-muted); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; transition: background .12s, color .12s; }
.cv-act:hover { background: var(--cv-surface); color: var(--cv-fg); }

/* streaming cursor + thinking dots */
.cv-cursor { display: inline-block; width: 8px; height: 17px; transform: translateY(3px); margin-left: 2px; border-radius: 2px; background: var(--cv-accent); animation: cv-blink 1s steps(2) infinite; }
@keyframes cv-blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }
.cv-thinking { display: inline-flex; gap: 5px; padding: 6px 0; }
.cv-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--cv-faint); animation: cv-bounce 1.2s ease-in-out infinite; }
.cv-thinking span:nth-child(2) { animation-delay: .18s; }
.cv-thinking span:nth-child(3) { animation-delay: .36s; }
@keyframes cv-bounce { 0%,80%,100% { transform: scale(.6); opacity: .5 } 40% { transform: scale(1); opacity: 1 } }

/* ---- tool call + generated artifact (C3) ---- */
.cv-tool { display: inline-flex; align-items: center; gap: 8px; color: var(--cv-muted); font-size: 14px; padding: 2px 0 10px; }
.cv-tool.is-error { color: var(--red); }
.cv-tool .cv-thinking { padding: 0; }
.cv-artifact { margin: 4px 0 6px; max-width: 420px; }
.cv-art-img {
  display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--cv-line);
  background: var(--cv-surface); box-shadow: var(--cv-shadow); animation: cv-art-in .35s cubic-bezier(.2,.7,.3,1);
}
@keyframes cv-art-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.cv-art-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cv-art-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--cv-line); background: var(--cv-surface); color: var(--cv-fg); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; transition: background .12s, box-shadow .12s;
}
.cv-art-btn:hover { background: var(--cv-elevate); box-shadow: var(--cv-shadow); }
/* video / audio / document artifacts (forward-compat kinds) */
.cv-art-video { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--cv-line); background: #000; box-shadow: var(--cv-shadow); }
.cv-artifact-audio { max-width: 520px; }
.cv-art-audio { width: 100%; }
.cv-artifact-doc { max-width: 520px; }
.cv-art-doc { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--cv-line); background: var(--cv-surface); color: var(--cv-fg); text-decoration: none; font-weight: 600; }
.cv-art-doc:hover { background: var(--cv-surface-2); }

/* ---- empty state ---- */
.cv-empty { padding: max(8vh, 48px) 4px 24px; }
.cv-hello { font-size: clamp(30px, 6vw, 46px); font-weight: 700; margin: 0 0 6px; background: var(--cv-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.cv-hello-sub { font-size: clamp(18px, 3.5vw, 26px); color: var(--cv-faint); margin: 0 0 36px; font-weight: 500; }
.cv-suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cv-chip {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 16px; border-radius: 14px;
  border: 1px solid var(--cv-line); background: var(--cv-surface); color: var(--cv-fg); cursor: pointer;
  font-size: 14px; line-height: 1.45; transition: background .14s, box-shadow .14s, transform .1s;
}
.cv-chip:hover { background: var(--cv-elevate); box-shadow: var(--cv-shadow); }
.cv-chip:active { transform: translateY(1px); }
.cv-chip-ic { font-size: 18px; line-height: 1.2; }

/* ---- composer ---- */
.cv-composer-wrap { padding: 8px 20px 14px; }
.cv-composer {
  max-width: var(--cv-maxw); margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  background: var(--cv-surface); border: 1px solid var(--cv-line); border-radius: 26px; padding: 7px 7px 7px 18px;
  box-shadow: var(--cv-shadow); transition: border-color .15s;
}
.cv-composer:focus-within { border-color: color-mix(in srgb, var(--cv-accent) 55%, var(--cv-line)); }
.cv-input {
  flex: 1; border: none; background: transparent; color: var(--cv-fg); resize: none; outline: none;
  font: inherit; line-height: 1.5; padding: 8px 0; max-height: 200px; min-height: 24px;
}
.cv-input::placeholder { color: var(--cv-faint); }
.cv-send {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--cv-grad); color: #fff; font-size: 18px; display: grid; place-items: center;
  transition: transform .1s, filter .15s, opacity .15s;
}
.cv-send:hover { filter: brightness(1.06); }
.cv-send:active { transform: scale(.94); }
.cv-send.is-stop { background: var(--cv-fg); color: var(--cv-bg); font-size: 13px; }
.cv-send.is-empty { opacity: .4; }
/* P2 a11y — tokenized keyboard-focus ring for the assistant's interactive controls (chat had NONE).
   box-shadow via the brand --focus-ring so keyboard users get a clear, on-brand signal everywhere. */
.cv-send:focus-visible, .cv-model-btn:focus-visible, .cv-tool-toggle:focus-visible,
.cv-newchat:focus-visible, .cv-session:focus-visible, .cv-chip:focus-visible,
.cv-act:focus-visible, .cv-model-item:focus-visible {
  outline: none; box-shadow: var(--focus-ring);
}
.cv-disclaimer { max-width: var(--cv-maxw); margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--cv-faint); }

/* ---- composer toolbar + model picker ---- */
.cv-composer-toolbar { max-width: var(--cv-maxw); margin: 0 auto 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cv-modelpick { position: relative; }
.cv-model-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--cv-line); background: var(--cv-surface); color: var(--cv-fg);
  font: 600 12.5px/1 inherit; cursor: pointer; transition: background .12s, border-color .12s;
}
.cv-model-btn:hover { background: var(--cv-surface-2); border-color: color-mix(in srgb, var(--cv-accent) 40%, var(--cv-line)); }
.cv-model-spark { background: var(--cv-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-size: 13px; }
.cv-model-cur { font-weight: 700; }
.cv-model-caret { color: var(--cv-faint); font-size: 10px; }
.cv-model-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; min-width: 248px; max-width: calc(100vw - 24px); max-height: 60vh; overflow-y: auto;
  background: var(--cv-elevate); border: 1px solid var(--cv-line); border-radius: 16px; padding: 6px;
  box-shadow: var(--cv-shadow); animation: cv-pop .14s cubic-bezier(.2,.7,.3,1);
}
@keyframes cv-pop { from { opacity: 0; transform: translateY(6px); } }
.cv-model-group { padding-top: 4px; }
.cv-model-grouplbl { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--cv-faint); padding: 6px 10px 3px; }
.cv-model-item {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px;
  border: 0; background: transparent; color: var(--cv-fg); border-radius: 10px; cursor: pointer; transition: background .1s;
}
.cv-model-item:hover { background: var(--cv-surface); }
.cv-model-item.is-active { background: color-mix(in srgb, var(--cv-accent) 14%, transparent); }
.cv-model-auto { border-bottom: 1px solid var(--cv-line); border-radius: 10px 10px 0 0; margin-bottom: 2px; }
.cv-model-name { font-size: 13.5px; font-weight: 650; }
.cv-model-hint { font-size: 11px; color: var(--cv-faint); }
.cv-model-empty { padding: 12px 10px; font-size: 12.5px; color: var(--cv-faint); text-align: center; }

/* attribution badge under an assistant reply */
.cv-modelbadge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--cv-line); background: var(--cv-surface); color: var(--cv-muted);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; margin-left: auto;
}
/* composer tool toggle (Search) */
.cv-tool-toggle {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--cv-line); background: var(--cv-surface); color: var(--cv-muted);
  font: 600 12.5px/1 inherit; cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.cv-tool-toggle:hover { background: var(--cv-surface-2); color: var(--cv-fg); }
.cv-tool-toggle.is-on { background: color-mix(in srgb, var(--cv-accent) 16%, transparent); border-color: color-mix(in srgb, var(--cv-accent) 50%, var(--cv-line)); color: var(--cv-fg); }
@media (max-width: 640px) { .cv-composer-toolbar { margin-bottom: 6px; } .cv-model-menu { min-width: 220px; } }

/* ---- web-search citations card ---- */
.cv-search { border: 1px solid var(--cv-line); border-radius: 14px; background: var(--cv-surface); padding: 10px 12px; margin: 4px 0 10px; }
.cv-search-empty { color: var(--cv-muted); font-size: 13.5px; }
.cv-search-head { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--cv-faint); margin-bottom: 7px; }
.cv-search-list { display: flex; flex-direction: column; gap: 4px; }
.cv-cite { display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--cv-fg); transition: background .1s; }
a.cv-cite:hover { background: var(--cv-surface-2); }
.cv-cite-n { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: var(--cv-surface-2); color: var(--cv-muted); font-size: 11px; font-weight: 700; margin-top: 1px; }
.cv-cite-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cv-cite-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; word-break: break-word; }
.cv-cite-src { font-size: 11.5px; color: var(--cv-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- second-opinion (Verify) verdict ---- */
.cv-verify { margin: 10px 0 4px; border: 1px solid var(--cv-line); border-left-width: 3px; border-radius: 10px; padding: 10px 12px; background: var(--cv-surface); font-size: 13.5px; }
.cv-verify.is-running { display: flex; align-items: center; gap: 8px; color: var(--cv-muted); border-left-color: var(--cv-accent); }
.cv-verify-mark { background: var(--cv-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.cv-verify-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; }
.cv-verify-ic { font-size: 13px; }
.cv-verify-body { margin-top: 5px; color: var(--cv-fg); }
.cv-verify-body :first-child { margin-top: 0; } .cv-verify-body :last-child { margin-bottom: 0; }
.cv-verify-verified { border-left-color: #2e9e5b; } .cv-verify-verified .cv-verify-head { color: #2e9e5b; }
.cv-verify-correction { border-left-color: #d9822b; } .cv-verify-correction .cv-verify-head { color: #d9822b; }
.cv-verify-note { border-left-color: var(--cv-faint); }
html[data-theme="dark"] .cv-verify-verified { border-left-color: #4ade80; } html[data-theme="dark"] .cv-verify-verified .cv-verify-head { color: #4ade80; }
html[data-theme="dark"] .cv-verify-correction { border-left-color: #fbbf24; } html[data-theme="dark"] .cv-verify-correction .cv-verify-head { color: #fbbf24; }

/* ---- composer image attachments ---- */
.cv-attach-row { max-width: var(--cv-maxw); margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.cv-attach { position: relative; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; border: 1px solid var(--cv-line); background: var(--cv-surface); }
.cv-attach-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-attach-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 1; display: grid; place-items: center; }
.cv-attach-x:hover { background: rgba(0,0,0,.8); }
/* images shown in a user message bubble */
.cv-user-atts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.cv-user-att { max-width: 220px; max-height: 220px; border-radius: 12px; border: 1px solid var(--cv-line); object-fit: cover; }
/* document attachment chips (composer + user bubble) */
.cv-docchip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--cv-line); background: var(--cv-surface); }
.cv-docchip-ic { flex: 0 0 auto; font-size: 15px; }
.cv-docchip-name { font-size: 12.5px; font-weight: 600; color: var(--cv-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-docchip-x { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer; background: var(--cv-surface-2); color: var(--cv-muted); font-size: 10px; line-height: 1; display: grid; place-items: center; }
.cv-docchip-x:hover { background: var(--cv-line); color: var(--cv-fg); }
.cv-user-docs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.cv-docchip-static { background: var(--cv-user-bubble); }

/* ---- toast ---- */
.cv-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 50;
  background: var(--cv-fg); color: var(--cv-bg); padding: 11px 18px; border-radius: 12px; font-size: 13.5px;
  box-shadow: var(--cv-shadow); animation: cv-rise .25s ease; max-width: 90vw;
}

/* ---- disabled (flag off) ---- */
.cv-disabled { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.cv-disabled h1 { margin: 8px 0 2px; font-size: 20px; }
.cv-disabled p { color: var(--cv-faint); margin: 0; }

/* ---- mobile ---- */
@media (max-width: 820px) {
  .cv-header { display: flex; }
  .cv-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.2,.7,.3,1); box-shadow: var(--cv-shadow);
  }
  .cv-sidebar.is-open { transform: none; }
  .cv-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .26s; }
  .cv-scrim.is-on { opacity: 1; pointer-events: auto; }
  .cv-suggest { grid-template-columns: 1fr; }
  .cv-thread-inner { padding: 16px 14px 8px; }
  .cv-composer-wrap { padding: 6px 12px 12px; }
}

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