/* mwai theme for LibreChat v0.8.7. Injected by the web proxy after LibreChat's own CSS, so these
   values override its variables without rebuilding LibreChat. Tokens from CLAUDE.md:
   ground #F8EDE7, ink #201C1A, muted #5F5853, rule #E2D3C9, panel #FCF6F2, tint #EBE6DC,
   accent #0B5E50, spark #3FA88E, mint #CDE7DE, dark #1C1816. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/mwai/static/fonts/Inter-latin.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/mwai/static/fonts/PlusJakartaSans-800-latin.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/mwai/static/fonts/Fraunces-600-latin.woff2") format("woff2"); }

html {
  --mwai-ground: #F8EDE7; --mwai-ink: #201C1A; --mwai-muted: #5F5853; --mwai-rule: #E2D3C9;
  --mwai-panel: #FCF6F2; --mwai-tint: #EBE6DC; --mwai-accent: #0B5E50; --mwai-spark: #3FA88E;
  --mwai-mint: #CDE7DE; --mwai-dark: #1C1816;

  --brand-purple: var(--mwai-accent);
  --presentation: var(--mwai-ground);
  --text-primary: var(--mwai-ink);
  --text-secondary: var(--mwai-muted);
  --text-secondary-alt: var(--mwai-muted);
  --text-tertiary: #7A716B;
  --ring-primary: var(--mwai-accent);
  --header-primary: var(--mwai-ground);
  --header-hover: var(--mwai-tint);
  --header-button-hover: var(--mwai-tint);
  --surface-active: var(--mwai-tint);
  --surface-active-alt: var(--mwai-rule);
  --surface-hover: var(--mwai-tint);
  --surface-hover-alt: var(--mwai-rule);
  --surface-primary: var(--mwai-ground);
  --surface-primary-alt: var(--mwai-panel);
  --surface-primary-contrast: var(--mwai-tint);
  --surface-secondary: var(--mwai-panel);
  --surface-secondary-alt: var(--mwai-tint);
  --surface-tertiary: var(--mwai-tint);
  --surface-tertiary-alt: var(--mwai-panel);
  --surface-dialog: var(--mwai-panel);
  --surface-submit: var(--mwai-accent);
  --surface-submit-hover: #094B40;
  --surface-chat: var(--mwai-ground);
  --border-light: var(--mwai-rule);
  --border-medium-alt: var(--mwai-rule);
  --border-medium: #D6C4B8;
  --border-heavy: #BFAEA3;
  --border-xheavy: var(--mwai-muted);
  --mwai-bar-bg: var(--mwai-panel);
  --mwai-bar-text: var(--mwai-ink);
}

html.dark {
  --brand-purple: var(--mwai-spark);
  --presentation: var(--mwai-dark);
  --text-primary: #F8EDE7;
  --text-secondary: #CDBFB6;
  --text-secondary-alt: #B5A79E;
  --text-tertiary: #9A8C83;
  --ring-primary: var(--mwai-spark);
  --header-primary: #241F1C;
  --header-hover: #2E2825;
  --header-button-hover: #2E2825;
  --surface-active: #3A332F;
  --surface-active-alt: #2E2825;
  --surface-hover: #2E2825;
  --surface-hover-alt: #3A332F;
  --surface-primary: var(--mwai-dark);
  --surface-primary-alt: #211C1A;
  --surface-primary-contrast: #241F1C;
  --surface-secondary: #241F1C;
  --surface-secondary-alt: #2E2825;
  --surface-tertiary: #2E2825;
  --surface-tertiary-alt: #2E2825;
  --surface-dialog: #241F1C;
  --surface-submit: var(--mwai-accent);
  --surface-submit-hover: #0E7564;
  --surface-chat: #241F1C;
  --border-light: #3A332F;
  --border-medium-alt: #463E39;
  --border-medium: #463E39;
  --border-heavy: #5A504A;
  --border-xheavy: #7A6E66;
  --mwai-bar-bg: #241F1C;
  --mwai-bar-text: #F8EDE7;
}

body, .font-sans { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, .text-2xl, .text-3xl { font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif; font-weight: 800; }

/* Room for the mwai bar above LibreChat's full-height layout. --mwai-bar-h is the bar's real height
   (mwai-bar.js measures it; one line, taller only with a larger system font). LibreChat sizes its chat view with
   an inline height of calc(100dvh - <banner>px), which ignores the bar and pushed the composer's send
   row below the screen and the conversation header (model button) under the bar. */
#root { height: calc(100% - var(--mwai-bar-h, 0px)) !important; margin-top: var(--mwai-bar-h, 0px); }
#root [style*="height: calc(100dvh"] { height: calc(100dvh - var(--mwai-bar-h, 0px)) !important; }
/* LibreChat scrolls inside its own panes; the page itself must not move (a focus or scroll into view
   used to slide the whole app up by the bar's height, under the bar). mwai's own pages keep scrolling. */
html[data-mwai-app], html[data-mwai-app] body { height: 100%; overflow: hidden; overscroll-behavior: none; }

.mwai-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 60; min-height: 44px; box-sizing: border-box;
  display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; padding: 4px 12px 4px 16px;
  background: var(--mwai-bar-bg); color: var(--mwai-bar-text);
  border-bottom: 1px solid var(--border-light); font: 14px/1 "Inter", system-ui, sans-serif;
}
.mwai-wordmark { position: relative; font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 22px;
  letter-spacing: -0.03em; line-height: 1; padding-right: 2px; }
.mwai-wordmark svg { position: absolute; right: -0.04em; top: 0.04em; width: 0.33em; height: 0.33em; }
.mwai-wordmark { flex: none; }
.mwai-spacer { flex: 1; min-width: 0; }
/* Buying is for Prime (PR 1098): the message shown instead of a buy action, in the sheet and refusal cards. */
.mwai-prime-only { color: var(--text-secondary); font-size: 13px; }
/* The credits chip: the bar's only control. One line, never wraps; tapping opens the sheet. */
.mwai-chip { flex: 0 1 auto; min-width: 0; max-width: 70%; min-height: 32px; box-sizing: border-box;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-medium); background: var(--surface-primary); color: inherit; cursor: pointer;
  font: 600 14px/1 "Inter", system-ui, sans-serif; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mwai-chip::after { content: ""; flex: none; width: 6px; height: 6px; margin-top: -3px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: 0.7; }
.mwai-chip:hover { background: var(--surface-hover); }
.mwai-chip:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
.mwai-chip.mwai-low { border-color: #D9A15B; background: #FFF4E5; }
html.dark .mwai-chip.mwai-low { border-color: #8A5A1C; background: #2E2213; }
.mwai-link { color: var(--mwai-accent); font-weight: 600; text-decoration: none; }
html.dark .mwai-link { color: var(--mwai-spark); }
.mwai-link:focus-visible, .mwai-btn:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
.mwai-low { color: #8A4B00; }
html.dark .mwai-low { color: #F2B866; }

.mwai-sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(32, 28, 26, 0.45);
  display: flex; align-items: flex-end; justify-content: center; }
.mwai-sheet { width: min(520px, 100%); background: var(--surface-dialog); color: var(--text-primary);
  border-radius: 16px 16px 0 0; padding: 24px; box-sizing: border-box; font-family: "Inter", system-ui, sans-serif; }
@media (min-width: 640px) { .mwai-sheet-backdrop { align-items: center; } .mwai-sheet { border-radius: 16px; } }
/* Every sheet fits the screen and scrolls inside itself (CEO's iPhone, 13 Nov 2026: the credits sheet with How mwai
   answers open was taller than the screen; the chat page never scrolls, so it froze). */
.mwai-sheet { max-height: calc(100% - 8px); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; }
.mwai-sheet h2 { margin: 0 0 8px; font-size: 22px; }
.mwai-sheet p { margin: 0 0 16px; color: var(--text-secondary); line-height: 1.5; }
/* The chip's sheet: the lines the bar used to show, then the actions. */
.mwai-rows { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 4px 0 16px; font-size: 15px; }
.mwai-rows dt { color: var(--text-secondary); }
.mwai-rows dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.mwai-pop .mwai-actions .mwai-btn { flex: 1 1 100%; text-align: center; box-sizing: border-box; }
/* One-tap sharing (mwai-bar.js shareDialog): one full-width button per way to send; the link wraps on a phone. */
.mwai-share .mwai-actions .mwai-btn { flex: 1 1 100%; text-align: center; box-sizing: border-box; }
.mwai-share .mwai-sheet p { overflow-wrap: anywhere; }
/* The credits sheet in two zones (Pay mwai redesign, CEO 30 Oct 2026): Your mwai, the balances held with
   their expiry; Add to mwai, things to buy as rows with their price. Zone names are never upper-cased:
   the brand is always "mwai". */
.mwai-sheet .mwai-zone { margin: 0 0 10px; font: 600 13px "Inter", system-ui, sans-serif; letter-spacing: 0.02em;
  color: var(--text-secondary); }
.mwai-sheet h3.mwai-zone { margin-top: 18px; }
.mwai-plan { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.mwai-plan-name { font: 800 22px "Plus Jakarta Sans", system-ui, sans-serif; }
.mwai-plan-renews { font-size: 13px; color: var(--text-secondary); text-align: right; }
.mwai-balance { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 0 0 10px;
  font-size: 15px; font-variant-numeric: tabular-nums; }
.mwai-balance small { font-size: 13px; color: var(--text-secondary); }
.mwai-amount { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; }
.mwai-amount small { font-weight: 400; }
.mwai-meter { height: 8px; border-radius: 4px; background: var(--surface-primary-contrast); margin: -4px 0 14px; overflow: hidden; }
.mwai-meter { display: flex; }
.mwai-meter > div { height: 100%; border-radius: 0; background: var(--mwai-accent); flex: none; }
.mwai-meter > div.mwai-meter-topup, .mwai-meter-legend .mwai-sw.topup { background: var(--mwai-spark); }
.mwai-meter-legend .mwai-sw.plan { background: var(--mwai-accent); }
html.dark .mwai-meter > div.mwai-meter-plan, html.dark .mwai-meter-legend .mwai-sw.plan { background: var(--mwai-spark); }
html.dark .mwai-meter > div.mwai-meter-topup, html.dark .mwai-meter-legend .mwai-sw.topup { background: var(--mwai-mint); }
.mwai-meter-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -6px 0 14px; font-size: 13px;
  color: var(--text-secondary); }
.mwai-meter-legend .mwai-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text-primary); }
.mwai-meter-legend .mwai-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mwai-meter-legend .mwai-key-total { margin-left: auto; }
.mwai-buys { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.mwai-buy { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px;
  box-sizing: border-box; border-radius: 14px; border: 1px solid var(--border-medium); background: var(--surface-primary);
  color: var(--text-primary); text-decoration: none; font-size: 15px; font-weight: 600; }
.mwai-buy:hover { background: var(--surface-hover); }
.mwai-buy:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
/* Add to mwai, two ways in (CEO, 19 Nov 2026): For me and Gift mwai, an icon, a name over a line, a chevron. */
.mwai-buy.mwai-way { justify-content: flex-start; gap: 14px; min-height: 64px; padding: 12px 16px; width: 100%;
  text-align: left; font: inherit; cursor: pointer; }
.mwai-way-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; background: var(--mwai-mint); color: var(--mwai-accent); }
.mwai-way-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.mwai-way-text strong { font-size: 16px; font-weight: 600; }
.mwai-way-sub { font-size: 14px; font-weight: 400; color: var(--mwai-muted); }
.mwai-way-go { display: flex; flex: none; color: var(--mwai-muted); }
.mwai-forme-head { display: flex; align-items: center; gap: 6px; margin: -6px 0 14px -10px; }
.mwai-forme-title { margin: 0; font: 800 22px "Plus Jakarta Sans", "Inter", system-ui, sans-serif; }
.mwai-back { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-primary); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.mwai-back:hover { background: var(--surface-hover); }
.mwai-back:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
.mwai-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mwai-sheet .mwai-actions .mwai-account { flex: 1 1 100%; text-align: center; padding: 10px 0 0; }
@media (min-width: 640px) {
  .mwai-pop.mwai-sheet-backdrop { align-items: flex-start; justify-content: flex-end; background: rgba(32, 28, 26, 0.12); }
  .mwai-pop .mwai-sheet { width: 340px; margin: calc(var(--mwai-bar-h, 44px) + 6px) 12px 0 0; padding: 20px;
    max-height: calc(100% - var(--mwai-bar-h, 44px) - 18px);
    border: 1px solid var(--border-light); box-shadow: 0 12px 32px rgba(32, 28, 26, 0.18); }
  .mwai-pop .mwai-sheet h2 { font-size: 18px; }
}
.mwai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mwai-btn { border: 0; border-radius: 10px; padding: 12px 16px; font: 600 15px "Inter", system-ui, sans-serif;
  cursor: pointer; background: var(--mwai-accent); color: #fff; text-decoration: none; }
.mwai-btn.secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-medium); }

/* Refusals in the conversation (mwai-bar.js): LibreChat's generic error box is hidden and mwai's
   message with its action button is shown in its place. */
[data-mwai-refusal] { display: none !important; }
.mwai-refusal { margin: 8px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-light);
  border-left: 3px solid var(--mwai-accent); background: var(--surface-secondary); color: var(--text-primary);
  font: 15px/1.5 "Inter", system-ui, sans-serif; }
.mwai-refusal p { margin: 0 0 10px; }
.mwai-refusal p:last-child { margin: 0; }
.mwai-refusal .mwai-btn { display: inline-block; padding: 10px 14px; font-size: 14px; }
/* premium_can_pay (CEO, 17 Nov 2026): the "Use 1 Premium credit" button, then the way to the Account setting. */
.mwai-refusal .mwai-follow { margin: 0 0 8px; }
.mwai-refusal .mwai-link { display: inline-block; font-size: 13px; }
/* What an answer cost, under it (mwai-bar.js costs). Last in LibreChat's flex column, whatever React adds. */
.mwai-cost { order: 99; margin: 2px 0 0; color: var(--text-secondary); font: 12px/1.4 "Inter", system-ui, sans-serif; }
/* mwai helpers (CEO, 25 Nov 2026): the line under an answer mwai's know-how helped, and its Turn off */
.mwai-helper-line { order: 100; margin: 2px 0 0; color: var(--text-secondary); font: 12px/1.4 "Inter", system-ui, sans-serif; }
.mwai-helper-line .mwai-helper-off { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }

/* The disclaimer under the composer. LibreChat's footer (CUSTOM_FOOTER, set in compose) is hidden
   below 640px and drawn over the bottom of the chat; on a phone it is put back as its own short line
   at the bottom of LibreChat's column, so the composer above it shrinks to fit rather than moving off
   screen. */
[role="contentinfo"] { color: var(--text-secondary); }
@media (max-width: 639px) {
  /* Clear of the phone's own bottom bar (CEO's Android, 28 Oct 2026: the base of the chat box ran into
     the navigation icons): a gap above the line, and the safe-area inset where the browser reports one. */
  #root [role="contentinfo"] { display: flex !important; position: static;
    padding: 6px 12px max(12px, env(safe-area-inset-bottom));
    font-size: 11px; line-height: 14px; color: var(--text-secondary); }
}
/* The composer on a phone (CEO's Android, 28 Oct 2026): LibreChat draws it edge to edge below 640px
   (no side padding, the box's right border and the send button ~8px from the screen edge), which a
   curved or rounded phone screen cuts off. Inset it 10px each side, round all four corners, and never
   let the chat column or the composer grow wider than the screen. */
@media (max-width: 639px) {
  html, body, #root { max-width: 100%; overflow-x: hidden; }
  #root form:has(#prompt-textarea) { box-sizing: border-box; width: 100%; max-width: 100%;
    padding-left: 10px; padding-right: 10px; margin-bottom: 4px; }
  #root form:has(#prompt-textarea) > div, #root form:has(#prompt-textarea) .flex-1 { min-width: 0; }
  #root form:has(#prompt-textarea) .rounded-t-3xl { border-radius: 24px; border-bottom-width: 1px; }
}
@media (max-width: 480px) {
  .mwai-bar { gap: 8px; padding: 4px 10px 4px 14px; }
  .mwai-bar .mwai-wordmark { font-size: 20px; }
  .mwai-chip { font-size: 13px; padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Link a computer (link-prompt.js): "Sign in on a computer?" on the phone. */
.mwai-link-prompt .mwai-link-device { margin: 0 0 10px; font-weight: 600; color: var(--text-primary); }
.mwai-link-prompt .mwai-link-note { margin: 0 0 12px; font-weight: 600; color: var(--text-primary); }
.mwai-link-prompt .mwai-link-note:empty { display: none; }

/* The countdown while the customer pays in PaySimati (buy.js waitFor, CEO 31 Oct 2026). */
.mwai-wait { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1000; max-width: 440px; margin: 0 auto;
  padding: 14px 16px; border-radius: 16px; border: 1px solid var(--mwai-rule); background: var(--mwai-panel);
  color: var(--mwai-ink); font-family: Inter, system-ui, sans-serif; box-shadow: 0 8px 24px rgba(32, 28, 26, .18); }
.mwai-wait strong { display: block; font-size: 16px; padding-right: 36px; }
.mwai-wait .mwai-wait-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: transparent; color: var(--mwai-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.mwai-wait .mwai-wait-x:focus-visible { outline: 2px solid var(--mwai-accent); outline-offset: 2px; }
.mwai-wait p { margin: 4px 0 10px; color: var(--mwai-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.mwai-wait div { display: flex; gap: 8px; flex-wrap: wrap; }
.mwai-wait .mwai-wait-btn { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--mwai-accent);
  color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; }
.mwai-wait .mwai-wait-btn + .mwai-wait-btn { background: transparent; color: var(--mwai-accent); border: 1px solid var(--mwai-rule); }
html.dark .mwai-wait { background: var(--mwai-dark); border-color: #3A3330; color: #F8EDE7; }
html.dark .mwai-wait p { color: #CDBFB6; }
html.dark .mwai-wait .mwai-wait-x { color: #CDBFB6; }
html.dark .mwai-wait .mwai-wait-btn + .mwai-wait-btn { color: var(--mwai-spark); border-color: #3A3330; }

/* Working (mwai-bar.js workTick, CEO 31 Oct 2026): above the message box while an answer is awaited. */
.mwai-working { position: fixed; left: 16px; right: 16px; z-index: 900; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 14px;
  border-radius: 14px; border: 1px solid var(--mwai-rule); background: var(--mwai-panel); color: var(--mwai-ink);
  font: 500 14px/1.35 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; box-shadow: 0 6px 18px rgba(32, 28, 26, .12); }
.mwai-working-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mwai-spark); animation: mwai-pulse 1.2s ease-in-out infinite; }
.mwai-working-note { grid-column: 2; color: var(--mwai-muted); font-size: 13px; }
.mwai-working-note:empty, .mwai-working-line:empty { display: none; }
.mwai-working-done .mwai-working-dot { animation: none; background: var(--mwai-muted); }
.mwai-working-failed .mwai-working-dot { animation: none; background: #B4532A; }
.mwai-working-ready .mwai-working-dot { animation: none; background: var(--mwai-accent); }
.mwai-working-show { grid-column: 2; justify-self: start; margin-top: 8px; padding: 6px 14px; border: 0; border-radius: 999px;
  background: var(--mwai-accent); color: #fff; font: 600 14px/1.2 Inter, system-ui, sans-serif; cursor: pointer; }
.mwai-working-show[hidden] { display: none; }
@keyframes mwai-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .mwai-working-dot { animation: none; } }
html.dark .mwai-working { background: var(--mwai-dark); border-color: #3A3330; color: #F8EDE7; }
html.dark .mwai-working-note { color: #CDBFB6; }

/* The account button (initials, bottom of LibreChat's sidebar) on a phone (CEO's iPhone, 31 Oct 2026: half
   hidden at the bottom of the screen). Below 768px the sidebar is drawn over the chat at full height, and
   the mwai bar pushes it down by the bar's height; lift the button by that much plus the phone's own
   bottom inset, so it is whole at every screen size. */
@media (max-width: 768px) {
  #root [data-testid="nav-user"] { margin-bottom: calc(var(--mwai-bar-h, 48px) + env(safe-area-inset-bottom, 0px)); }
  /* The phone sidebar (LibreChat 0.8.7: a fixed full-height layer from the top of the screen, inside #root's own
     stacking context) sat under the mwai bar, hiding its first 44px: the close button and, since option A, the
     New chat button (7 Nov 2026). Its content starts below the bar; the bottom is unchanged. */
  #root div.fixed.left-0.top-0 { padding-top: var(--mwai-bar-h, 44px); }
}

/* Follow-up buttons (mwai-bar.js paintFollowUps / failedButtons, CEO 31 Oct 2026). */
.mwai-follow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; grid-column: 1 / -1; }
.mwai-follow-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--mwai-rule); background: transparent;
  color: var(--mwai-accent); font: 600 13px/1.2 Inter, system-ui, sans-serif; cursor: pointer; }
.mwai-follow-btn:disabled { opacity: .5; cursor: default; }
html.dark .mwai-follow-btn { color: var(--mwai-spark); border-color: #3A3330; }
.mwai-follow-note { align-self: center; color: var(--mwai-muted); font: 400 12px/1.3 Inter, system-ui, sans-serif; }

/* A sheet's round × (mwai-bar.js closeX; CEO, 14 Nov 2026: on a phone a sheet nearly fills the screen, so the backdrop is
   no way out). In the credits sheet it sits in the top corner and stays there while the sheet scrolls. */
.mwai-x { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--mwai-guide-card, #FFFFFF); color: var(--text-primary); font: 400 22px/40px "Inter", system-ui, sans-serif;
  text-align: center; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.mwai-x:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
.mwai-pop .mwai-sheet > .mwai-x { float: right; position: sticky; top: 0; z-index: 1; margin: -10px -10px 0 8px; }
html.dark .mwai-x { background: #2E2825; }
.mwai-guide-open { border: 0; background: none; cursor: pointer; font: 600 15px "Inter", system-ui, sans-serif; }

/* Using mwai (mwai-bar.js guideSheet; CEO, 14 Nov 2026: the approved redesign): its own sheet, a header that stays (title,
   ×, a line, the topic chips), then a card per topic with each price as a lozenge, centred: mint for standard credits,
   amber for Premium. It scrolls inside itself as every sheet (.mwai-sheet). */
.mwai-guide-sheet { --mwai-guide-sheet: var(--mwai-panel); --mwai-guide-card: #FFFFFF; --mwai-guide-ink: var(--mwai-ink);
  --mwai-guide-muted: var(--mwai-muted); --mwai-guide-rule: var(--mwai-rule); --mwai-guide-accent: var(--mwai-accent);
  --mwai-guide-mint: var(--mwai-mint); --mwai-guide-prem-bg: #F3E6D6; --mwai-guide-prem-ink: #7A4A12; }
html.dark .mwai-guide-sheet { --mwai-guide-sheet: var(--mwai-dark); --mwai-guide-card: #241F1C; --mwai-guide-ink: #F8EDE7;
  --mwai-guide-muted: #BDB3AB; --mwai-guide-rule: #3A332F; --mwai-guide-accent: var(--mwai-spark);
  --mwai-guide-mint: #1F3A33; --mwai-guide-prem-bg: #3A2C1C; --mwai-guide-prem-ink: #F2C98A; }
.mwai-sheet.mwai-guide-sheet { padding: 0; background: var(--mwai-guide-sheet); color: var(--mwai-guide-ink);
  border-radius: 18px 18px 0 0; font: 400 15px/1.45 "Inter", system-ui, sans-serif; }
@media (min-width: 640px) { .mwai-sheet.mwai-guide-sheet { border-radius: 18px; } }
.mwai-sheet.mwai-guide-sheet .mwai-x { background: var(--mwai-guide-card); color: var(--mwai-guide-ink); }
.mwai-guide-head { position: sticky; top: 0; z-index: 2; background: var(--mwai-guide-sheet); border-radius: 18px 18px 0 0;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--mwai-guide-rule); }
.mwai-guide-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mwai-sheet .mwai-guide-bar h2 { margin: 0; font: 800 21px/1.2 "Plus Jakarta Sans", "Inter", system-ui, sans-serif; }
.mwai-sheet p.mwai-guide-sub { margin: 4px 0 10px; color: var(--mwai-guide-muted); font-size: 13.5px; line-height: 1.45; }
.mwai-guide-chips { position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mwai-guide-chips::-webkit-scrollbar { display: none; }
.mwai-guide-chip { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--mwai-guide-card);
  border: 1px solid var(--mwai-guide-rule); font: 600 13px "Inter", system-ui, sans-serif; color: var(--mwai-guide-ink);
  white-space: nowrap; cursor: pointer; }
.mwai-guide-chip.mwai-on { background: var(--mwai-guide-accent); border-color: var(--mwai-guide-accent); color: #fff; }
.mwai-guide-chip:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
.mwai-guide-body { padding: 6px 16px 28px; }
.mwai-guide-topic { margin-top: 18px; }
.mwai-guide-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 8px; }
.mwai-guide-sec h3 { margin: 0; font: 800 16px "Plus Jakarta Sans", "Inter", system-ui, sans-serif; }
.mwai-guide-sec span { font-size: 12.5px; color: var(--mwai-guide-muted); text-align: right; }
.mwai-guide-card { background: var(--mwai-guide-card); border: 1px solid var(--mwai-guide-rule); border-radius: 14px;
  overflow: hidden; }
.mwai-guide-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px;
  border-top: 1px solid var(--mwai-guide-rule); }
.mwai-guide-item:first-child, .mwai-guide-ex:first-child, .mwai-guide-grp + .mwai-guide-ex { border-top: 0; }
.mwai-guide-name { font-weight: 600; }
.mwai-guide-desc { grid-column: 1; color: var(--mwai-guide-muted); font-size: 13.5px; }
.mwai-guide-price { grid-row: 1 / span 2; grid-column: 2; align-self: center; justify-self: end; text-align: center;
  min-width: 58px; box-sizing: border-box; font: 700 14px/1.3 "Inter", system-ui, sans-serif; padding: 5px 10px;
  border-radius: 10px; background: var(--mwai-guide-mint); color: var(--mwai-guide-accent); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.mwai-guide-price small { display: block; font-weight: 500; font-size: 11px; opacity: 0.8; }
.mwai-guide-price.mwai-prem { background: var(--mwai-guide-prem-bg); color: var(--mwai-guide-prem-ink); }
.mwai-guide-tags { grid-column: 1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mwai-guide-tag { font: 600 11px/1.5 "Inter", system-ui, sans-serif; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--mwai-guide-rule); color: var(--mwai-guide-muted); }
.mwai-sheet p.mwai-guide-note { margin: 8px 4px 0; color: var(--mwai-guide-muted); font-size: 12.5px; line-height: 1.45; }
.mwai-sheet p.mwai-guide-grp { margin: 0; padding: 9px 14px 2px; font: 700 11.5px "Inter", system-ui, sans-serif;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--mwai-guide-muted); }
.mwai-sheet p.mwai-guide-grp:not(:first-child) { border-top: 1px solid var(--mwai-guide-rule); }
.mwai-guide-ex { display: grid; grid-template-columns: 34px 1fr auto; gap: 0 10px; align-items: center; padding: 11px 14px;
  border-top: 1px solid var(--mwai-guide-rule); }
.mwai-guide-ex .mwai-guide-name { display: block; font-weight: 700; }
.mwai-guide-ex .mwai-guide-desc { display: block; }
.mwai-guide-ex .mwai-guide-price { grid-row: auto; grid-column: auto; }
.mwai-guide-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--mwai-guide-mint);
  color: var(--mwai-guide-accent); display: grid; place-items: center; font-size: 16px; }
.mwai-guide-lines { margin: 0; padding: 12px 14px 12px 32px; color: var(--mwai-guide-muted); font-size: 14px; }
.mwai-guide-lines li { margin: 2px 0; line-height: 1.4; }
.mwai-guide-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.mwai-guide-foot .mwai-link { color: var(--mwai-guide-accent); }
.mwai-guide-foot .mwai-btn { border-radius: 12px; padding: 11px 18px; background: var(--mwai-accent); }
/* Dark mode (review, 14 Nov 2026): the follow-up note was #5F5853 on the dark ground (2.3:1) and the guide kept its light
   rule; the dark sheets' own muted text and rule. */
html.dark .mwai-follow-note { color: #CDBFB6; }
/* The PDF icon in the answer's icon row (mwai-bar.js paintDocs): LibreChat's own hover-button look. */
.mwai-pdf svg { display: block; }
/* The document the model made for an answer (mwai-bar.js fileCard): one tap to download. */
.mwai-file { order: 90; display: flex; align-items: center; gap: 6px; margin: 10px 0 2px; max-width: 360px; }
.mwai-file-main { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--mwai-rule, #E2D3C9); border-radius: 12px; background: var(--mwai-panel, #FCF6F2); color: #0B5E50; cursor: pointer; }
.mwai-file-main svg { grid-row: span 2; width: 26px; height: 26px; }
.mwai-file-name { color: #201C1A; font: 600 14px/1.3 "Inter", system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mwai-file-meta { color: #5F5853; font: 12px/1.3 "Inter", system-ui, sans-serif; }
.mwai-file-word { padding: 10px 12px; border: 1px solid var(--mwai-rule, #E2D3C9); border-radius: 12px; background: var(--mwai-panel, #FCF6F2); color: #0B5E50; font: 600 13px "Inter", system-ui, sans-serif; cursor: pointer; }
html.dark .mwai-file-main, html.dark .mwai-file-word { background: #26211E; border-color: #3A332F; color: var(--mwai-spark); }
html.dark .mwai-file-name { color: #F8EDE7; }
html.dark .mwai-file-meta { color: #BDB3AB; }
/* mwai Documents (CEO, 7 Nov 2026; mwai-bar.js savedSheet): the saved list, scrolling inside the sheet. */
.mwai-sheet.mwai-docs { max-height: min(86vh, 720px); overflow-y: auto; }
.mwai-docs-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mwai-docs-item { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--mwai-rule, #E2D3C9);
  border-radius: 12px; background: var(--mwai-panel, #FCF6F2); }
.mwai-docs-item .mwai-file-name { color: var(--mwai-ink, #201C1A); }
.mwai-docs-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mwai-docs-acts .mwai-btn { padding: 8px 12px; font-size: 14px; }
.mwai-sheet p.mwai-docs-note { font-size: 13px; }
.mwai-file-save:disabled { color: var(--mwai-muted, #5F5853); cursor: default; }
html.dark .mwai-docs-item { background: #26211E; border-color: #3A332F; }
html.dark .mwai-docs-item .mwai-file-name { color: #F8EDE7; }
html.dark .mwai-file-save:disabled { color: #BDB3AB; }
/* About you (CEO, 12 Nov 2026; mwai-bar.js aboutSheet): the customer's own rules, a text box with a counter. 16px text
   so a phone does not zoom in. The backdrop follows the visible area (mwai-bar.js fitSheet), so the sheet fits above
   the keyboard and scrolls inside it, never the page behind. */
.mwai-sheet.mwai-about { max-height: min(90dvh, 760px, calc(100% - 8px)); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.mwai-about-text { display: block; width: 100%; box-sizing: border-box; min-height: 168px; resize: vertical; padding: 12px;
  border: 1px solid var(--mwai-rule, #E2D3C9); border-radius: 12px; background: var(--mwai-panel, #FCF6F2);
  color: var(--mwai-ink, #201C1A); font: 400 16px/1.45 "Inter", system-ui, sans-serif; }
.mwai-about-text::placeholder { color: var(--mwai-muted, #5F5853); opacity: 0.85; }
.mwai-about-text:focus-visible { outline: 2px solid var(--ring-primary); outline-offset: 2px; }
.mwai-sheet p.mwai-about-count { margin: 6px 0 4px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.mwai-sheet p.mwai-about-msg { margin: 0 0 12px; min-height: 1.4em; font-size: 14px; color: var(--mwai-accent); }
.mwai-about .mwai-actions .mwai-btn[hidden] { display: none; }
.mwai-about .mwai-actions .mwai-btn:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 480px) { .mwai-about .mwai-actions .mwai-btn { flex: 1 1 100%; text-align: center; } }
.mwai-about-open { border: 0; background: none; cursor: pointer; font: 600 15px "Inter", system-ui, sans-serif; }
html.dark .mwai-about-text { background: #26211E; border-color: #3A332F; color: #F8EDE7; }
html.dark .mwai-about-text::placeholder { color: #BDB3AB; }
html.dark .mwai-sheet p.mwai-about-msg { color: var(--mwai-spark); }
.mwai-cost[role="button"] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* The sidebar (CEO, 7 Nov 2026, option A; mwai-bar.js paintSidebar): New chat and Explore on top, LibreChat's
   list held to about five chats until All chats, the plan and credits at the foot. */
[data-mwai-hide] { display: none !important; }
/* The rail's own New chat (CEO, 8 Nov 2026: "redundant ... with the green new chat lozenge"): hidden while the
   sidebar is open, where the green New chat stands. With the sidebar closed on a computer the rail is all that
   shows, so the icon stays. Hidden, not removed: the green button still clicks it (mwai-bar.js sideTop). */
aside:has([data-testid="close-sidebar-button"][aria-expanded="true"]) a[data-testid="new-chat-button"] {
  display: none !important; }
/* The rail on a phone (CEO, 14 Nov 2026: "3 icons ... 2 overlap in function, one does nothing"): with the sidebar
   open its panel toggle repeats the close at the top right (and tapping outside), its pencil repeats the green
   New chat (the rule above misses it: on a phone the sidebar is not an <aside>), and its Chats button changes
   nothing (the only panel mwai keeps). All three go, with the line under them; the account menu (KA: Settings,
   Log out) at its foot stays. The rail is LibreChat's (GT): the toggle, the new-chat link and the divider are its
   direct children, the panel buttons sit in a list beside them. Computers keep the rail, which reopens a closed
   sidebar. */
@media (max-width: 767px) {
  div:has(> div > [data-testid^="nav-panel-"]) > :is([data-testid="close-sidebar-button"],
    [data-testid="open-sidebar-button"], a[data-testid="new-chat-button"], .border-b),
  [data-testid="nav-panel-conversations"] { display: none !important; }
}
.mwai-side { padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 12px; flex: none; }
.mwai-side-new { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 0;
  border-radius: 12px; background: var(--mwai-accent); color: #FFFFFF; font: 600 15px Inter, system-ui, sans-serif;
  cursor: pointer; }
.mwai-side-new:hover { background: #08463c; }
.mwai-side-new:focus-visible, .mwai-side-row:focus-visible, .mwai-side-more:focus-visible,
.mwai-side-who:focus-visible, .mwai-side-top:focus-visible { outline: 2px solid var(--mwai-spark); outline-offset: 2px; }
.mwai-side-group { display: flex; flex-direction: column; }
.mwai-side-h { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-secondary); padding: 2px 4px 6px; }
.mwai-side-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 4px; border: 0;
  border-radius: 10px; background: transparent; color: var(--text-primary); text-align: left; cursor: pointer;
  font-family: Inter, system-ui, sans-serif; }
.mwai-side-row[hidden] { display: none; }
.mwai-side-row:hover { background: var(--surface-hover); }
.mwai-side-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; background: var(--mwai-tint); color: var(--mwai-accent); }
.mwai-side-ic-mint { background: var(--mwai-mint); }
.mwai-side-txt, .mwai-side-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mwai-side-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mwai-side-sub { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.mwai-side-tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--mwai-accent); white-space: nowrap; }
.mwai-side-tag:empty { display: none; }
/* About five chats (with the Pinned and date headings) until All chats; the list still scrolls inside. */
.mwai-side-list:not(.mwai-side-all) { flex: 0 1 auto !important; height: 312px; max-height: 312px; }
/* Chat names on two lines (CEO, 7 Nov 2026: "text fading off page"): LibreChat 0.8.7 keeps a name on one line and
   fades its end under a gradient. The name wraps to two lines (each row is 48px high on a phone, 36px wider), ends
   with an ellipsis when longer still, and the fade goes. */
[data-testid="convo-item"] div.whitespace-nowrap.flex-1 { white-space: normal !important; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.25; overflow-wrap: anywhere; }
@media (min-width: 768px) { [data-testid="convo-item"] div.whitespace-nowrap.flex-1 { font-size: 13px; line-height: 1.2; } }
[data-testid="convo-item"] div.whitespace-nowrap.flex-1 > .bg-gradient-to-l { display: none; }
.mwai-side-more { align-self: flex-start; margin: 2px 16px 0; padding: 6px 4px; border: 0; background: transparent;
  color: var(--mwai-accent); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; flex: none; }
.mwai-side-more[hidden] { display: none; }
.mwai-side-foot { margin-top: auto; flex: none; display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--mwai-rule); padding: 12px 16px 4px; }
.mwai-side-foot[hidden] { display: none; }
.mwai-side-av { width: 36px; height: 36px; flex: none; border-radius: 18px; background: var(--mwai-accent);
  color: #FFFFFF; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.mwai-side-who { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer;
  color: var(--text-primary); font-family: Inter, system-ui, sans-serif; }
.mwai-side-top { flex: none; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--mwai-accent);
  color: var(--mwai-accent); font-size: 13px; font-weight: 600; text-decoration: none; display: flex;
  align-items: center; }
.mwai-side-top[hidden] { display: none; }
html.dark .mwai-side-ic { background: #2A2421; color: var(--mwai-spark); }
html.dark .mwai-side-ic-mint { background: #1E3A33; }
html.dark .mwai-side-tag, html.dark .mwai-side-more { color: var(--mwai-spark); }
html.dark .mwai-side-top { color: var(--mwai-spark); border-color: var(--mwai-spark); }
html.dark .mwai-side-foot { border-top-color: #3A332F; }

/* One tap to choose a model on a phone (CEO, 10 Nov 2026): the picker's Pin buttons appear on hover, and that change
   made touch browsers take the first tap as hover only. On a touch screen they stay hidden. */
@media (hover: none) {
  #root [role="option"] button[aria-label="Pin"], #root [role="option"] button[aria-label="Unpin"],
  #root [role="menuitem"] button[aria-label="Pin"], #root [role="menuitem"] button[aria-label="Unpin"] { display: none !important; }
}
/* Older mwai tabs (a one-a-day line) and the one-time Home Screen tip on an iPhone (CEO, 10 Nov 2026). */
/* Below mwai's bar (44px and its safe-area inset), never over the credits chip, and under the sheets (70), so a sheet's
   close button is never covered (sweep, 14 Nov 2026). */
.mwai-home-tip { position: fixed; left: 12px; right: 12px; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 65;
  display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--mwai-mint);
  color: var(--mwai-ink); box-shadow: 0 4px 16px rgba(32, 28, 26, 0.18); font-size: 14px; }
.mwai-home-tip p { margin: 0; flex: 1; }
.mwai-home-tip a { color: var(--mwai-accent); font-weight: 600; white-space: nowrap; }
.mwai-home-tip-x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--mwai-ink); padding: 0 4px; }
/* "mwai has been updated" / "Your session needs a refresh" (mwai-bar.js refreshBar, CEO 19 Nov 2026): the whole bar is
   one button, above the other tips; theme colours, so both themes. */
.mwai-refresh { z-index: 66; padding: 0; }
.mwai-refresh-btn { flex: 1; text-align: left; background: none; border: 0; padding: 12px; font: inherit;
  font-weight: 600; color: var(--mwai-ink); cursor: pointer; border-radius: 12px; }
.mwai-refresh-btn:focus-visible { outline: 2px solid var(--mwai-accent); outline-offset: 2px; }
/* The terms notice (Terms 16.1, billing notices.py): the full width for its words, the link on its own line below. */
#mwai-terms-notice { flex-wrap: wrap; }
#mwai-terms-notice p { flex: 1 1 calc(100% - 40px); }
#mwai-terms-notice a { order: 3; flex-basis: 100%; }

/* The paperclip (CEO, 14 Nov 2026): mwai-bar.js opens the phone's picker itself and then uses LibreChat's attach menu
   out of sight to hand the files over, so the menu never shows. */
html.mwai-attaching [role="menu"], html.mwai-attaching [data-backdrop] { opacity: 0 !important; }

/* The price before sending (CEO, 13 Nov 2026; mwai-bar.js paintSendPrice): a quiet line just above the message box. */
.mwai-sendprice { margin: 0 auto 4px; padding: 0 18px; max-width: 48rem; font: 500 12.5px/1.3 Inter, system-ui, sans-serif;
  color: var(--mwai-muted); font-variant-numeric: tabular-nums; }
html.dark .mwai-sendprice { color: #CDBFB6; }

/* The customer's questions as chat bubbles (CEO, 14 Nov 2026: "like WhatsApp"): right-aligned, mint, no avatar or name,
   so a question is told from mwai's answer at a glance and takes less of a phone's screen. mwai's answers stay full
   width (tables and code need it). LibreChat v0.8.7 hooks: a turn is [aria-label^="Message"] holding .user-turn or
   .agent-turn; the text is .message-content; the edit box replaces it (a textarea), so nothing below applies then. */
[aria-label^="Message"]:has(> .user-turn) { justify-content: flex-end; }
[aria-label^="Message"]:has(> .user-turn) > :not(.user-turn) { display: none; }  /* the avatar column */
.user-turn { width: auto !important; max-width: min(85%, 36rem); align-items: flex-end; }
.user-turn > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.user-turn > div, .user-turn > div > div, .user-turn .text-message { align-items: flex-end; }
.user-turn > div > div:last-child { justify-content: flex-end; }  /* Copy, Edit: under the bubble */
/* A photo on a question stays small, as in a messaging app (CEO, 14 Nov 2026): at most 160px tall and 70% wide; tap opens it full. */
.user-turn img { max-height: 160px; width: auto !important; max-width: 70vw; height: auto; object-fit: contain; border-radius: 12px; }
.user-turn :has(> img) { width: auto !important; max-width: 100%; height: auto !important; }
.user-turn .message-content { width: auto !important; max-width: 100%; padding: 8px 12px; border-radius: 18px 18px 4px 18px;
  background: var(--mwai-mint); color: var(--mwai-ink); }
.user-turn .message-content > :last-child { margin-bottom: 0; }
html.dark .user-turn .message-content { background: #24463C; color: #F2ECE6; }
/* A long question on a phone: six lines, then "See more" (mwai-bar.js clampQuestions); never while it is edited. */
@media (max-width: 639px) {
  .user-turn .message-content.mwai-clamped { max-height: calc(6 * 1.5em + 16px); overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
}
.mwai-see-more { align-self: flex-end; margin: 2px 4px 0; padding: 2px 4px; border: 0; background: none;
  color: var(--mwai-accent); font: 600 13px/1.4 "Inter", system-ui, sans-serif; cursor: pointer; }
html.dark .mwai-see-more { color: var(--mwai-spark); }

/* The picture viewer's Image Details (CEO's iPhone, 22 Nov 2026): on a phone the open panel pushed the viewer's
   Download and details buttons onto its Close button. The panel has its own Close, so they wait until it shuts. */
.mwai-picture-said { white-space: pre-wrap; overflow-wrap: anywhere; }
.mwai-picture-said + .mwai-picture-said { margin-top: 12px; }
.mwai-picture-said strong { display: block; }
@media (max-width: 639px) {
  [role="dialog"]:has([data-side-panel]) > div.right-\[336px\] { display: none; }
}
