/* ===================== THEME ===================== */

.tradebizz-chatbot-root {
--tb-ink: #172b49;
--tb-muted: #687b96;
--tb-blue: #1769d2;
--tb-blue-dark: #1054b0;
--tb-surface: #edf3fb;
--tb-white: #ffffff;
--tb-border: #dce5f1;
--tb-shadow:
7px 7px 16px rgba(149, 166, 191, .25),
-7px -7px 16px rgba(255, 255, 255, .95);
--tb-shadow-small:
3px 3px 7px rgba(149, 166, 191, .24),
-3px -3px 7px rgba(255, 255, 255, .9);
--tb-shadow-inset:
inset 3px 3px 7px rgba(151, 168, 191, .19),
inset -3px -3px 7px rgba(255, 255, 255, .95);

font-family: "Segoe UI", Roboto, Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
color: var(--tb-ink);
}

.tradebizz-chatbot-root *,
.tradebizz-chatbot-root *::before,
.tradebizz-chatbot-root *::after {
box-sizing: border-box;
}

.tradebizz-chatbot-root button,
.tradebizz-chatbot-root input,
.tradebizz-chatbot-root select,
.tradebizz-chatbot-root textarea {
font: inherit;
}

.tradebizz-chatbot-root button {
-webkit-tap-highlight-color: transparent;
}

.tradebizz-chatbot-root button:focus-visible,
.tradebizz-chatbot-root input:focus-visible,
.tradebizz-chatbot-root select:focus-visible,
.tradebizz-chatbot-root textarea:focus-visible {
outline: 3px solid rgba(23, 105, 210, .35);
outline-offset: 3px;
}

/* ===================== LAUNCHER ===================== */

.tradebizz-chatbot-launcher {
position: fixed;
right: -1px;
bottom: 100px;
z-index: 9999999;
display: flex;
align-items: center;
gap: 12px;
padding: 8px 10px 8px 10px;
border-radius: 12px 0 0 12px;
color: #fff;
background: linear-gradient(145deg, #1b385f, #102442);
cursor: pointer;
pointer-events: auto !important;
transition: transform .22s ease, box-shadow .22s ease;
}

.tradebizz-chatbot-launcher:hover {
transform: translateY(-3px);
box-shadow:
9px 11px 22px rgba(15, 35, 66, .28),
-4px -4px 12px rgba(255,255,255,.8);
}

.tradebizz-chatbot-launcher-icon-wrap {
position: relative;
display: grid;
place-items: center;
flex: 0 0 43px;
width: 43px;
height: 43px;
border-radius: 50%;
background: linear-gradient(145deg, #2587ed, #1056b9);
box-shadow:
3px 3px 7px rgba(0,0,0,.22),
inset 1px 1px 3px rgba(255,255,255,.35);
}

.tradebizz-chatbot-launcher-icon {
width: 22px;
height: 22px;
fill: #fff;
}

.tradebizz-chatbot-badge {
position: absolute;
top: 0;
right: 0;
width: 12px;
height: 12px;
border: 2px solid #163253;
border-radius: 50%;
background: #36cf85;
}

.tradebizz-chatbot-launcher-label {
font-size: 14px;
font-weight: 650;
white-space: nowrap;
}

/* ===================== CHAT WINDOW ===================== */

.tradebizz-chatbot-window {
position: fixed;
right: 24px;
bottom: 110px;
z-index: 99999;
display: none;
flex-direction: column;
width: 410px;
height: min(680px, calc(100dvh - 120px));
max-width: calc(100vw - 32px);
overflow: hidden;
/*border: 1px solid rgba(255,255,255,.95);*/
border-radius: 25px;
/*background: var(--tb-surface);*/
/*box-shadow:*/
/*15px 18px 45px rgba(25, 46, 78, .20),*/
/*-5px -5px 18px rgba(255,255,255,.85),*/
/*inset 1px 1px 2px #fff;*/
opacity: 0;
visibility: hidden;
pointer-events: none !important;
transform: translateY(16px) scale(.97);
transform-origin: bottom right;
transition: opacity .24s ease, transform .24s ease, visibility .24s;
}

.tradebizz-chatbot-window.tradebizz-chatbot-active {
display: flex !important;
opacity: 1 !important;
visibility: visible !important;
pointer-events: auto !important;
transform: translateY(0) scale(1);
}

/* ===================== HEADER ===================== */

.tradebizz-chatbot-header {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
min-height: 94px;
padding: 15px 18px;
flex-shrink: 0;
color: #fff;
background: linear-gradient(135deg, #1a1a1a, #1a1a1a);
box-shadow: 0 5px 14px rgba(16,39,71,.18);
}

.tradebizz-chatbot-brand-wrap {
display: flex;
align-items: center;
min-width: 0;
}

.tradebizz-chatbot-logo {
display: block;
width: 150px;
height: 61px;
max-width: 100%;
object-fit: contain;
padding: 8px 12px;
border: 1px solid rgba(255,255,255,.85);
border-radius: 11px;
background: #fff;
box-shadow:
3px 4px 9px rgba(0,0,0,.18),
inset 1px 1px 2px #fff;
}

.tradebizz-chatbot-brand-info {
display: flex;
flex-direction: column;
gap: 3px;
}

.tradebizz-chatbot-title-row {
display: flex;
align-items: center;
gap: 7px;
}

.tradebizz-chatbot-title {
color: #fff;
font-size: 16px;
font-weight: 700;
}

.tradebizz-chatbot-status-dot {
width: 8px;
height: 8px;
flex: 0 0 8px;
border-radius: 50%;
background: #39d98a;
box-shadow: 0 0 0 4px rgba(57,217,138,.13);
}

.tradebizz-chatbot-subtitle {
color: #c1d2e8;
font-size: 11px;
}

.tradebizz-chatbot-header-actions {
display: flex;
align-items: center;
gap: 6px;
}

.tradebizz-chatbot-header-btn {
display: grid;
place-items: center;
width: 36px;
height: 36px;
flex-shrink: 0;
border: 1px solid rgba(255,255,255,.16);
border-radius: 11px;
color: #fff;
background: rgba(255,255,255,.09);
cursor: pointer;
transition: background .2s, transform .2s;
}

.tradebizz-chatbot-header-btn:hover {
background: rgba(255,255,255,.2);
transform: translateY(-1px);
}

/* ===================== TABS ===================== */

.tradebizz-chatbot-nav {
display: flex;
gap: 7px;
padding: 10px 13px;
border-bottom: 1px solid #dce5f0;
background: #eaf0f8;
flex-shrink: 0;
}

.tradebizz-chatbot-tab {
flex: 1;
min-width: 0;
padding: 10px 7px;
border: 1px solid transparent;
border-radius: 11px;
color: #657994;
background: transparent;
font-size: 13px;
font-weight: 650;
cursor: pointer;
transition: .2s ease;
}

.tradebizz-chatbot-tab:hover {
color: var(--tb-blue);
}

.tradebizz-chatbot-tab.tradebizz-chatbot-tab-active {
color: #000;
border-color: #fff;
background: #f5f8fd;
box-shadow: var(--tb-shadow-small);
}

/* ===================== BODY / VIEWS ===================== */

.tradebizz-chatbot-body {
position: relative;
display: flex;
flex: 1;
min-height: 0;
overflow: hidden;
background: var(--tb-surface);
}

.tradebizz-chatbot-view {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
min-height: 0;
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity .2s ease, visibility .2s;
}

.tradebizz-chatbot-view.tradebizz-chatbot-view-active {
opacity: 1;
visibility: visible;
pointer-events: auto;
}

/* ===================== CHAT MESSAGES ===================== */

.tradebizz-chatbot-messages {
display: flex;
flex: 1;
min-height: 0;
flex-direction: column;
gap: 15px;
padding: 19px 15px;
overflow-y: auto;
overscroll-behavior: contain;
scroll-behavior: smooth;
}

.tradebizz-chatbot-messages::-webkit-scrollbar,
.tradebizz-chatbot-form-scroll::-webkit-scrollbar {
width: 5px;
}

.tradebizz-chatbot-messages::-webkit-scrollbar-thumb,
.tradebizz-chatbot-form-scroll::-webkit-scrollbar-thumb {
border-radius: 20px;
background: #c6d3e4;
}

.tradebizz-chatbot-message {
display: flex;
flex-direction: column;
max-width: 88%;
animation: tradebizzChatFadeIn .23s ease both;
}

.tradebizz-chatbot-message-bot {
align-self: flex-start;
}

.tradebizz-chatbot-message-user {
align-self: flex-end;
}

.tradebizz-chatbot-bubble {
padding: 12px 14px;
border-radius: 16px;
font-size: 13px;
line-height: 1.6;
overflow-wrap: anywhere;
}

.tradebizz-chatbot-message-bot .tradebizz-chatbot-bubble {
color: #2b405d;
border: 1px solid rgba(255,255,255,.95);
border-top-left-radius: 5px;
background: linear-gradient(145deg, #fff, #f2f6fc);
box-shadow:
4px 4px 10px rgba(150,166,189,.22),
-3px -3px 9px rgba(255,255,255,.95);
}

.tradebizz-chatbot-message-user .tradebizz-chatbot-bubble {
color: #fff;
border: 1px solid rgba(255,255,255,.16);
border-top-right-radius: 5px;
background: linear-gradient(145deg, #2480e7, #145ab8);
box-shadow:
4px 4px 9px rgba(24,94,176,.2),
inset 1px 1px 2px rgba(255,255,255,.18);
}

.tradebizz-chatbot-time {
margin-top: 4px;
padding: 0 4px;
color: #8191a8;
font-size: 10px;
}

/* ===================== QUICK ACTIONS ===================== */

.tradebizz-chatbot-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 13px 14px 15px;
border-top: 1px solid #dce5f0;
background: #eef3fa;
flex-shrink: 0;
}

.tradebizz-chatbot-action-btn {
max-width: 100%;
padding: 8px 12px;
border: 1px solid #fff;
border-radius: 22px;
color: #304969;
background: #edf3fb;
box-shadow: var(--tb-shadow-small);
font-size: 11.5px;
font-weight: 600;
cursor: pointer;
transition: transform .18s, box-shadow .18s, color .18s, background .18s;
}

.tradebizz-chatbot-action-btn:hover {
color: var(--tb-blue);
transform: translateY(-1px);
}

.tradebizz-chatbot-action-btn:active {
box-shadow: var(--tb-shadow-inset);
transform: translateY(0);
}

.tradebizz-chatbot-action-btn-highlight {
color: #fff;
border-color: #1a1a1a;
background: linear-gradient(135deg, #1a1a1a, #1a1a1a);
box-shadow:
3px 4px 9px rgba(21,91,184,.2),
inset 1px 1px 2px rgba(255,255,255,.25);
}

.tradebizz-chatbot-action-btn-highlight:hover {
color: #fff;
background: linear-gradient(145deg, #1974d7, #104e9f);
}

/* ===================== QUOTE FORM ===================== */

.tradebizz-chatbot-form-scroll {
flex: 1;
min-height: 0;
padding: 19px 18px 22px;
overflow-y: auto;
overscroll-behavior: contain;
}

.tradebizz-chatbot-form-intro {
margin-bottom: 17px;
color: #637792;
font-size: 12.5px;
line-height: 1.65;
}

.tradebizz-chatbot-field {
margin-bottom: 15px;
}

.tradebizz-chatbot-label {
display: block;
margin-bottom: 6px;
color: #344b69;
font-size: 12px;
font-weight: 700;
}

.tradebizz-chatbot-label-req::after {
content: " *";
color: #dc4545;
}

.tradebizz-chatbot-input,
.tradebizz-chatbot-select,
.tradebizz-chatbot-textarea {
display: block;
width: 100%;
min-width: 0;
padding: 11px 13px;
border: 1px solid #dce6f3;
border-radius: 11px;
outline: none;
color: #203854;
background: #edf3fb;
box-shadow: var(--tb-shadow-inset);
font-size: 13px;
transition: border-color .2s, box-shadow .2s, background .2s;
}

.tradebizz-chatbot-input::placeholder,
.tradebizz-chatbot-textarea::placeholder {
color: #91a0b5;
}

.tradebizz-chatbot-input:focus,
.tradebizz-chatbot-select:focus,
.tradebizz-chatbot-textarea:focus {
border-color: #77a9ed;
background: #f4f8fe;
box-shadow:
inset 2px 2px 5px rgba(151,168,191,.12),
0 0 0 3px rgba(23,105,210,.09);
}

.tradebizz-chatbot-textarea {
min-height: 84px;
resize: vertical;
}

.tradebizz-chatbot-input.tradebizz-chatbot-invalid,
.tradebizz-chatbot-select.tradebizz-chatbot-invalid,
.tradebizz-chatbot-textarea.tradebizz-chatbot-invalid {
border-color: #e35b62;
}

.tradebizz-chatbot-error-msg {
display: none;
margin-top: 5px;
color: #d73542;
font-size: 11px;
}

.tradebizz-chatbot-turnstile-container {
display: flex;
justify-content: center;
min-height: 65px;
margin: 15px 0;
overflow: hidden;
}

.tradebizz-chatbot-submit-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 9px;
width: 100%;
min-height: 47px;
padding: 12px 16px;
border: 1px solid rgba(255,255,255,.35);
border-radius: 12px;
color: #fff;
background: linear-gradient(135deg, #1a1a1a, #1a1a1a);
box-shadow:
5px 6px 12px rgba(22,92,180,.20),
inset 1px 1px 2px rgba(255,255,255,.25);
font-size: 13px;
font-weight: 700;
cursor: pointer;
transition: transform .2s, box-shadow .2s, background .2s;
}

.tradebizz-chatbot-submit-btn:hover {
background: linear-gradient(145deg, #1971d1, #104e9f);
transform: translateY(-1px);
}

.tradebizz-chatbot-submit-btn:active {
transform: translateY(0);
box-shadow: inset 3px 3px 7px rgba(0,0,0,.17);
}

.tradebizz-chatbot-submit-btn:disabled {
opacity: .65;
cursor: wait;
transform: none;
}

.tradebizz-chatbot-privacy {
margin-top: 12px;
color: #788ba5;
font-size: 10.5px;
text-align: center;
line-height: 1.6;
}

.tradebizz-chatbot-status-box {
display: none;
margin-bottom: 15px;
padding: 12px 14px;
border-radius: 11px;
font-size: 12.5px;
line-height: 1.55;
overflow-wrap: anywhere;
}

.tradebizz-chatbot-status-box.tradebizz-chatbot-status-error {
display: block;
color: #a32831;
border: 1px solid #f0c4c7;
background: #fff0f1;
box-shadow: var(--tb-shadow-small);
}

.tradebizz-chatbot-root #tradebizz-chatbot-status.tradebizz-chatbot-status-success {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
padding: 14px;
margin-bottom: 15px;
border: 1px solid #a8dfbd;
border-radius: 11px;
color: #17643a;
background: #edfff3;
box-shadow:
3px 3px 8px rgba(80,145,101,.10),
-3px -3px 8px #fff;
font-size: 13px;
font-weight: 700;
text-align: center;
}

/* ===================== SPINNER ===================== */

.tradebizz-chatbot-spinner {
display: none;
width: 16px;
height: 16px;
flex: 0 0 16px;
border: 2px solid rgba(255,255,255,.8);
border-top-color: transparent;
border-radius: 50%;
animation: tradebizzSpin .75s linear infinite;
}

@keyframes tradebizzSpin {
to { transform: rotate(360deg); }
}

@keyframes tradebizzChatFadeIn {
from { opacity: 0; transform: translateY(5px); }
to { opacity: 1; transform: translateY(0); }
}

/* ===================== TABLET ===================== */

@media (max-width: 768px) {
.tradebizz-chatbot-window {
right: 16px;
bottom: 86px;
width: 390px;
height: min(680px, calc(100dvh - 105px));
max-width: calc(100vw - 32px);
}

.tradebizz-chatbot-launcher {
right: 16px;
bottom: 16px;
}
}

/* ===================== MOBILE ===================== */

@media (max-width: 480px) {
.tradebizz-chatbot-window {
position: fixed;
right: 8px;
bottom: 76px;
left: 8px;
width: auto;
max-width: none;
height: min(690px, calc(100dvh - 88px));
border-radius: 20px;
transform-origin: bottom center;
}

.tradebizz-chatbot-header {
min-height: 78px;
padding: 11px 12px;
gap: 8px;
}

.tradebizz-chatbot-logo {
width: 125px;
height: 52px;
padding: 7px;
}

.tradebizz-chatbot-header-btn {
width: 34px;
height: 34px;
}

.tradebizz-chatbot-nav {
padding: 8px 10px;
}

.tradebizz-chatbot-tab {
padding: 9px 5px;
font-size: 12px;
}

.tradebizz-chatbot-messages {
padding: 15px 12px;
gap: 12px;
}

.tradebizz-chatbot-actions {
gap: 7px;
padding: 11px 10px 12px;
}

.tradebizz-chatbot-action-btn {
padding: 8px 10px;
font-size: 11px;
}

.tradebizz-chatbot-form-scroll {
padding: 15px 13px 20px;
}

.tradebizz-chatbot-field {
margin-bottom: 13px;
}

.tradebizz-chatbot-launcher {
right: 0px;
bottom: 50px;
gap: 9px;
padding: 5px 5px 5px 5px;
}

.tradebizz-chatbot-launcher-icon-wrap {
width: 26px;
height: 26px;
flex-basis: 26px;
}

.tradebizz-chatbot-launcher-icon {
width: 16px;
height: 16px;
fill: #fff;
}
}

@media (max-width: 350px) {
.tradebizz-chatbot-logo {
width: 105px;
height: 46px;
}

.tradebizz-chatbot-header {
padding: 9px;
}

.tradebizz-chatbot-actions {
gap: 6px;
}

.tradebizz-chatbot-action-btn {
padding: 7px 8px;
font-size: 10px;
}
}

/* Short screens / landscape */
@media (max-height: 520px) and (min-width: 481px) {
.tradebizz-chatbot-window {
bottom: 12px;
height: calc(100dvh - 24px);
}
}

@media (prefers-reduced-motion: reduce) {
.tradebizz-chatbot-root *,
.tradebizz-chatbot-root *::before,
.tradebizz-chatbot-root *::after {
animation-duration: .01ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
transition-duration: .01ms !important;
}
}

/* =========================================
TRADEBIZZ CHATBOT - FINAL LAYERING FIX
========================================= */

/* Root overlay - transparent to clicks */
html body > .tradebizz-chatbot-root {
position: fixed !important;
inset: 0 !important;
width: 100% !important;
height: 100% !important;
z-index: 2147483647 !important;
overflow: visible !important;
pointer-events: none !important;
transform: none !important;
filter: none !important;
isolation: auto !important;
}

/* Chat window - DEFAULT CLOSED STATE */
html body > .tradebizz-chatbot-root #tradebizz-chatbot-window {
position: fixed !important;
top: auto !important;
right: 24px !important;
bottom: 110px !important;
left: auto !important;

width: 410px !important;
max-width: calc(100vw - 32px) !important;
max-height: calc(100dvh - 130px) !important;

z-index: 2147483647 !important;
margin: 0 !important;
box-sizing: border-box !important;

/* HARD HIDE TO ALLOW CLICKS UNDERNEATH WHEN CLOSED */
display: none !important;
visibility: hidden !important;
pointer-events: none !important;
}

/* Chat window - ACTIVE / OPEN STATE */
html body > .tradebizz-chatbot-root #tradebizz-chatbot-window.tradebizz-chatbot-active {
display: flex !important;
opacity: 1 !important;
visibility: visible !important;
pointer-events: auto !important;
}

/* Launcher Button */
html body > .tradebizz-chatbot-root .tradebizz-chatbot-launcher {
position: fixed !important;
top: auto !important;
right: 0 !important;
bottom: 100px !important;
left: auto !important;
z-index: 2147483647 !important;
pointer-events: auto !important;
}

/* Tablet and mobile overrides */
@media (max-width: 768px) {
html body > .tradebizz-chatbot-root #tradebizz-chatbot-window {
right: 16px !important;
bottom: 86px !important;
width: 390px !important;
max-width: calc(100vw - 32px) !important;
}
}

@media (max-width: 480px) {
html body > .tradebizz-chatbot-root #tradebizz-chatbot-window {
right: 8px !important;
bottom: 76px !important;
left: 8px !important;
width: auto !important;
max-width: none !important;
max-height: calc(100dvh - 88px) !important;
}

html body > .tradebizz-chatbot-root .tradebizz-chatbot-launcher {
right: 0 !important;
bottom: 50px !important;
}
}