.upc-chatbot, .upc-chatbot * { box-sizing: border-box; font-family: Arial, sans-serif !important; }
.upc-chatbot-instance { --upc-primary: #111827; --upc-accent: #9ca3af; --upc-launcher-bg: #111827; --upc-launcher-text: #ffffff; --upc-window-width: 380px; --upc-window-height: 600px; --upc-title-font-size: 18px; --upc-message-font-size: 14px; --upc-launcher-font-size: 24px; --upc-button-padding: 20px; --upc-button-radius: 10px; }
.upc-chatbot-shell { width: var(--upc-window-width); height: var(--upc-window-height); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); background: #fff; border: 1px solid #d9dee5; border-radius: 18px; box-shadow: 0 12px 40px rgba(17,24,39,.18); overflow: hidden; display:flex; flex-direction:column; }
.upc-chatbot-header { padding: 14px 16px; font-weight: 700; background: var(--upc-primary); color: #fff; font-size: var(--upc-title-font-size); }

.upc-chatbot-tabs { display:flex; gap:0; border-bottom:1px solid #e5e7eb; background:#fff; }
.upc-chatbot-tab { flex:1 1 0; border:0; background:#f8fafc; padding:10px 12px; cursor:pointer; font-size:var(--upc-message-font-size); font-weight:600; color:#334155; }
.upc-chatbot-tab.is-active { background:#fff; color:var(--upc-primary); box-shadow: inset 0 -2px 0 var(--upc-primary); }
.upc-chatbot-view { display:none; flex:1 1 auto; min-height:0; }
.upc-chatbot-view.is-active { display:flex; flex-direction:column; }
.upc-chatbot-static { padding:16px 14px; overflow:auto; white-space:normal; font-size:var(--upc-message-font-size); line-height:1.5; background:#f8fafc; min-height:260px; }
.upc-chatbot-view-manual .upc-chatbot-static, .upc-chatbot-view-contact .upc-chatbot-static { height:100%; }
.upc-chatbot-messages { flex:1 1 auto; min-height: 220px; overflow: auto; padding: 14px; background: #f8fafc; }
.upc-chatbot-message { margin: 0 0 12px 0; display: flex; }
.upc-chatbot-message.user { justify-content: flex-end; }
.upc-chatbot-bubble { max-width: 85%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; line-height: 1.45; font-size: var(--upc-message-font-size); }
.upc-chatbot-message.assistant .upc-chatbot-bubble { background: #fff; border: 1px solid #e5e7eb; color: #111827; }
.upc-chatbot-message.user .upc-chatbot-bubble { background: var(--upc-primary); color: #fff; }
.upc-chatbot-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e5e7eb; background: #fff; }
.upc-chatbot-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 110px; border: 1px solid #d1d5db; border-radius: 12px; padding: 10px 12px; font-size: var(--upc-message-font-size); }
.upc-chatbot-form button { border: 0; background: var(--upc-primary); color: #fff; border-radius: var(--upc-button-radius); padding: var(--upc-button-padding); cursor: pointer; line-height: 1.2; font-size: var(--upc-message-font-size); }
.upc-floating { position: fixed; right: 18px; bottom: 18px; z-index: 999999; }
.upc-floating.upc-pos-center { left:50%; right:auto; transform:translateX(-50%); }
.upc-floating.upc-pos-right { left:auto; right:18px; transform:none; }
.upc-chatbot-toggle.upc-toggle-center { margin-left:auto; margin-right:auto; display:flex; }
.upc-chatbot-toggle.upc-toggle-right { margin-left:auto; }
.upc-chatbot-toggle { border: 0; border-radius: var(--upc-button-radius); background: var(--upc-launcher-bg); color: var(--upc-launcher-text); display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: 0 12px 40px rgba(17,24,39,.25); font-weight: 700; font-size: var(--upc-launcher-font-size); padding: var(--upc-button-padding); }
.upc-launcher-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.upc-launcher-size-small { min-width: 96px; min-height: 56px; font-size: 16px; }
.upc-launcher-size-medium { min-width: 140px; min-height: 84px; font-size: 20px; }
.upc-launcher-size-large { min-width: 188px; min-height: 112px; font-size: 24px; }
.upc-launcher-cloud.upc-launcher-size-small, .upc-launcher-text.upc-launcher-size-small { min-width: 112px; }
.upc-launcher-cloud.upc-launcher-size-medium, .upc-launcher-text.upc-launcher-size-medium { min-width: 156px; }
.upc-launcher-cloud.upc-launcher-size-large, .upc-launcher-text.upc-launcher-size-large { min-width: 204px; }
.upc-chatbot-panel { display: none; margin-bottom: 12px; }
.upc-chatbot-panel.open { display: block; }
.upc-shortcode .upc-chatbot-shell { width: 100%; max-width: 760px; }
.upc-typing { opacity: .7; font-style: italic; }
.upc-chatbot-form button:hover, .upc-chatbot-toggle:hover { background: var(--upc-accent); }
.upc-chatbot-footer { padding: 8px 14px 10px; font-size: 11px; line-height: 1.2; text-align: center; color: #6b7280; text-transform: lowercase; }

.upc-chatbot-header { display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:2; }
.upc-chatbot-title { display:block; min-width:0; }
.upc-chatbot-close { border:0; background:transparent; color:#fff; font-size:28px; line-height:1; cursor:pointer; padding:4px 8px; margin-left:12px; border-radius:10px; }
.upc-chatbot-close:hover { background: rgba(255,255,255,.14); }
.upc-chatbot-panel { opacity:0; transform:translateY(16px) scale(.98); pointer-events:none; transition:opacity .22s ease, transform .22s ease; display:block; max-height:0; overflow:hidden; }
.upc-chatbot-panel.open { opacity:1; transform:translateY(0) scale(1); pointer-events:auto; max-height:1200px; overflow:visible; }
.upc-open .upc-chatbot-toggle { display:none !important; }
@media (max-width: 782px) {
  .upc-floating { right: 10px; bottom: var(--upc-mobile-bottom-offset, 5dvh); }
  .upc-floating.upc-pos-center { left:50%; right:auto; transform:translateX(-50%); }
  .upc-floating .upc-chatbot-panel.open { position: fixed; right: 0; bottom: var(--upc-mobile-bottom-offset, 5%); left: 0; top: 0; margin: 0; padding: 0 0 var(--upc-mobile-bottom-offset, 5dvh) 0; background: rgba(15, 23, 42, .18); display:flex; align-items:flex-end; justify-content:center; }
  .upc-floating .upc-chatbot-shell { width: min(var(--upc-window-width), 100vw); height: min(var(--upc-window-height), 100dvh); max-width: 100vw; max-height: calc(100dvh - var(--upc-mobile-bottom-offset, 5dvh)); border-radius: 18px; }
  .upc-floating .upc-chatbot-messages { height: calc(100% - 146px); }
}


.upc-chatbot-static h1,
.upc-chatbot-static h2,
.upc-chatbot-static h3,
.upc-chatbot-static h4 { margin:0 0 10px; color:#111827; font-size:var(--upc-message-font-size); }
.upc-chatbot-static p { margin:0 0 10px; }
.upc-chatbot-static ul,
.upc-chatbot-static ol { margin:0 0 12px 20px; padding:0; }
.upc-chatbot-static li { margin:0 0 6px; }
.upc-chatbot-static a { color: var(--upc-primary); text-decoration: underline; word-break: break-word; }
.upc-chatbot-footer { padding:8px 12px; border-top:1px solid #e5e7eb; background:#fff; font-size:12px; color:#64748b; text-align:center; }
.upc-chatbot-panel { display:none; }
.upc-chatbot-panel.open { display:block; }

.upc-chatbot-shell, .upc-chatbot-header, .upc-chatbot-title, .upc-chatbot-tab, .upc-chatbot-bubble, .upc-chatbot-form textarea, .upc-chatbot-form button, .upc-chatbot-footer, .upc-chatbot-static, .upc-chatbot-static * { font-family: Arial, sans-serif !important; }
.upc-chatbot-view-manual, .upc-chatbot-tab[data-tab="manual"] { display:none !important; }

.upc-chatbot-quick-buttons { display:flex; flex-wrap:wrap; gap:8px; padding:12px 12px 0; background:#fff; }
.upc-chatbot-quick-button { border:1px solid #d1d5db; background:#fff; color:#111827; border-radius:999px; padding:8px 12px; cursor:pointer; font-size:var(--upc-message-font-size); line-height:1.2; }
.upc-chatbot-quick-button:hover { border-color:var(--upc-primary); color:var(--upc-primary); }
