.trds-chat { --trds-chat-blue: #003d82; --trds-chat-height: 50dvh; font-family: inherit; }
.trds-chat [hidden] { display: none !important; }
.trds-chat button, .trds-chat textarea { font: inherit; }
.trds-chat button { cursor: pointer; }
.trds-chat button:focus-visible, .trds-chat textarea:focus-visible { outline: 3px solid #e1b957; outline-offset: 2px; }
.trds-chat-launcher { position: fixed; top: 50%; top: 50dvh; left: 0; transform: translateY(-50%); box-sizing: border-box; width: 32px; min-height: 158px; padding: 12px 8px; border: 0; border-radius: 0 12px 12px 0; background: var(--trds-chat-blue); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: 5px 3px 20px #003d8230; z-index: 100002; }
.trds-chat-launcher svg { display: block; flex: 0 0 auto; }
.trds-chat-launcher-label { display: block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .02em; }
.trds-chat-launcher:hover { background: #0052b3; }
.trds-chat-badge { position: absolute; right: -5px; top: 6px; display: grid; place-items: center; box-sizing: border-box; width: 22px; min-width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #b93b37; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; animation: trds-chat-badge-nudge 5s ease-in-out infinite; }
@keyframes trds-chat-badge-nudge {
    0%, 12%, 100% { transform: translateX(0) rotate(0); }
    3%, 9% { transform: translateX(-2px) rotate(-12deg); }
    6% { transform: translateX(2px) rotate(12deg); }
}
.trds-chat-panel { position: fixed; right: 24px; bottom: 24px; width: 420px; max-width: calc(100vw - 48px); height: var(--trds-chat-height); max-height: 100vh; max-height: 100dvh; display: flex; flex-direction: column; background: #fff; color: #263746; border: 1px solid #e0e7ee; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 48px #0d23382b; z-index: 100003; transition: height .2s ease, bottom .2s ease; }
.trds-chat-panel.trds-chat-fullheight { bottom: 0; border-radius: 0; }
.trds-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--trds-chat-blue); color: #fff; flex: 0 0 auto; }
.trds-chat-header-title { min-width: 0; flex: 1 1 auto; }
.trds-chat-header h2 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.25; color: #fff; }
.trds-chat-status { margin: 3px 0 0; font-size: 12px; color: #d8e8fb; }
.trds-chat-faq-open { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 5px 9px; border: 1px solid #fff; border-radius: 20px; background: transparent; color: #fff; font-size: 12px !important; font-weight: 600 !important; line-height: 1.1; white-space: nowrap; }
.trds-chat-faq-open:hover { background: #ffffff20; }
.trds-chat-faq-icon { display: grid; place-items: center; width: 19px; height: 19px; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 700; line-height: 1; }
.trds-chat-close { flex: 0 0 44px; border: 0; background: transparent; color: #fff; width: 44px; height: 44px; padding: 0; font-size: 28px !important; line-height: 1; border-radius: 8px; }
.trds-chat-close:hover { background: #ffffff20; }
.trds-chat-faq { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; background: #fff; color: #263746; }
.trds-chat-faq-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; background: var(--trds-chat-blue); color: #fff; }
.trds-chat-faq-head h2 { margin: 0; color: #fff; font-size: 18px; line-height: 1.25; }
.trds-chat-faq-close { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 28px !important; line-height: 1; }
.trds-chat-faq-close:hover { background: #ffffff20; }
.trds-chat-faq-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 24px; }
.trds-chat-faq-content details { border-bottom: 1px solid #e0e7ee; }
.trds-chat-faq-content details:last-child { border-bottom: 0; }
.trds-chat-faq-content summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; color: var(--trds-chat-blue); font-size: 16px; font-weight: 700; line-height: 1.35; list-style: none; cursor: pointer; }
.trds-chat-faq-content .trds-chat-faq-security summary { color: #c62828; }
.trds-chat-faq-content summary::-webkit-details-marker { display: none; }
.trds-chat-faq-content summary::after { content: '+'; flex: none; font-size: 23px; font-weight: 400; line-height: 1; }
.trds-chat-faq-content details[open] summary::after { content: '−'; }
.trds-chat-faq-content summary:focus-visible { outline: 3px solid var(--trds-chat-blue); outline-offset: 2px; }
.trds-chat-faq-answer { padding: 0 28px 16px 0; }
.trds-chat-faq-content p { margin: 0 0 9px; font-size: 14px; line-height: 1.5; }
.trds-chat-faq-content p:last-child { margin-bottom: 0; }
.trds-chat-error { padding: 8px 14px; background: #fff3dd; color: #805d18; font-size: 12px; flex: 0 0 auto; }
.trds-chat-history { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px; background: #f6f8fb; scrollbar-width: thin; }
.trds-chat-list { display: flex; flex: 0 0 auto; flex-direction: column; gap: 10px; width: 100%; margin-top: auto; }
.trds-chat-message { max-width: 87%; border-radius: 13px 13px 13px 3px; padding: 10px 12px; background: #fff; border: 1px solid #e2e8ef; align-self: flex-start; box-sizing: border-box; }
.trds-chat-message-user { align-self: flex-end; border-radius: 13px 13px 3px 13px; background: #e7f0fc; border-color: #d5e3f5; }
.trds-chat-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; margin: 0; }
.trds-chat-greeting-note { margin-top: 18px; font-size: 12px; }
.trds-chat-meta { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 5px; color: #69798b; font-size: 10px; }
.trds-chat-author { font-size: 11px; font-weight: 600; color: var(--trds-chat-blue); margin: 0 0 5px; }
.trds-chat-typing { border-color: #d5e3f5; background: #f0f5fc; }
.trds-chat-typing .trds-chat-body { display: flex; align-items: center; gap: 6px; color: #536a85; }
.trds-chat-typing-dots { display: inline-flex; align-items: center; gap: 3px; height: 12px; }
.trds-chat-typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--trds-chat-blue); animation: trds-chat-typing-dot 1.2s ease-in-out infinite; }
.trds-chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.trds-chat-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes trds-chat-typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.trds-chat-contact-form { display: grid; gap: 10px; align-self: stretch; box-sizing: border-box; margin: 2px 0 4px; padding: 16px; border: 1px solid #cbdcf0; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px #0d23380d; }
.trds-chat-contact-title { margin: 0 0 2px; color: #263746; font-size: 14px; font-weight: 700; }
.trds-chat-contact-form label { display: grid; gap: 5px; color: #34465a; font-size: 12px; font-weight: 600; }
.trds-chat-contact-form input { box-sizing: border-box; width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cad5e0; border-radius: 9px; background: #fff; color: #263746; font: inherit; font-size: 14px; }
.trds-chat-contact-form input:focus-visible { outline: 2px solid var(--trds-chat-blue); outline-offset: 1px; }
.trds-chat-email-suggestions { overflow: hidden; border: 1px solid #e0d6d1; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px #2c18101f; }
.trds-chat-email-suggestions__option { padding: 5px 10px; color: #2c1810; font-size: 12px; font-weight: 400; line-height: 1; overflow-wrap: anywhere; cursor: pointer; }
.trds-chat-email-suggestions__option:hover, .trds-chat-email-suggestions__option[aria-selected="true"] { background: #eaf2fb; color: var(--trds-chat-blue); }
.trds-chat-contact-form button { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 9px; background: var(--trds-chat-blue); color: #fff; font: inherit; font-size: 14px; font-weight: 600; }
.trds-chat-contact-form button:hover:not(:disabled) { background: #0052b3; }
.trds-chat-contact-error { margin: 0; color: #a92d2d; font-size: 12px; line-height: 1.4; }
.trds-chat-body.trds-chat-greeting-typing::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: trds-chat-caret .8s steps(1) infinite; }
@keyframes trds-chat-caret { 50% { opacity: 0; } }
.trds-chat-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 12px 14px; margin: 0; flex: 0 0 auto; background: #fff; }
.trds-chat-photo-select { position: relative; display: grid; place-items: center; flex: 0 0 44px; box-sizing: border-box; width: 44px; height: 44px; border: 1px solid #cad5e0; border-radius: 9px; color: var(--trds-chat-blue); cursor: pointer; }
.trds-chat-photo-select:focus-within { outline: 3px solid #e1b957; }
.trds-chat-photo-icon { display: block; width: 23px; height: 23px; background: currentColor; -webkit-mask: url('paperclip.svg') center / contain no-repeat; mask: url('paperclip.svg') center / contain no-repeat; }
.trds-chat-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.trds-chat-photo-preview { display: flex; align-items: center; gap: 10px; flex: 1 0 100%; min-width: 0; box-sizing: border-box; padding: 7px; border: 1px solid #cad5e0; border-radius: 10px; background: #f6f8fb; }
.trds-chat-photo-preview-image { display: block; flex: 0 0 64px; width: 64px; height: 64px; border-radius: 6px; object-fit: cover; }
.trds-chat-photo-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.trds-chat-photo-remove { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #34465a; font-size: 22px !important; line-height: 1; }
.trds-chat-photo-remove:hover { background: #e1e9f2; }
.trds-chat-image-link { display: block; width: fit-content; max-width: 100%; border-radius: 8px; }
.trds-chat-image-link:focus-visible { outline: 3px solid #e1b957; outline-offset: 2px; }
.trds-chat-image { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; margin-top: 8px; border-radius: 8px; }
.trds-chat-image-viewer { box-sizing: border-box; width: min(960px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 42px 12px 12px; border: 0; border-radius: 12px; background: #172333; color: #fff; box-shadow: 0 18px 70px #0008; }
.trds-chat-image-viewer::backdrop { background: #101923d9; }
.trds-chat-image-viewer-close { position: absolute; top: 4px; right: 6px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #fff; font-size: 28px !important; line-height: 1; }
.trds-chat-image-viewer-close:hover { background: #ffffff2a; }
.trds-chat-image-viewer-image { display: block; max-width: 100%; max-height: calc(100dvh - 78px); width: auto; height: auto; margin: auto; object-fit: contain; }
.trds-chat-image-expired { margin: 8px 0 0; font-size: 12px; color: #69798b; }
.trds-chat-form textarea { min-width: 0; flex: 1; resize: none; box-sizing: border-box; height: 44px; min-height: 44px; max-height: 70px; overflow-y: auto; padding: 10px 11px; border: 1px solid #cad5e0; border-radius: 10px; color: #263746; background: #fff; font-size: 14px; line-height: 1.4; }
.trds-chat-send { box-sizing: border-box; width: 44px; height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 9px; background: var(--trds-chat-blue); color: #fff; }
.trds-chat-send-icon { display: block; width: 22px; height: 22px; flex: 0 0 22px; background: currentColor; -webkit-mask: url('paper-plane-tilt-fill.svg') center / contain no-repeat; mask: url('paper-plane-tilt-fill.svg') center / contain no-repeat; }
.trds-chat button:disabled { opacity: .5; cursor: default; }
.trds-chat-older { display: block; min-height: 44px; margin: 0 auto 12px; border: 0; background: transparent; color: #687b90; padding: 4px 0; font-size: 11px; text-decoration: underline; }
.trds-chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
    .trds-chat-launcher {
        top: auto;
        bottom: max(16px, env(safe-area-inset-bottom));
        left: max(16px, env(safe-area-inset-left));
        transform: none;
        width: 52px;
        height: 52px;
        min-height: 52px;
        padding: 0;
        border-radius: 50%;
        gap: 0;
    }
    .trds-chat-launcher svg { width: 26px; height: 26px; }
    .trds-chat-launcher-label { display: none; }
    .trds-chat-panel { top: var(--trds-chat-top, 0px); right: 0; bottom: auto; width: 100%; max-width: 100%; height: var(--trds-chat-height, 100dvh) !important; max-height: none; border-radius: 0; border: 0; transition: none; }
    .trds-chat-header { padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
    .trds-chat-header h2 { font-size: 17px; }
    .trds-chat-status { font-size: 11px; }
    .trds-chat-faq-open { gap: 5px; min-height: 44px; padding: 5px 6px; font-size: 11px !important; }
    .trds-chat-faq-open > span:last-child { order: -1; display: block; width: 58px; white-space: normal; text-align: center; line-height: 1.15; }
    .trds-chat-faq-icon { width: 18px; height: 18px; flex: 0 0 18px; font-size: 12px; }
    .trds-chat-close { flex-basis: 40px; width: 40px; height: 44px; }
    .trds-chat-faq-head { padding-top: max(16px, env(safe-area-inset-top)); }
    .trds-chat-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .trds-chat-panel { transition: none; } .trds-chat-body.trds-chat-greeting-typing::after { display: none; } .trds-chat-badge, .trds-chat-typing-dots span { animation: none; } .trds-chat * { scroll-behavior: auto !important; } }
