/* Tas website chat (tas-chat.js). Uses the site's tokens from styles.css. */
.tas-root { position: fixed; right: 18px; bottom: 18px; z-index: 900; font-family: inherit; }
.tas-launcher { position: relative; display: flex; align-items: flex-end; gap: 0; border: 0; padding: 0; cursor: pointer; font: inherit; background: none; }
.tas-figure { position: relative; width: 84px; height: 93px; display: block; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55)); }
.tas-figure img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* two frames of the raised hand: waves for ~2.4 s every 8 s */
/* only one frame is ever visible, so no second hand is left behind */
.tas-f2 { opacity: 0; animation: tas-wave 8s steps(1, end) 1s infinite; }
.tas-f1 { opacity: 1; animation: tas-wave-base 8s steps(1, end) 1s infinite; }
@keyframes tas-wave { 0%, 5%, 10%, 15%, 20%, 25% { opacity: 1; } 2.5%, 7.5%, 12.5%, 17.5%, 22.5%, 30%, 100% { opacity: 0; } }
@keyframes tas-wave-base { 0%, 5%, 10%, 15%, 20%, 25% { opacity: 0; } 2.5%, 7.5%, 12.5%, 17.5%, 22.5%, 30%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tas-f1, .tas-f2 { animation: none; } }
.tas-label { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: 0.78rem; font-weight: 800; color: #fff;
    padding: 0.2rem 0.7rem; border-radius: 999px; background: linear-gradient(135deg, #00f2fe, #8a2be2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.tas-launcher:hover .tas-figure { transform: translateY(-3px); transition: transform 0.2s ease; }
.tas-badge { position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ff4d6d; color: #fff;
    font-size: 0.75rem; font-weight: 800; display: grid; place-items: center; }
.tas-badge[hidden] { display: none; }
.tas-hello { position: absolute; right: 74px; bottom: 70px; display: flex; align-items: flex-start; width: 210px; background: #f8fafc; color: #0a0914;
    border-radius: 14px 14px 4px 14px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45); animation: tas-pop 0.35s ease-out; }
.tas-hello[hidden] { display: none; }
.tas-hello-text { border: 0; background: none; font: inherit; font-size: 0.86rem; font-weight: 600; text-align: left; line-height: 1.35; color: inherit; padding: 0.65rem 0.2rem 0.65rem 0.8rem; cursor: pointer; }
.tas-hello-x { border: 0; background: none; font-size: 1.1rem; color: #64748b; cursor: pointer; padding: 0.3rem 0.55rem; }
@keyframes tas-pop { from { opacity: 0; transform: translateY(8px) scale(0.95); } to { opacity: 1; transform: none; } }
.tas-open .tas-launcher { display: none; }
.tas-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 100px)); display: flex; flex-direction: column;
    background: #120f24; border: 1px solid rgba(168, 85, 247, 0.35); border-radius: 18px; overflow: hidden; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6); color: #f8fafc; }
.tas-panel[hidden] { display: none; }
.tas-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; border-bottom: 1px solid rgba(168, 85, 247, 0.2); background: rgba(48, 43, 99, 0.35); }
.tas-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #00f2fe, #a855f7); border: 2px solid rgba(0, 242, 254, 0.6); object-fit: cover; flex: none; }
.tas-row { display: flex; align-items: flex-end; gap: 0.4rem; align-self: flex-start; max-width: 92%; }
.tas-row .tas-msg { max-width: none; }
.tas-mini { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #00f2fe, #a855f7); flex: none; }
.tas-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tas-status { font-size: 0.78rem; color: #8b99ac; }
.tas-icon-btn { background: none; border: 0; color: #8b99ac; font-size: 1.05rem; cursor: pointer; padding: 0.35rem 0.5rem; border-radius: 8px; }
.tas-icon-btn:hover { color: #f8fafc; background: rgba(255, 255, 255, 0.08); }
.tas-min { margin-left: auto; }
.tas-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.tas-msg { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 14px; font-size: 0.94rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.tas-msg p { margin: 0; }
.tas-tas, .tas-human { align-self: flex-start; background: rgba(48, 43, 99, 0.55); border: 1px solid rgba(168, 85, 247, 0.2); border-bottom-left-radius: 4px; }
.tas-human { border-color: rgba(34, 197, 94, 0.5); }
.tas-user { align-self: flex-end; background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(138, 43, 226, 0.35)); border-bottom-right-radius: 4px; }
.tas-by { display: block; font-size: 0.72rem; font-weight: 700; color: #00f2fe; margin-bottom: 0.15rem; }
.tas-human .tas-by { color: #4ade80; }
.tas-typing p { animation: tas-pulse 1s infinite; }
@keyframes tas-pulse { 50% { opacity: 0.35; } }
.tas-form { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid rgba(168, 85, 247, 0.2); }
.tas-input { flex: 1; resize: none; font: inherit; font-size: 16px; color: #f8fafc; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(168, 85, 247, 0.3); border-radius: 12px; padding: 0.6rem 0.75rem; max-height: 120px; }
.tas-send { border: 0; border-radius: 12px; width: 44px; cursor: pointer; color: #fff; background: linear-gradient(135deg, #00f2fe, #8a2be2); }
.tas-send:disabled { opacity: 0.5; cursor: default; }
.tas-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.tas-lead { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.75rem; border: 1px solid rgba(0, 242, 254, 0.35); border-radius: 14px; background: rgba(48, 43, 99, 0.45); flex: none; }
.tas-lead[hidden] { display: none; }
.tas-lead-title { font-size: 0.88rem; font-weight: 600; margin: 0; }
.tas-lead input, .tas-lead textarea { font: inherit; font-size: 16px; color: #f8fafc; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(168, 85, 247, 0.3); border-radius: 10px; padding: 0.5rem 0.65rem; resize: vertical; }
.tas-lead-row { display: flex; justify-content: space-between; align-items: center; }
.tas-lead-send { border: 0; border-radius: 10px; padding: 0.55rem 0.9rem; font: inherit; font-weight: 700; color: #fff; cursor: pointer; background: linear-gradient(135deg, #00f2fe, #8a2be2); }
.tas-lead-err { color: #ff8fa3; font-size: 0.82rem; margin: 0; min-height: 0; }
.tas-link { background: none; border: 0; padding: 0; font: inherit; color: #00f2fe; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tas-foot { font-size: 0.74rem; color: #8b99ac; padding: 0 0.8rem 0.6rem; }
.tas-foot a { color: #8b99ac; text-decoration: underline; }
@media (max-width: 480px) {
    .tas-root { right: 12px; bottom: 12px; }
    .tas-open.tas-root { left: 12px; }
    .tas-panel { width: 100%; height: calc(100vh - 90px); }
}
