/* Page de chat publique */
:root {
  --accent: #1f2330;       /* surchargé par primary_color de l'agent */
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #18181b;
  --muted: #8e8ea0;
  --bubble-bot: #f1f1f3;
  --border: #ececf1;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg);
  background-image: radial-gradient(#e3e5ea 1px, transparent 1px);
  background-size: 22px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text); font-size: 15px;
}
.hidden { display: none !important; }

.chat-retry-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 10px 16px; text-align: center; font-size: 14px;
  background: #fef3c7; color: #92400e; border-bottom: 1px solid #fcd34d;
}
.chat-retry-banner.hidden { display: none; }

body.chat-layout-formal {
  --bubble-bot: #eef0f4;
  font-size: 14px;
}
body.chat-layout-formal .chat-card {
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(20, 20, 40, .06);
}
body.chat-layout-formal .chat-shell {
  background: #f3f4f6;
  background-image: none;
}
body.chat-layout-formal .msg {
  border-radius: 10px;
  max-width: 78%;
}
body.chat-layout-friendly .msg {
  border-radius: 18px;
}
body.chat-layout-balanced {
  --bubble-bot: #ececf1;
}
body.chat-layout-balanced .msg {
  border-radius: 14px;
  max-width: 82%;
}

.chat-shell {
  height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.chat-card {
  width: 100%; max-width: 720px; height: 100%; max-height: 860px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(20, 20, 40, .08);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 640px) {
  .chat-shell { padding: 0; }
  .chat-card { max-height: none; border-radius: 0; border: none; }
}

/* Mode embed (widget modale ou iframe compacte) */
body.embed-mode {
  background: #fff;
  background-image: none;
}
body.embed-mode .chat-shell {
  padding: 0;
  height: 100%;
  align-items: stretch;
}
body.embed-mode .chat-card {
  max-width: none;
  max-height: none;
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
body.embed-mode.widget-shell .chat-header {
  padding-right: 48px;
}

/* Widget intégré — accueil type « composer-first » (inspiré Gemini) */
body.embed-mode.widget-shell {
  background: linear-gradient(180deg, #f0f4ff 0%, #fff 42%);
}
body.embed-mode.widget-shell.chat-composer-focus .chat-messages,
body.embed-mode.widget-shell.chat-composer-focus .chat-suggestions,
body.embed-mode.widget-shell.chat-composer-focus .chat-ai-footer,
body.embed-mode.widget-shell.chat-composer-focus .chat-disclaimer--bottom {
  display: none !important;
}
body.embed-mode.widget-shell.chat-composer-focus .chat-composer-stage {
  display: flex;
}
body.embed-mode.widget-shell.chat-composer-focus .chat-input-zone {
  padding-top: 0;
}
body.embed-mode.widget-shell.chat-composer-focus .chat-card {
  justify-content: flex-end;
}
body.embed-mode.widget-shell.chat-composer-focus .chat-composer-stage {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 12px 18px 8px;
  min-height: 0;
}
.chat-composer-stage {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.chat-composer-stage__title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}
.chat-composer-stage__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chat-composer-stage__suggestions button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .12s, background .12s, box-shadow .12s;
  max-width: 100%;
  text-align: left;
}
.chat-composer-stage__suggestions button:hover {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 20, 40, .06);
}
body.embed-mode.widget-shell .chat-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 6px 8px;
  border-radius: 22px;
  padding: 12px 14px 10px;
  min-height: 52px;
  box-shadow: 0 4px 24px rgba(20, 20, 40, .08);
}
body.embed-mode.widget-shell .chat-input__field {
  grid-row: 1;
  grid-column: 1 / -1;
  min-width: 0;
}
body.embed-mode.widget-shell .chat-input__leading {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
body.embed-mode.widget-shell .chat-input__trailing {
  grid-row: 2;
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  justify-self: end;
}
body.embed-mode.widget-shell .chat-input textarea {
  width: 100%;
  min-height: 1.5rem;
  max-height: min(200px, 35vh);
  padding: 0 2px;
  font-size: 15px;
}
body.embed-mode.widget-shell .chat-input .send-btn {
  width: 38px;
  height: 38px;
}

body.chat-fullscreen {
  background: #fff;
  background-image: none;
}
body.chat-fullscreen .chat-shell {
  padding: 0;
  height: 100dvh;
  max-height: none;
  align-items: stretch;
}
body.chat-fullscreen .chat-card {
  max-width: none;
  max-height: none;
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Header */
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.chat-identity { display: flex; align-items: center; gap: 10px; }
.chat-identity img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
#bot-title { font-weight: 700; letter-spacing: .02em; }
.chat-actions { display: flex; gap: 4px; }
.icon-btn {
  background: none; border: none; cursor: pointer; padding: 7px;
  border-radius: 8px; color: var(--muted); display: flex;
}
.icon-btn:hover { background: var(--bubble-bot); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#tts-btn svg, #reset-btn svg, #mic-btn svg, #attach-btn svg, #send-btn svg { fill: currentColor; stroke: none; }
.icon-btn.active { color: var(--accent); background: var(--bubble-bot); }
#mic-btn.listening { color: #d3382c; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* Messages */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 22px 18px 8px;
  display: flex; flex-direction: column; gap: 14px;
}
.msg { max-width: 84%; padding: 11px 15px; border-radius: 16px;
  line-height: 1.55; font-size: 14.5px; overflow-wrap: break-word; position: relative; }
.msg.user { display: flex; align-items: flex-start; gap: 6px; padding-right: 10px; }
.msg.user .msg-body { flex: 1; min-width: 0; }
.msg.user .msg-text { display: block; }
.msg.user .msg-attach-chip {
  display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,.18); font-size: 11.5px; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.msg-edit-btn {
  flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 4px;
  border-radius: 6px; color: rgba(255,255,255,.75); opacity: .55; transition: opacity .12s;
  margin-top: 2px;
}
.msg.user:hover .msg-edit-btn, .msg.user:focus-within .msg-edit-btn { opacity: 1; }
.msg-edit-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.msg-edit-btn svg { width: 15px; height: 15px; fill: currentColor; display: block; }
.msg .stopped-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }
.msg-xls-link {
  display: inline-block; margin: 4px 0 0 4px; padding: 0;
  border: none; background: none; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--accent, #ea580c);
  text-decoration: underline; text-underline-offset: 2px;
}
.msg-xls-link:hover { color: var(--text, #1c1917); }
.msg.bot { align-self: flex-start; background: var(--bubble-bot);
  border-bottom-left-radius: 6px; }
.msg.bot.msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg-error-text { display: block; white-space: pre-wrap; word-break: break-word; }
.msg-error-hint { margin: 8px 0 0; }
.msg-open-account-btn {
  border: none; background: none; padding: 0; margin: 0;
  font: inherit; color: #ea580c; cursor: pointer; text-decoration: underline;
}
.msg-error-actions { display: flex; gap: 8px; padding: 0 4px 2px; }
.msg-report-error-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #fecaca; background: #fff; color: #991b1b; cursor: pointer;
}
.msg-report-error-btn:hover:not(:disabled) { background: #fef2f2; }
.msg-report-error-btn:disabled { opacity: .7; cursor: default; }
.msg-wrap {
  align-self: flex-start; max-width: 84%; display: flex; flex-direction: column; gap: 4px;
}
.msg-wrap .msg.bot { max-width: 100%; }
.msg-feedback {
  display: flex; align-items: center; gap: 6px; padding: 0 6px 2px;
  font-size: 12px; color: var(--muted); user-select: none;
}
.msg-feedback-duration,
.msg-feedback-time { font-variant-numeric: tabular-nums; }
.msg-feedback-sep { opacity: .45; font-size: 11px; }
.msg-feedback-btn {
  background: none; border: none; cursor: pointer; padding: 2px 3px;
  border-radius: 6px; color: var(--muted); display: inline-flex; line-height: 0;
}
.msg-feedback-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.msg-feedback-btn:hover { color: var(--text); background: rgba(0,0,0,.04); }
.msg-feedback-btn.active { color: var(--accent); }
.msg-feedback-btn--magic {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  width: auto;
  letter-spacing: 0.01em;
}
.msg.user { align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: 6px; }
.msg.typing {
  color: var(--text);
  min-width: 3.5rem;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
}
.msg.typing::after { content: none; }
.msg.typing {
  min-width: min(16rem, 72vw);
  background: color-mix(in srgb, var(--bubble-bot, #f4f4f5) 88%, var(--accent));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
@keyframes blink { 50% { opacity: 0; } }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 6px 0 10px; padding-left: 1.25em; list-style-type: decimal; }
.msg ul { list-style-type: disc; }
.msg ol > li { margin-bottom: 0.55em; }
.msg ol > li:last-child { margin-bottom: 0; }
.msg ol > li > ul { margin-top: 0.35em; margin-bottom: 0; }
.msg ol > li > p { margin: 0.35em 0 0; }
.msg hr { border: none; border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent); margin: 0.85em 0; }
.msg .console-md-h {
  margin: 0.85em 0 0.35em;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}
.msg h2.console-md-h { font-size: 1.12rem; margin-top: 0.2em; }
.msg h3.console-md-h { font-size: 1.02rem; }
.msg h4.console-md-h { font-size: 0.96rem; }
.msg h5.console-md-h { font-size: 0.92rem; }
.msg .console-md-h:first-child { margin-top: 0; }
.msg .console-md-tip {
  display: block;
  margin: 0.75em 0 0.25em;
  padding: 0.65em 0.8em;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2, #f4f4f5));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: 0.95em;
  line-height: 1.45;
}
.msg .console-md-table-wrap {
  overflow-x: auto;
  margin: 0.75em 0 0.35em;
  -webkit-overflow-scrolling: touch;
}
.msg .console-md-table {
  width: 100%;
  min-width: 260px;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.4;
}
.msg .console-md-table th,
.msg .console-md-table td {
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.msg .console-md-table th {
  background: color-mix(in srgb, var(--text) 6%, var(--bubble-bot, #f4f4f5));
  font-weight: 600;
}
.msg .console-md-table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.msg code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.msg.user code { background: rgba(255,255,255,.2); }
.msg .console-md-pre {
  margin: 0.55em 0;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.88em;
  line-height: 1.45;
}
.msg .console-md-pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.msg.user .console-md-pre {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}
.msg.bot a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg.bot a:hover { opacity: 0.85; }
.msg.user a { color: inherit; text-decoration: underline; }
.msg .sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.msg .sources__label {
  flex: 0 0 auto;
  font-weight: 600;
  margin-right: 2px;
}
.msg .sources .src-citation-sep {
  flex: 0 0 auto;
  opacity: 0.45;
  user-select: none;
  font-weight: 600;
  margin: 0 1px;
}
.msg .sources .src-citation {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.msg .sources .src-citation-img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--surface2); }
.msg .sources .src-citation-cover {
  display: inline-flex; flex-shrink: 0; line-height: 0; border-radius: 4px;
  text-decoration: none; outline-offset: 2px;
}
.msg .sources .src-citation-cover:hover { opacity: 0.9; }
.msg .sources .src-citation-cover .src-citation-img { display: block; }
.msg .sources .src-citation-text { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg .sources .src-citation-cta {
  display: inline-block;
  font-size: 0.88em;
  font-weight: 600;
  color: var(--accent, #ea580c);
  text-decoration: none;
  line-height: 1.3;
}
.msg .sources .src-citation-cta:hover { text-decoration: underline; }
.msg .sources .src-citation-ref { flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0.85; }
.msg .sources .src-citation-locator { display: block; font-size: 0.78em; opacity: 0.75; line-height: 1.25; }
.msg a.msg-related-assistant-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 2px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--accent, #ea580c);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.92em;
  line-height: 1.25;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: filter .12s ease, transform .12s ease;
  max-width: 100%;
  word-break: break-word;
}
.msg a.msg-related-assistant-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.msg a.msg-related-assistant-btn:focus-visible {
  outline: 2px solid var(--accent, #ea580c);
  outline-offset: 2px;
}
.msg-figures { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 4px; }
.msg-figure { margin: 0; padding: 0; max-width: 100%; }
.msg-figure img {
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
  max-height: min(70vh, 640px);
  object-fit: contain;
  object-position: left center;
  border-radius: 8px;
  display: block;
  background: var(--surface2);
}
.msg-figure figcaption { font-size: 0.8em; opacity: 0.75; margin-top: 4px; }
.console-md-img {
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
  max-height: min(70vh, 640px);
  object-fit: contain;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}
.msg .sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg .sources a:hover { opacity: 0.85; }

.msg-thinking {
  margin-top: 6px; padding: 8px 10px; border-radius: 10px;
  border: 1px dashed rgba(234, 88, 12, .35); background: rgba(234, 88, 12, .06);
  font-size: 11.5px; color: var(--muted);
}
.msg-thinking summary {
  cursor: pointer; font-weight: 600; color: #c2410c; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.msg-thinking summary::-webkit-details-marker { display: none; }
.msg-thinking__list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: thinking-step; }
.msg-thinking__item {
  padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.65);
  border: 1px solid rgba(0,0,0,.06);
  counter-increment: thinking-step;
}
.msg-thinking__item::before {
  content: counter(thinking-step) ". ";
  font-weight: 700;
  color: #c2410c;
  margin-right: 4px;
  float: left;
}
.msg-thinking__head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; color: var(--text); }
.msg-thinking__meta { font-size: 10px; color: var(--muted); white-space: nowrap; }
.msg-thinking__detail { margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; white-space: pre-wrap; word-break: break-word; }
.msg-thinking__item.is-refused .msg-thinking__head { color: #b91c1c; }

/* Suggestions */
.chat-suggestions {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 18px 6px;
}
.chat-suggestions button {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 18px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: border-color .12s, background .12s;
}
.chat-suggestions button:hover { border-color: var(--accent); background: var(--bubble-bot); }

/* Zone de saisie */
.chat-input-zone { padding: 10px 18px 8px; }
.chat-card:has(.chat-disclaimer--bottom:not(:empty)) .chat-input-zone { padding-bottom: 6px; }
.attach-preview {
  display: flex; align-items: center; gap: 6px; margin: 0 8px 8px;
  font-size: 12.5px; color: var(--muted);
}
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 14px; background: var(--bubble-bot); border: 1px solid var(--border);
  color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-chip-thumb {
  width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
}
.attach-chip-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-chip-remove {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 16px; line-height: 1; padding: 0 2px;
}
.attach-chip-remove:hover { color: var(--text); }
.chat-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 6px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 26px; padding: 7px 8px 7px 12px;
  box-shadow: 0 2px 10px rgba(20,20,40,.05);
  transition: border-color .12s;
}
.chat-input__leading,
.chat-input__trailing {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chat-input__field {
  min-width: 0;
}
.chat-input:focus-within { border-color: var(--accent); }
.chat-input textarea {
  width: 100%;
  border: none; outline: none; resize: none; background: transparent;
  font-family: inherit; font-size: 14.5px; line-height: 1.45;
  max-height: 120px; padding: 6px 2px; color: var(--text);
}
.send-btn {
  background: var(--accent); border: none; color: #fff; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .12s;
}
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn svg { width: 17px; height: 17px; fill: currentColor; }
.send-btn .icon-send { margin-left: 2px; }
.send-btn.stop-mode .icon-send { display: none !important; }
.send-btn.stop-mode .icon-stop { display: block !important; }
.send-btn:not(.stop-mode) .icon-stop { display: none !important; }
.send-btn.stop-mode .icon-stop { fill: #fff; color: #fff; }
.chat-disclaimer {
  margin: 0; padding: 9px 14px; text-align: center; font-size: 11.5px; color: var(--muted);
  line-height: 1.45;
}
.chat-disclaimer--top {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-disclaimer--bottom {
  border-top: none;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.35;
  padding: 2px 18px 10px;
  color: var(--muted);
  opacity: 0.85;
}
.chat-disclaimer:empty { display: none; }

.chat-ai-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bubble-bot));
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  font-size: 12.5px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  flex-shrink: 0;
}
.chat-ai-notice__text { margin: 0; }
.chat-ai-notice__meta {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}
.chat-ai-notice__link {
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-ai-notice__link:hover { color: var(--accent); }
.chat-ai-notice__eu { display: block; margin-top: 4px; }
.chat-ai-notice__eu.hidden { display: none !important; }

.chat-ai-footer {
  margin: 0;
  padding: 6px 14px 4px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg) 40%, var(--card));
}
.chat-ai-footer:empty { display: none; }

.chat-watermark {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 5px 10px;
  text-align: center;
  font-size: 11px;
  color: #78716C;
  background: #FAFAF9;
  border-top: 1px solid #E7E5E4;
  z-index: 10;
}
.chat-watermark a { color: #EA580C; text-decoration: none; font-weight: 600; letter-spacing: 0.04em; }
.chat-watermark a:hover { text-decoration: underline; }
.chat-watermark__brand span { color: #A8A29E; font-weight: 400; }
body.embed-mode.has-watermark .chat-card { padding-bottom: 28px; }
