/* PATCH223: independent chatbot UI; original bundled React widget hidden without modifications. */
html.fth223-active .fth-chat111{display:none!important}
.fth223{position:fixed;bottom:18px;right:18px;z-index:2147483000;font-family:inherit;color:#15253f;box-sizing:border-box}
.fth223 *{box-sizing:border-box}
.fth223 button{font-family:inherit;cursor:pointer}
.fth223-launch{border:0;border-radius:999px;background:#1359b2;color:white;padding:14px 19px;box-shadow:0 8px 30px #041e4270;font-weight:700}
.fth223-panel{position:absolute;bottom:62px;right:0;width:min(390px,calc(100vw - 26px));max-height:min(740px,calc(100dvh - 100px));overflow:hidden;background:#fff;border:1px solid #dde7f2;box-shadow:0 16px 50px #05163255;border-radius:18px;display:flex;flex-direction:column}
.fth223-panel[hidden]{display:none}
.fth223-header{display:flex;justify-content:space-between;align-items:center;background:#0a3f88;color:#fff;padding:14px 16px;gap:12px}
.fth223-header strong{display:block;font-size:15px}.fth223-header small{display:block;font-size:11px;opacity:.9;margin-top:3px}
.fth223-close{font-size:24px;border:0;background:transparent;color:white}
.fth223-modes{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px 0}
.fth223-mode{flex:1 1 auto;font-size:11px;border:1px solid #cedbed;background:#f6f9ff;color:#1d426f;border-radius:8px;padding:8px 7px;max-width:100%;}
.fth223-mode[aria-pressed=true]{background:#dbeafe;border-color:#4b8ddc;font-weight:700}
.fth223-subtitle{font-size:15px;margin:10px 14px 2px;color:#102c50}
.fth223-status{font-size:11px;line-height:1.55;color:#52667c;margin:0 14px 8px}
.fth223-log{min-height:140px;max-height:350px;overflow-y:auto;flex:1;padding:12px;background:#f6f8fc;display:flex;flex-direction:column;gap:8px}
.fth223-empty{font-size:13px;color:#64748b;text-align:center;margin:auto}
.fth223-message{display:flex;flex-direction:column;align-items:flex-start;max-width:88%}.fth223-message.mine{align-self:flex-end;align-items:flex-end}
.fth223-bubble{white-space:pre-wrap;overflow-wrap:anywhere;background:white;border:1px solid #e4eaf2;color:#163455;padding:10px 12px;border-radius:12px;font-size:13px;line-height:1.55}
.fth223-message.mine .fth223-bubble{background:#e2efff;border-color:#bfdbfe}.fth223-message small{font-size:10px;color:#64748b;margin:3px 4px}
.fth223-quick{display:flex;flex-wrap:wrap;gap:6px;overflow-y:auto;max-height:83px;padding:9px 12px}
.fth223-chip{font-size:11px;padding:7px 9px;white-space:normal;text-align:left;border-radius:7px;border:1px solid #a9c9ec;background:#f4f9ff;color:#173f72}
.fth223-error{font-size:12px;line-height:1.5;color:#9a2419;background:#fff3f2;padding:8px 12px;margin:4px 10px;border-radius:8px}
.fth223-form{display:flex;gap:8px;padding:10px 12px}.fth223-entry{width:100%;resize:vertical;min-height:47px;max-height:85px;font:inherit;font-size:13px;padding:9px;border-radius:9px;border:1px solid #cbd5e1;color:#17263b;background:#fff}
.fth223-send{border:0;border-radius:9px;background:#1359b2;color:white;padding:0 15px;font-size:13px;font-weight:600}
.fth223-send:disabled{opacity:.6;cursor:wait}
.fth223-footer{padding:0 12px 12px;display:flex;gap:6px;align-items:center;justify-content:space-between}
.fth223-consent{display:flex;align-items:start;gap:6px;line-height:1.4;max-width:270px;font-size:10px;color:#52627b}
.fth223-consent input{margin:1px 0 0}.fth223-reset{border:0;color:#1d5ea8;background:transparent;white-space:nowrap;font-size:11px}
.fth223-admin-trigger{position:fixed;top:86px;right:22px;z-index:2147482996;border:0;border-radius:10px;padding:10px 15px;background:#1459a8;color:#fff;font:600 13px inherit;box-shadow:0 4px 12px #1236}
.fth223-admin-panel{position:fixed;z-index:2147483002;top:105px;right:16px;bottom:16px;width:min(500px,calc(100vw - 32px));overflow-y:auto;background:#fff;color:#19344f;box-shadow:0 10px 42px #0005;border:1px solid #d8e4ee;border-radius:16px;padding:21px;font:14px/1.5 system-ui,sans-serif}
.fth223-admin-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.fth223-admin-title h2{font-size:20px;margin:0}.fth223-admin-title button{background:#e9eff7;color:#123456;border:0;border-radius:8px;padding:6px 12px}
.fth223-admin-panel>p{font-size:12px;color:#567;margin:12px 0}
.fth223-setting{display:flex;flex-direction:column;gap:5px;margin:12px 0;font-size:13px;font-weight:600}
.fth223-setting input:not([type=checkbox]),.fth223-setting select,.fth223-setting textarea{font:inherit;width:100%;background:white;color:#17253c;padding:10px;border:1px solid #bac8d7;border-radius:8px;font-weight:400}
.fth223-setting:has(input[type=checkbox]){flex-direction:row;align-items:center;justify-content:space-between}
.fth223-admin-actions{display:flex;flex-wrap:wrap;gap:10px}.fth223-admin-actions button{background:#e6eef7;color:#113e73;border:1px solid #b6c8db;border-radius:8px;padding:11px 14px}
.fth223-admin-actions button.fth223-primary{background:#155aac;color:#fff;border:0}.fth223-settings-feedback{font-size:12px;color:#15538d}
.fth223 :focus-visible,.fth223-admin-panel :focus-visible,.fth223-admin-trigger:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
@media(max-width:460px){.fth223{right:10px;bottom:10px}.fth223-panel{bottom:57px;width:calc(100vw - 20px);max-height:calc(100dvh - 79px)}.fth223-log{max-height:300px}.fth223-admin-trigger{top:80px;right:10px}}
@media(prefers-reduced-motion:reduce){.fth223 *{scroll-behavior:auto}}
@media(prefers-color-scheme:dark){html[data-theme='dark'] .fth223-panel,html.dark .fth223-panel{background:#102034;color:#eaf2fc;border-color:#31445a}}

/* PATCH223B: restore the familiar blue circular chat bubble on public pages. */
.fth223-launch{
  display:grid;place-items:center;width:62px;height:62px;min-width:62px;min-height:62px;
  padding:0;border:1px solid rgba(255,255,255,.24);border-radius:50%;
  background:linear-gradient(135deg,#245bdd 0%,#168bdc 100%);color:#fff;
  box-shadow:0 7px 24px rgba(13,65,146,.36);line-height:1;
  transition:transform .18s ease, box-shadow .18s ease;
}
.fth223-launch svg{display:block;pointer-events:none;flex:none}
.fth223-launch:hover{transform:translateY(-3px);box-shadow:0 10px 26px rgba(13,65,146,.42)}
.fth223-launch:active{transform:translateY(-1px)}
.fth223-launch[aria-expanded=true]{box-shadow:0 0 0 3px rgba(44,128,237,.22),0 8px 24px rgba(13,65,146,.27)}
.fth223-panel{bottom:76px}
@media(max-width:460px){.fth223-launch{width:56px;height:56px;min-width:56px;min-height:56px}.fth223-panel{bottom:70px}}
@media(prefers-reduced-motion:reduce){.fth223-launch{transition:none}.fth223-launch:hover{transform:none}}

/* PATCH225 — preserve reading position, center expanded chat, blur the page behind. */
.fth225-backdrop[hidden]{display:none!important}
.fth225-backdrop{position:fixed;inset:0;background:rgba(7,19,45,.48);-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);pointer-events:auto}
.fth225-header-controls{display:flex;align-items:center;gap:8px;flex:none}
.fth225-expand{border:1px solid rgba(255,255,255,.36);border-radius:8px;background:rgba(255,255,255,.14);color:#fff;padding:7px 11px;font-size:12px;line-height:1.3;font-weight:600}
.fth225-expand:hover{background:rgba(255,255,255,.24)}
.fth223-log{overflow-anchor:none;min-height:0;overscroll-behavior:contain}
.fth223.fth225-expanded{inset:0;top:0;left:0;right:0;bottom:0;width:100%;height:100dvh;pointer-events:none}
.fth223.fth225-expanded .fth223-launch{display:none}
.fth223.fth225-expanded .fth223-panel{position:fixed;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:min(980px,calc(100vw - 64px));height:min(780px,calc(100dvh - 64px));max-height:calc(100dvh - 64px);border-radius:20px;pointer-events:auto;box-shadow:0 22px 75px rgba(0,0,0,.36)}
.fth223.fth225-expanded .fth223-log{flex:1;min-height:0;max-height:none}
.fth223.fth225-expanded .fth223-bubble{font-size:14px;line-height:1.65}
.fth223.fth225-expanded .fth223-message{max-width:82%}
@media(max-width:650px){.fth223.fth225-expanded .fth223-panel{width:calc(100vw - 24px);height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);border-radius:16px}.fth225-expand{font-size:11px;padding:7px 8px}.fth223.fth225-expanded .fth223-message{max-width:96%}}
@media(prefers-reduced-transparency:reduce){.fth225-backdrop{-webkit-backdrop-filter:none;backdrop-filter:none;background:rgba(7,19,45,.77)}}

/* PATCH228 — responsive, roomy compact chatbot and readable quick-question cards.
   Scoped to the existing FTH chat widget; no change to AI, submission or scrolling logic. */
@media (min-width: 651px) {
  .fth223:not(.fth225-expanded) .fth223-panel {
    width: min(540px, calc(100vw - 40px));
    height: min(780px, calc(100dvh - 108px));
    max-height: calc(100dvh - 108px);
  }
}
.fth223-panel {
  min-width: 0;
}
.fth223-panel .fth223-header {
  padding: 15px 18px;
}
.fth223-panel .fth223-header strong {
  font-size: 16px;
  letter-spacing: -0.015em;
}
.fth223-panel .fth223-modes {
  padding: 11px 14px 0;
  gap: 7px;
}
.fth223-panel .fth223-mode {
  font-size: 12px;
  min-height: 39px;
  padding: 9px 10px;
}
.fth223-panel .fth223-log {
  flex: 1 1 0;
  min-height: 112px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.fth223-panel .fth223-bubble {
  font-size: 13.5px;
  line-height: 1.6;
}
/* Suggestions remain a separate readable area; do not overlap the composer. */
.fth223-panel .fth223-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  align-content: start;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  max-height: min(190px, 24dvh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 11px 14px 12px;
  background: #ffffff;
  border-top: 1px solid #e3ebf5;
  scrollbar-width: thin;
  scrollbar-color: #9cb7db transparent;
}
.fth223-panel .fth223-quick::before {
  content: 'SUGGESTED QUESTIONS';
  display: block;
  grid-column: 1 / -1;
  color: #476382;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.3;
  padding-bottom: 1px;
}
.fth223-panel .fth223-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  min-height: 47px;
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: left;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid #d4e2f4;
  border-radius: 11px;
  background: #f5f9ff;
  color: #194977;
  transition: background-color .16s ease,border-color .16s ease,transform .16s ease;
}
.fth223-panel .fth223-chip::before {
  content: '?';
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  color: #185caa;
  background: #e3efff;
  font-size: 12px;
  font-weight: 800;
}
.fth223-panel .fth223-chip:hover {
  background: #e8f2ff;
  border-color: #8bb4e7;
  transform: translateY(-1px);
}
.fth223-panel .fth223-chip:active { transform: translateY(0); }
.fth223-panel .fth223-form { padding: 11px 14px; }
.fth223-panel .fth223-entry { min-height: 54px; }
.fth223-panel .fth223-footer { padding: 1px 14px 12px; }
/* Keep the previously installed centered, blurred expansion. */
.fth223.fth225-expanded .fth223-panel .fth223-quick {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: min(180px, 22dvh);
}
@media (max-width: 650px) {
  .fth223:not(.fth225-expanded) .fth223-panel {
    width: min(530px, calc(100vw - 20px));
    height: min(760px, calc(100dvh - 96px));
    max-height: calc(100dvh - 96px);
  }
  .fth223-panel .fth223-quick,
  .fth223.fth225-expanded .fth223-panel .fth223-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(162px, 22dvh);
    gap: 7px;
  }
  .fth223-panel .fth223-chip { font-size: 11.5px; padding: 9px 10px; }
}
@media (max-width: 430px) {
  .fth223-panel .fth223-quick,
  .fth223.fth225-expanded .fth223-panel .fth223-quick {
    grid-template-columns: minmax(0, 1fr);
    max-height: min(156px, 22dvh);
  }
  .fth223-panel .fth223-chip { min-height: 43px; }
  .fth223-panel .fth223-header { padding: 12px 13px; }
  .fth223-panel .fth223-modes { padding: 9px 10px 0; }
  .fth223-panel .fth223-mode { font-size: 11px; padding: 8px 5px; }
  .fth223-panel .fth223-form { padding: 9px 10px; }
  .fth223-panel .fth223-footer { padding: 1px 10px 10px; }
}
@media (max-height: 660px) {
  .fth223-panel .fth223-quick,
  .fth223.fth225-expanded .fth223-panel .fth223-quick { max-height: min(115px, 19dvh); }
  .fth223-panel .fth223-log { min-height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .fth223-panel .fth223-chip { transition: none; }
  .fth223-panel .fth223-chip:hover { transform: none; }
}
html[data-theme='dark'] .fth223-panel .fth223-quick,
html.dark .fth223-panel .fth223-quick {
  background: #14263b;
  border-top-color: #34465a;
}
html[data-theme='dark'] .fth223-panel .fth223-quick::before,
html.dark .fth223-panel .fth223-quick::before { color: #c1d4eb; }
html[data-theme='dark'] .fth223-panel .fth223-chip,
html.dark .fth223-panel .fth223-chip {
  background: #1b334f;
  color: #e6f1ff;
  border-color: #365577;
}
html[data-theme='dark'] .fth223-panel .fth223-chip:hover,
html.dark .fth223-panel .fth223-chip:hover { background: #274363; }
