/* The message box at the foot of every page, laid out the way WeChat's is on a computer: one box to type in, and
 * under it a row with "+" (send a file), the chat's fixed buttons, and Send. Green is the person's own voice.
 * Only tokens from tokens.css, thread.css and the few below, so it follows light and dark. */
:root { --wx-me: #95ec69; --wx-me-ink: #0b1f0a; }
:root[data-theme="dark"] { --wx-me: #3eb575; --wx-me-ink: #04150b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --wx-me: #3eb575; --wx-me-ink: #04150b; } }

/* The helper's own mark, beside its line on the pages behind the chat. */
.ast-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--ink); color: var(--ground); }
.ast-mark svg { translate: 1px 1px; }
.ast-text { line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 65ch; }
.ast-wait { color: var(--grey); animation: ast-wait 1.6s ease-in-out infinite; }
@keyframes ast-wait { 50% { opacity: 0.45; } }

.foot { position: fixed; inset: auto 0 0 0; z-index: 35; padding: var(--s-2) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--ground); }
.ast-bar { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 48rem; margin-inline: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; transition: border-color var(--dur) var(--ease); }
.ast-bar:focus-within { border-color: var(--inb); }
.ast-bar textarea { min-width: 0; min-height: 44px; max-height: 160px; padding: 10px 14px 4px; border: 0; outline: 0; background: transparent; color: var(--ink); caret-color: var(--fine-dot); font: inherit; line-height: 1.5; resize: none; }
.ast-bar textarea::placeholder { color: var(--grey); }
.ast-bar textarea[aria-invalid="true"]::placeholder { color: var(--stop); }
.ast-tools { display: flex; align-items: center; gap: 6px; padding: 4px 6px 6px; }
.ast-plus { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.ast-plus svg { width: 26px; height: 26px; padding: 3px; border: 1.6px solid currentColor; border-radius: 50%; }
.ast-quick { display: flex; flex: 1; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ast-quick::-webkit-scrollbar { display: none; }
.ast-q3 { flex: none; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--soft); color: var(--ink); font: inherit; font-size: 0.875rem; white-space: nowrap; cursor: pointer; transition: background var(--dur) var(--ease); }
.ast-q3:active { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.ast-q3:disabled { opacity: 0.5; cursor: progress; }
.ast-q3:focus-visible, .ast-plus:focus-visible, .ast-send:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (hover: hover) { .ast-q3:hover, .ast-plus:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); } }
.ast-send { flex: none; min-width: 60px; height: 32px; margin-left: auto; padding: 0 var(--s-3); border: 0; border-radius: 6px; background: var(--soft); color: color-mix(in srgb, var(--ink) 72%, var(--panel)); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.ast-bar.has-text .ast-send { background: var(--wx-me); color: var(--wx-me-ink); }
.ast-send:disabled { opacity: 0.5; cursor: progress; }
/* A finger needs more room than a mouse. */
@media (pointer: coarse) { .ast-q3, .ast-send { height: 40px; } .ast-plus { width: 40px; height: 40px; } }
@media (prefers-reduced-motion: reduce) { .ast-q3, .ast-send, .ast-bar { transition: none; } }
