﻿.tn-assistant { position: fixed; bottom: 20px; right: 20px; z-index: 10010; font-family: 'Inter', sans-serif; color: #071b41; }
.loader-active .tn-assistant { visibility: hidden; }
.tn-assistant *, .tn-assistant *::before, .tn-assistant *::after { box-sizing: border-box; }
.tn-assistant button, .tn-assistant textarea { font: inherit; }
.tn-assistant button { cursor: pointer; }
.tn-assistant [hidden] { display: none !important; }
.tn-assistant button:focus-visible, .tn-assistant a:focus-visible { outline: 3px solid #44bc8d; outline-offset: 4px; }
.tn-launcher { position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #6ee7b740; border-radius: 17px; color: #fff; background: radial-gradient(circle at 20% 10%, #25645b, #0d343e 40%, #071b41 85%); box-shadow: 0 8px 28px #071b4138, inset 0 1px 0 #ffffff30; isolation: isolate; transition: transform .3s, border-radius .3s; }
.tn-launcher::before { content: ''; position: absolute; inset: -3px; z-index: -1; border: 1px solid #08744326; border-radius: 20px; animation: tn-halo 4s ease-in-out infinite; pointer-events: none; }
.tn-launcher:hover { transform: translateY(-2px); border-radius: 18px; }
.tn-launcher-core { width: 28px; height: 28px; color: #e1fff0; filter: drop-shadow(0 0 8px #68e5b8a0); animation: tn-spark 4s ease-in-out infinite; transition: opacity .2s, transform .3s; }
.tn-launcher-core svg { width: 100%; height: 100%; }
.tn-launcher-close { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; line-height: 1; opacity: 0; pointer-events: none; transform: rotate(-60deg); transition: opacity .2s, transform .3s; }
.tn-launcher-close svg { display: block; width: 24px; height: 24px; }
.tn-launcher-caption { position: absolute; right: calc(100% + 14px); padding: 9px 13px; border-radius: 10px; background: #fff; border: 1px solid #e1e9e5; color: #071b41; box-shadow: 0 4px 18px #071b4110; white-space: nowrap; font-size: 12px; font-weight: 600; opacity: 0; transform: translateX(5px); pointer-events: none; transition: opacity .2s, transform .2s; }
.tn-launcher:hover .tn-launcher-caption, .tn-launcher:focus-visible .tn-launcher-caption { opacity: 1; transform: translateX(0); }
.tn-is-open .tn-launcher-core { opacity: 0; }
.tn-is-open .tn-launcher-close { opacity: 1; transform: rotate(0); }
.tn-is-open .tn-launcher-caption { display: none; }
.tn-chat { position: fixed; bottom: 80px; right: 20px; width: 328px; height: min(440px, calc(var(--tn-visible-height, 100dvh) - 100px)); display: flex; flex-direction: column; background: #fff; border: 1px solid #dce5e2; border-radius: 16px; box-shadow: 0 12px 40px #071b4120, 0 2px 8px #071b410a; overflow: hidden; animation: tn-panel .28s ease-out; transform-origin: bottom right; }
.tn-chat-header { position: relative; display: flex; gap: 10px; align-items: center; padding: 13px 14px; flex-shrink: 0; color: #fff; background: radial-gradient(ellipse at 0 0, #1d5750, #0c2b3d 65%, #071b41); }
.tn-header-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border: 1px solid #ffffff26; border-radius: 10px; color: #a7f3cf; background: #ffffff08; }
.tn-header-icon svg { width: 23px; height: 23px; }
.tn-chat-eyebrow { font-size: 7px; font-weight: 600; letter-spacing: 1.4px; color: #9bc9ba; }
.tn-header-name { flex: 1; min-width: 0; }
.tn-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.tn-chat-header h2 { font-family: inherit; font-size: 12px; font-weight: 600; color: #fff; line-height: 1.4; letter-spacing: -.3px; margin: 0; }
.tn-icon-button { display: grid; place-items: center; align-self: center; flex: 0 0 30px; margin: 0; width: 30px; height: 30px; padding: 0; border: 1px solid #ffffff18; border-radius: 7px; color: #d9e8e3; background: #ffffff0d; line-height: 1; box-shadow: none; transition: color .15s ease; }
.tn-icon-button svg { display: block; width: 18px; height: 18px; pointer-events: none; }
.tn-icon-button:hover, .tn-icon-button:active { background: #ffffff18; color: #fff; transform: none; box-shadow: none; }
.tn-chat-scroll { flex: 1; min-height: 0; padding: 17px 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; overflow-y: auto; background: linear-gradient(160deg, #f0f7f3, #fbfcfb 40%, #fff); scrollbar-width: thin; scrollbar-color: #cbd9d2 transparent; }
.tn-intro-kicker { font-size: 8px; letter-spacing: 1.6px; color: #087443; font-weight: 700; }
.tn-chat-intro h3 { font-family: inherit; margin: 0 0 7px; font-size: 18px; line-height: 1.3; color: #071b41; font-weight: 600; letter-spacing: -.4px; }
.tn-chat-intro p { font-size: 12px; line-height: 1.8; color: #68798a; margin: 0 0 15px; max-width: 270px; }
.tn-suggestions { display: flex; flex-wrap: wrap; gap: 7px; }
.tn-suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 8px 10px; text-align: left; background: #ffffffbf; border: 1px solid #dfe8e3; border-radius: 10px; font-size: 11px; font-weight: 500; color: #34485a; transition: border-color .2s, transform .2s; }
.tn-suggestions button span { color: #087443; font-size: 14px; }
.tn-suggestions button:hover { border-color: #7fc1a0; transform: translateX(2px); }
.tn-has-messages .tn-chat-intro, .tn-has-messages .tn-suggestions { display: none; }
.tn-messages { display: flex; flex-direction: column; gap: 10px; }
.tn-message { max-width: 91%; padding: 9px 11px; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; animation: tn-message .22s ease-out; }
.tn-message-user { align-self: flex-end; color: #fff; background: #0d4e3a; border-radius: 15px 15px 4px 15px; }
.tn-message-assistant { align-self: flex-start; color: #34485a; background: #fff; border: 1px solid #e0e8e3; border-radius: 4px 15px 15px 15px; box-shadow: 0 2px 5px #071b4104; }
.tn-message a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.tn-typing { display: flex; align-self: flex-start; gap: 4px; padding: 16px; background: #edf4ef; border-radius: 4px 14px 14px 14px; }
.tn-typing span { width: 5px; height: 5px; border-radius: 50%; background: #4a9673; animation: tn-typing 1.2s ease-in-out infinite; }
.tn-typing span:nth-child(2) { animation-delay: .15s; }
.tn-typing span:nth-child(3) { animation-delay: .3s; }
.tn-chat-form { display: flex; align-items: flex-end; flex-shrink: 0; gap: 8px; margin: 0 10px 10px; padding: 5px 5px 5px 11px; border: 1px solid #dce6df; border-radius: 10px; background: #f8faf9; }
.tn-chat-form:focus-within { border-color: #5caa83; box-shadow: 0 0 0 3px #08744309; }
.tn-chat-form textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; color: #071b41; font-size: 12px; line-height: 20px; height: 36px; padding: 8px 0; }
.tn-chat-form textarea:focus, .tn-chat-form textarea:focus-visible { outline: none !important; outline-offset: 0 !important; box-shadow: none !important; border: none !important; }
.tn-chat-form textarea::placeholder { color: #7b8c85; }
.tn-send { flex: 0 0 34px; height: 34px; padding: 8px; border: 0; border-radius: 10px; background: #087443; color: #fff; transition: background .2s; }
.tn-send svg { width: 20px; height: 20px; display: block; }
.tn-send:hover { background: #065c35; }
.tn-assistant button:disabled { opacity: .4; cursor: default; }
.tn-chat-error { padding: 12px; margin-top: 14px; border-radius: 10px; background: #fff4e8; color: #805728; font-size: 11px; line-height: 1.7; }
.tn-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes tn-halo { 0%, 100% { opacity: .4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes tn-spark { 0%, 100% { transform: scale(.94) rotate(-5deg); } 50% { transform: scale(1.06) rotate(5deg); } }
@keyframes tn-panel { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes tn-message { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes tn-typing { 0%, 70%, 100% { transform: translateY(0); opacity: .4; } 35% { transform: translateY(-4px); opacity: 1; } }
@media (max-width: 600px) {
    .tn-assistant { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
    .tn-launcher { width: 46px; height: 46px; border-radius: 16px; }
    .tn-launcher-caption { display: none; }
    .tn-chat {
        position: fixed;
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(72px + env(safe-area-inset-bottom));
        width: auto;
        max-width: 340px;
        margin-left: auto;
        height: min(420px, calc(var(--tn-visible-height, 100dvh) - 92px - env(safe-area-inset-bottom)));
        border-radius: 14px;
    }
    .tn-chat-form textarea { font-size: 16px; }
    .tn-chat-form textarea::placeholder { font-size: 13px; }
    .tn-header-actions .tn-icon-button { width: 36px; height: 36px; flex-basis: 36px; }
    .tn-chat-header { gap: 8px; padding: 12px; }
    .tn-header-icon { flex-basis: 28px; height: 28px; }
    .tn-message { max-width: 94%; }
    .tn-keyboard-open .tn-launcher { visibility: hidden; }
    .tn-keyboard-open .tn-chat {
        bottom: calc(var(--tn-keyboard-offset, 0px) + 8px);
        height: min(420px, calc(var(--tn-visible-height, 100dvh) - 20px));
    }
}
@media (max-height: 500px) {
    .tn-chat { bottom: 12px; height: calc(var(--tn-visible-height, 100dvh) - 24px); }
    .tn-is-open .tn-launcher { visibility: hidden; }
    .tn-chat-intro p { margin-bottom: 10px; }
    .tn-chat-scroll { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .tn-assistant *, .tn-assistant *::before, .tn-assistant *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
