/* tMP Chat: the support bubble. Sits bottom-right; the admin menu owns bottom-left. */
.tmp-chat { position: fixed; right: 20px; bottom: 20px; z-index: 9990; font-family: var(--sans, system-ui, sans-serif); display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.tmp-chat[hidden] { display: none; }

.tmp-chat__bubble { display: inline-flex; align-items: center; gap: 9px; border: 0; cursor: pointer; padding: 13px 18px; border-radius: 99px; background: var(--ink, #0F2029); color: #fff; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; box-shadow: 0 14px 34px -12px rgba(15, 32, 41, .5); transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s; position: relative; }
.tmp-chat__bubble:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -12px rgba(15, 32, 41, .58); }
.tmp-chat__bubble:focus-visible { outline: 2px solid var(--accent, #58B4E5); outline-offset: 3px; }
.tmp-chat__label:empty { display: none; }
.tmp-chat__badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #C2452F; color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--paper, #F5F2EA); }
.tmp-chat__badge[hidden] { display: none; }
.tmp-chat.is-open .tmp-chat__ico, .tmp-chat.is-open .tmp-chat__label { display: none; }
.tmp-chat.is-open .tmp-chat__bubble::before { content: "×"; font-size: 24px; line-height: 1; font-weight: 400; }
.tmp-chat.is-open .tmp-chat__bubble { padding: 12px 17px; }

.tmp-chat__panel { width: min(370px, calc(100vw - 32px)); max-height: min(72vh, 620px); display: flex; flex-direction: column; overflow: hidden; background: var(--card, #FFFDF8); border: 1px solid var(--line, rgba(15, 32, 41, .14)); border-radius: 18px; box-shadow: 0 30px 70px -28px rgba(15, 32, 41, .5); transform-origin: bottom right; animation: tmp-chat-in .22s cubic-bezier(.2, .7, .2, 1); }
.tmp-chat__panel[hidden] { display: none; }
@keyframes tmp-chat-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.tmp-chat__top { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line, rgba(15, 32, 41, .14)); background: var(--tint, #F0EEE6); }
.tmp-chat__top div { display: grid; margin-right: auto; min-width: 0; }
.tmp-chat__who { font-size: 15px; font-weight: 600; color: var(--ink, #0F2029); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmp-chat__state { font-size: 12.5px; color: var(--muted, #5C6B73); }
.tmp-chat__dot { width: 9px; height: 9px; border-radius: 50%; background: #3F9E63; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(63, 158, 99, .18); }
.tmp-chat.is-away .tmp-chat__dot { background: #B9A24A; box-shadow: 0 0 0 3px rgba(185, 162, 74, .18); }
.tmp-chat__x { border: 0; background: transparent; color: var(--muted, #5C6B73); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.tmp-chat__x:hover { background: rgba(15, 32, 41, .07); color: var(--ink, #0F2029); }

.tmp-chat__log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; overscroll-behavior: contain; }
.tmp-chat__msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; animation: tmp-chat-pop .2s ease-out; }
@keyframes tmp-chat-pop { from { opacity: 0; transform: translateY(6px); } }
.tmp-chat__msg--us { align-self: flex-start; background: var(--tint, #F0EEE6); color: var(--ink2, #2A3F49); border-bottom-left-radius: 5px; }
.tmp-chat__msg--you { align-self: flex-end; background: var(--ink, #0F2029); color: #fff; border-bottom-right-radius: 5px; }
.tmp-chat__msg--sys { align-self: center; background: transparent; color: var(--muted, #5C6B73); font-size: 12.5px; text-align: center; padding: 4px 8px; max-width: 100%; }
.tmp-chat__wait { align-self: flex-start; display: flex; gap: 4px; padding: 13px 15px; background: var(--tint, #F0EEE6); border-radius: 16px; border-bottom-left-radius: 5px; }
.tmp-chat__wait i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted, #5C6B73); animation: tmp-chat-blink 1.3s infinite; }
.tmp-chat__wait i:nth-child(2) { animation-delay: .18s; } .tmp-chat__wait i:nth-child(3) { animation-delay: .36s; }
@keyframes tmp-chat-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.tmp-chat__ask { padding: 0 16px 12px; }
.tmp-chat__ask[hidden] { display: none; }
.tmp-chat__ask label { display: block; font-size: 12.5px; color: var(--muted, #5C6B73); }
.tmp-chat__email { width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line, rgba(15, 32, 41, .2)); background: #fff; color: var(--ink, #0F2029); }
.tmp-chat__email:focus { outline: 0; border-color: var(--ink, #0F2029); }

.tmp-chat__say { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 12px 16px; border-top: 1px solid var(--line, rgba(15, 32, 41, .14)); }
.tmp-chat__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; }
.tmp-chat__in { flex: 1 1 auto; font: inherit; font-size: 14.5px; line-height: 1.4; color: var(--ink, #0F2029); background: transparent; border: 0; resize: none; max-height: 110px; padding: 9px 0; }
.tmp-chat__in:focus { outline: 0; }
.tmp-chat__go { flex-shrink: 0; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ink, #0F2029); color: #fff; cursor: pointer; display: grid; place-items: center; transition: opacity .15s, transform .15s; }
.tmp-chat__go:disabled { opacity: .3; cursor: default; }
.tmp-chat__go:not(:disabled):hover { transform: scale(1.06); }
.tmp-chat__err { margin: 0; padding: 10px 16px 14px; font-size: 13px; color: #8A2A1B; background: #FCEDEA; }
.tmp-chat__err[hidden] { display: none; }

@media (max-width: 600px) {
	.tmp-chat { right: 14px; bottom: 14px; left: 14px; align-items: flex-end; }
	.tmp-chat__panel { width: 100%; max-height: min(78vh, 560px); }
	.tmp-chat__label { display: none; }
	.tmp-chat__bubble { padding: 15px; border-radius: 50%; }
}
@media (prefers-reduced-motion: reduce) { .tmp-chat *, .tmp-chat__panel { animation: none !important; transition: none !important; } }
