.thor-chatbot{position:fixed;right:24px;bottom:24px;z-index:999999;font-family:Arial,Helvetica,sans-serif;color:#252525;font-size:14px;line-height:1.4}
.thor-chatbot *{box-sizing:border-box}
.thor-chatbot [hidden],.thor-hidden{display:none!important}
/* Explicit selectors and !important on shape keep WordPress theme button rules from making the launcher square. */
.thor-chatbot button.thor-launcher{appearance:none;-webkit-appearance:none;display:flex;align-items:center;justify-content:center;flex:none;width:72px!important;height:72px!important;min-width:72px!important;min-height:72px!important;max-width:72px!important;max-height:72px!important;margin:0!important;padding:0!important;border:3px solid #fff!important;border-radius:9999px!important;background:#f58220!important;color:#fff!important;cursor:pointer;line-height:1!important;box-shadow:0 5px 0 rgba(0,39,118,.12),0 10px 30px rgba(0,0,0,.28)!important;transition:transform .15s ease,box-shadow .15s ease}
.thor-chatbot button.thor-launcher:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 8px 0 rgba(0,39,118,.10),0 14px 34px rgba(0,0,0,.30)!important}
.thor-chatbot button.thor-launcher:focus-visible{outline:3px solid #002776;outline-offset:3px}
.thor-chatbot .thor-launcher-icon{display:block;width:33px;height:33px;flex:none;pointer-events:none;stroke:#fff}
@media(prefers-reduced-motion:reduce){.thor-chatbot button.thor-launcher{transition:none}.thor-chatbot button.thor-launcher:hover{transform:none}}
.thor-panel{width:min(390px,calc(100vw - 32px));height:min(660px,calc(100vh - 24px));height:min(660px,calc(100dvh - 24px));background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 18px 55px rgba(0,0,0,.28);border:1px solid #e8e8e8;display:flex;flex-direction:column}
.thor-header{flex:0 0 auto;background:#f58220;color:#fff;padding:16px 18px;display:flex;align-items:center;justify-content:space-between}
.thor-header strong{display:block;font-size:17px}.thor-header span{display:block;font-size:10px;opacity:.9;margin-top:3px;text-transform:uppercase;letter-spacing:.07em}
.thor-close{background:transparent;border:0;color:#fff;font-size:30px;line-height:1;cursor:pointer}
.thor-conversation{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;background:#f7f7f8;scrollbar-gutter:stable}
.thor-messages{padding:14px 14px 6px;overflow:visible;background:#f7f7f8}
.thor-msg{max-width:85%;padding:11px 13px;border-radius:14px;margin:0 0 10px;line-height:1.4;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.thor-bot{background:#fff;border:1px solid #e7e7e7;border-top-left-radius:5px}.thor-user{background:#252525;color:#fff;margin-left:auto;border-top-right-radius:5px}.thor-error{background:#fff1f1;color:#991b1b;border:1px solid #fecaca}
.thor-actions{padding:0 14px 14px;background:#f7f7f8;display:grid;gap:7px;grid-auto-rows:minmax(39px,max-content);align-content:start;overflow:visible}
.thor-choice{background:#fff;border:1px solid #f58220;color:#333;border-radius:10px;padding:9px 12px;font-size:14px;line-height:1.35;text-align:left;cursor:pointer;font-weight:600}
.thor-choice:hover{background:#fff5ec}.thor-choice:disabled{opacity:.55;cursor:wait}
.thor-input-row{display:flex;gap:8px;padding:12px;border-top:1px solid #eee;background:#fff}
.thor-input-row input{flex:1;min-width:0;border:1px solid #d7d7d7;border-radius:9px;padding:11px 12px;outline:none;font:inherit;color:#252525;background:#fff}
.thor-input-row input:focus{border-color:#f58220}
.thor-input-row button{border:0;border-radius:9px;background:#f58220;color:#fff;padding:0 15px;font-weight:700;cursor:pointer}
.thor-input-row button:disabled{opacity:.5;cursor:wait}
.thor-panel footer{font-size:10px;text-align:center;padding:8px 10px;color:#777;background:#fff;border-top:1px solid #f0f0f0}.thor-panel footer a{color:#2351a4}
.thor-msg a{color:#2351a4;font-weight:700;text-decoration:underline}
@media(max-width:520px){.thor-chatbot{right:12px;bottom:12px}.thor-panel{width:calc(100vw - 24px);height:calc(100dvh - 24px)}.thor-chatbot button.thor-launcher{width:66px!important;height:66px!important;min-width:66px!important;min-height:66px!important;max-width:66px!important;max-height:66px!important}.thor-chatbot .thor-launcher-icon{width:30px;height:30px}}

.thor-chatbot .thor-hp{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.thor-nav{flex:0 0 auto;padding:0 14px 8px;background:#f7f7f8}
/* Choice and Back use identical button styling, even when theme button rules differ. */
.thor-chatbot button.thor-choice,.thor-chatbot button.thor-back{display:block;width:100%;margin:0;background:#fff;border:1px solid #f58220;border-radius:10px;color:#333;cursor:pointer;font:600 14px/1.35 Arial,Helvetica,sans-serif;padding:9px 12px;text-align:left;min-height:39px;flex-shrink:0}
.thor-chatbot button.thor-choice:hover,.thor-chatbot button.thor-back:hover{background:#fff5ec}
.thor-chatbot button.thor-choice:focus-visible,.thor-chatbot button.thor-back:focus-visible{outline:2px solid #002776;outline-offset:2px}
.thor-chatbot button.thor-choice:disabled,.thor-chatbot button.thor-back:disabled{opacity:.55;cursor:wait}
.thor-ended{display:flex;align-items:center;gap:10px;color:#777;font-size:12px;letter-spacing:.03em;text-align:center;margin:12px 0 0;white-space:nowrap}
.thor-ended:before,.thor-ended:after{content:"";height:1px;background:#d7d7d7;flex:1}

.thor-live-indicator{background:#edf5ff;border-top:1px solid #d5e6f9;padding:8px 14px;font-size:12px;color:#002776;font-weight:600}

/* Public themes may override generic user message styles. Keep both automated
   answers and live visitor messages consistently dark with white text. */
#thor-chatbot #thor-messages > .thor-msg.thor-user {
  display:block!important;
  box-sizing:border-box!important;
  width:fit-content!important;
  max-width:85%!important;
  margin:0 0 10px auto!important;
  padding:11px 13px!important;
  background-color:#252525!important;
  background-image:none!important;
  color:#ffffff!important;
  border:0!important;
  border-radius:14px 5px 14px 14px!important;
  font:normal 14px/1.4 Arial,Helvetica,sans-serif!important;
  text-align:left!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  box-shadow:none!important;
}
#thor-chatbot #thor-messages > .thor-msg.thor-bot {
  background:#fff!important;
  color:#252525!important;
  border:1px solid #e7e7e7!important;
}

/* RC1.4: preserve navigation on reduced-height viewports. */
.thor-panel footer,.thor-input-row,.thor-live-indicator{flex-shrink:0}
.thor-chatbot .thor-actions > button{min-height:39px!important;height:auto!important;max-height:none!important;white-space:normal!important;line-height:1.35!important;flex-shrink:0!important}
@media(max-height:600px){.thor-header{padding:10px 14px}.thor-messages{padding:10px 12px 5px}.thor-actions{gap:6px;padding:0 12px 10px;grid-auto-rows:minmax(39px,max-content)}.thor-nav{padding:0 12px 6px}.thor-panel footer{padding:5px 8px}}

/* RC1.4.1: single conversation scroll, accessible full-height option rows. */
#thor-chatbot #thor-actions button.thor-choice{min-height:39px!important;height:auto!important;max-height:none!important;padding:9px 12px!important;font:600 14px/1.35 Arial,Helvetica,sans-serif!important;box-sizing:border-box!important;display:block!important}
#thor-chatbot #thor-nav button.thor-back{min-height:39px!important;height:auto!important;max-height:none!important;padding:9px 12px!important;font:600 14px/1.35 Arial,Helvetica,sans-serif!important}

/* RC1.4.2: visually clean single-scroll conversation; scrolling stays
   accessible by mouse wheel, keyboard and touch on short viewports. */
#thor-chatbot .thor-conversation {
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
}
#thor-chatbot .thor-conversation::-webkit-scrollbar { display: none; }

/* On the opening two-choice prompt, anchor choices near the footer.
   Later prompts retain their natural document flow and readable 39px rows. */
#thor-chatbot.thor-purpose-layout .thor-messages {
  flex: 1 0 auto;
}
#thor-chatbot.thor-purpose-layout .thor-actions {
  flex: 0 0 auto;
}

/* RC1.4.3: options are never overlaid by Back or compressed by transcript history.
   The two scroll regions have hidden scrollbars and support touch/wheel/keyboard. */
#thor-chatbot .thor-conversation {display:flex;flex-direction:column;min-height:0;overflow:hidden;scrollbar-gutter:auto;}
#thor-chatbot.thor-choice-stage #thor-messages {
  flex:1 1 auto; min-height:48px; overflow-y:auto; overscroll-behavior:contain;
  padding:10px 14px 0; scrollbar-width:none; -ms-overflow-style:none;
}
#thor-chatbot.thor-choice-stage #thor-actions {
  flex:0 0 auto; min-height:0; max-height:calc(100% - 48px);
  overflow-y:auto; overscroll-behavior:contain; scrollbar-width:none;
  -ms-overflow-style:none; gap:5px; grid-auto-rows:minmax(39px,max-content);
  padding:0 14px 6px; align-content:start;
}
#thor-chatbot.thor-choice-stage #thor-messages::-webkit-scrollbar,
#thor-chatbot.thor-choice-stage #thor-actions::-webkit-scrollbar {display:none;}
#thor-chatbot.thor-choice-stage #thor-actions button.thor-choice {min-height:39px!important; flex-shrink:0!important;}
#thor-chatbot.thor-choice-stage #thor-nav {flex:0 0 auto;}
/* Intro screen places its two actions immediately above navigation/footer. */
#thor-chatbot.thor-purpose-layout #thor-messages {flex:1 1 auto;}
#thor-chatbot.thor-purpose-layout #thor-actions {flex:0 0 auto;max-height:none;}
