[data-chat-open][hidden], .chat-panel [hidden], .support-desk [hidden] { display: none !important; }
.footer-bottom .help-button { position: static; width: auto; height: auto; display: inline-flex; gap: 6px; padding: 6px; border: 0; box-shadow: none; background: transparent; }
.footer-bottom .help-word { display: inline; }
.chat-launch, .chat-panel, .support-desk { box-sizing: border-box; }
.chat-launch {
  position: fixed; z-index: 20; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  min-width: 148px; min-height: 60px; max-width: calc(100vw - 28px); padding: 12px 23px;
  border: 1px solid #5b7695; border-radius: 999px; background: #142541; color: #fff;
  box-shadow: 0 5px 20px #12254338; font: inherit; font-size: 1.03rem; line-height: 1.3; font-weight: 750; cursor: pointer;
  transition: background .18s, transform .18s;
}
.chat-launch svg { width: 28px; height: 28px; flex: none; }
@media (hover: hover) { .chat-launch:hover { background: #214773; transform: translateY(-2px); } }
.chat-panel {
  --chat-floor: max(20px, env(safe-area-inset-bottom));
  position: fixed; z-index: 21; inset: auto max(20px, env(safe-area-inset-right)) calc(var(--chat-floor) + var(--chat-keyboard, 0px)) auto;
  width: min(372px, calc(100vw - 28px)); height: min(360px, calc(100dvh - 84px)); max-width: none; max-height: none;
  margin: 0; padding: 0; border: 1px solid #cad7e3; border-radius: 20px; background: #fff; color: #162942;
  box-shadow: 0 12px 42px #13294136, 0 2px 8px #13294112; overflow: hidden; font-family: inherit;
  transform-origin: bottom right;
}
.chat-panel:not([open]) { pointer-events: none; opacity: 0; transform: scale(.38,.17); }
.chat-panel[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; opacity: 1; transform: none; }
@supports (transition-behavior: allow-discrete) {
  .chat-panel { transition: transform .2s cubic-bezier(.22,.68,.25,1), opacity .16s, display .2s allow-discrete; }
  @starting-style { .chat-panel[open] { opacity: 0; transform: scale(.92) translateY(6px); } }
}
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 17px; color: white; background: #192d4b; }
.chat-heading span { font-size: .65rem; letter-spacing: .13em; font-weight: 700; color: #c3e0eb; }
.chat-heading h2 { font-size: 1.17rem; color: inherit; margin: 3px 0 0; line-height: 1.3; }
.chat-close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #ffffff55; display: grid; place-items: center; color: white; background: transparent; cursor: pointer; }
.chat-close:hover { background: #ffffff18; }
.chat-scroll { overflow: auto; overscroll-behavior: contain; padding: 14px; background: #f3f7f9; }
.chat-welcome, .chat-compose small, .desk-note { color: #4b6075; font-size: .83rem; line-height: 1.55; }
.chat-welcome { max-width: 34ch; margin: 0 0 12px; padding: 10px 13px; border: 1px solid #d6e2e8; border-radius: 12px 12px 12px 3px; background: white; color: #304860; }
.chat-log { display: grid; gap: 10px; }
.chat-msg { justify-self: start; min-width: 0; max-width: 88%; }
.chat-msg.is-own { justify-self: end; }
.chat-bubble { width: fit-content; margin: 0; padding: 9px 12px; border: 1px solid #cfdae6; border-radius: 12px 12px 12px 3px; background: white; color: #182b42; font-size: .94rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.is-own .chat-bubble { margin-left: auto; border-color: #21436c; border-radius: 12px 12px 3px 12px; background: #21436c; color: white; }
.chat-by { margin: 3px 0 0; color: #536577; font-size: .7rem; line-height: 1.45; }
.is-own .chat-by { text-align: right; }
.chat-compose { margin: 0; padding: 12px 16px; border-top: 1px solid #dae3ec; background: white; }
.chat-compose label { display: block; margin: 0 0 5px; color: #253b52; font-weight: 650; font-size: .83rem; }
.chat-input-row { display: flex; gap: 7px; align-items: stretch; }
.chat-input-row textarea { box-sizing: border-box; width: 100%; min-width: 0; resize: none; padding: 8px; border: 1px solid #a9bdcf; border-radius: 8px; font: inherit; font-size: 16px; line-height: 1.35; color: #122641; background: #fff; }
.chat-input-row button, .desk-sound button, .desk-pages button, #desk-resolve, .chat-previous {
  min-height: 44px; margin: 0; padding: 7px 12px; border: 1px solid #adbfd0; border-radius: 8px; background: white; color: #204365; font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer;
}
.chat-input-row button { white-space: nowrap; border-color: #21436c; background: #21436c; color: white; }
.chat-input-row button:disabled { opacity: .55; cursor: default; }
.chat-compose small { display: block; margin-top: 5px; font-size: .74rem; }
.chat-status, #desk-alert { margin: 5px 0 0; color: #8b3a20; font-size: .83rem; }
.chat-status:empty, #desk-alert:empty { display: none; }
.chat-previous { display: block; margin: 0 auto 12px; }
.support-desk { scroll-margin-block: 16px; margin: 30px 0; padding-top: 19px; border-top: 1px solid #cbd6e3; }
.desk-heading, .desk-thread-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.desk-heading h2, .desk-heading p, .desk-thread h3, .desk-rooms h3 { margin: 0; }
.desk-sound, .desk-pages { display: flex; gap: 6px; flex-wrap: wrap; }
.desk-sound [aria-pressed="true"], .desk-room[aria-current="true"] { background: #e6f1fb; color: #163b65; }
.desk-grid { display: grid; grid-template-columns: minmax(170px, .72fr) minmax(0, 1.28fr); gap: 12px; align-items: start; }
.desk-rooms, .desk-thread { min-width: 0; border: 1px solid #cbd8e4; border-radius: 12px; overflow: hidden; background: white; }
.desk-rooms h3, #desk-placeholder, .desk-thread-head, .desk-pages { padding: 10px 12px; }
#desk-placeholder { font-size: .9rem; color: #4b6075; }
.desk-rooms h3, .desk-thread h3 { font-size: 1rem; }
.desk-room { display: grid; width: 100%; gap: 2px; text-align: left; margin: 0; padding: 9px 12px; border: 0; border-top: 1px solid #d9e2ec; border-radius: 0; color: #223b54; background: #fff; font: inherit; font-size: .85rem; }
.desk-room:hover, .desk-pages button:hover, .desk-sound button:hover, #desk-resolve:hover, .chat-previous:hover { background: #e6f1fb; color: #163b65; }
.desk-room span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.desk-room small { color: #516477; }
.desk-thread .chat-scroll { height: clamp(240px,36vh,395px); }
.support-desk .chat-by, .support-desk .chat-bubble { margin-block: 0; }
.support-desk :focus-visible, .chat-panel :focus-visible, .chat-launch:focus-visible { outline: 3px solid #1183c2; outline-offset: 2px; }
@media (max-width: 620px) {
  .chat-launch { right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom)); min-width: 136px; min-height: 56px; padding: 10px 19px; }
  .chat-launch svg { width: 26px; height: 26px; }
  .chat-panel { --chat-floor: max(10px,env(safe-area-inset-bottom)); right: max(10px,env(safe-area-inset-right)); width: min(352px,calc(100% - 20px)); height: min(328px,54dvh); border-radius: 17px; }
  .chat-panel[data-keyboard] { height: min(328px,calc(var(--chat-visible-height) - 20px)); }
  .chat-heading { padding: 9px 14px; }
  .chat-panel .chat-compose { padding: 9px 13px; }
  .desk-grid { grid-template-columns: minmax(0,1fr); }
  #desk-rooms { max-height: 220px; overflow: auto; }
}
@media (max-height: 480px) {
  .chat-panel { --chat-floor: max(6px,env(safe-area-inset-bottom)); width: min(352px,calc(100vw - 24px)); height: min(268px,calc(100dvh - 58px)); }
  .chat-heading { padding: 4px 12px; }
  .chat-heading span { display: none; }
  .chat-panel .chat-compose { padding: 5px 12px; }
  .chat-input-row textarea { height: 44px; }
  .chat-scroll { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-panel, .chat-launch { transition: none; }
}
