/* Floating support chat. Its own flex and scroll rules keep the widget inside the viewport. */
.community-chat-widget {
  position: fixed;
  z-index: 70;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  font-family: var(--font-family-base, Inter, Arial, sans-serif);
}
.community-chat-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 54px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #9ddd68;
  border-radius: 0;
  background: #b8ef70;
  color: #172115;
  box-shadow: 0 8px 28px #0003;
  cursor: pointer;
  font-weight: 750;
}
.community-chat-launcher:hover { background: #a8e35e; }
.community-chat-launcher:focus-visible,
.community-chat-panel button:focus-visible,
.community-chat-panel a:focus-visible,
.community-chat-panel textarea:focus-visible,
.community-chat-panel input:focus-visible,
.community-chat-panel select:focus-visible { outline: 3px solid #3f8b39; outline-offset: 2px; }
.community-chat-launcher svg { width: 23px; height: 23px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.community-chat-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 64px);
  display: flex;
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 104px));
  height: min(640px, calc(100dvh - 104px - env(safe-area-inset-top, 0px)));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd7c8;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 16px 50px #0004;
}
.community-chat-panel[hidden], .community-chat-view[hidden] { display: none !important; }
.community-chat-panel.is-maximized { inset: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); width: auto; height: auto; max-height: none; }
.community-chat-head { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; padding: 13px 15px; background: #172017; color: #fff; }
.community-chat-head-copy { display: grid; gap: 3px; min-width: 0; }
.community-chat-head-copy strong { overflow-wrap: anywhere; }
.community-chat-head small { color: #c7d1c5; font-size: .76rem; line-height: 1.4; }
.community-chat-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; }
.community-chat-controls button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 21px; line-height: 1; }
.community-chat-controls button:hover { background: #ffffff18; }
.community-chat-tabs { display: grid; flex: 0 0 auto; grid-template-columns: repeat(2,minmax(0,1fr)); border-bottom: 1px solid #dce5da; }
.community-chat-tabs button { min-height: 44px; padding: 9px; border: 0; border-bottom: 3px solid transparent; background: #fff; color: #536052; cursor: pointer; font-weight: 700; }
.community-chat-tabs button[aria-selected="true"] { border-bottom-color: #287b37; color: #236b31; }
.community-chat-view { display: flex; min-width: 0; min-height: 0; flex: 1 1 auto; flex-direction: column; overflow: hidden; padding: 12px; }
.community-chat-presets { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.community-chat-presets button { padding: 6px 8px; border: 1px solid #d4ded2; border-radius: 0; background: #f7faf6; color: #3e503d; cursor: pointer; font-size: 11px; }
.community-chat-thread { display: flex; min-width: 0; min-height: 80px; flex: 1 1 auto; flex-direction: column; gap: 8px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid #e0e7de; background: #f8faf7; }
.community-chat-message { max-width: min(92%, 34rem); padding: 9px 11px; border: 1px solid #e1e8df; background: #fff; overflow-wrap: anywhere; white-space: pre-wrap; }
.community-chat-message.is-user { align-self: flex-end; border-color: #d1e6be; background: #eff8e8; }
.community-chat-message small { display: block; margin-top: 5px; color: #667265; font-size: 10px; }
.community-chat-send { display: grid; flex: 0 0 auto; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; margin-top: 8px; }
.community-chat-send textarea { display: block; width: 100%; min-width: 0; min-height: 48px; max-height: 130px; padding: 9px; border: 1px solid #cbd7c8; border-radius: 0; resize: vertical; }
.community-chat-send button { min-height: 44px; padding-inline: 16px; border: 1px solid #267633; border-radius: 0; background: #b8ef70; color: #172115; cursor: pointer; font-weight: 700; }
.community-chat-send button:disabled, .community-quick-post button:disabled { opacity: .6; cursor: wait; }
.community-chat-note { flex: 0 0 auto; margin: 8px 0; color: #667265; font-size: 11px; line-height: 1.45; }
.community-chat-status { min-height: 0; margin: 6px 0 0; color: #7b352d; font-size: 12px; line-height: 1.45; }
.community-chat-status:empty { display: none; }
.community-chat-status.is-success { color: #216b31; }
.community-chat-full-link, .community-chat-guest > a { flex: 0 0 auto; color: #236b31; font-size: 13px; font-weight: 700; }
.community-chat-guest { display: grid; min-height: 0; gap: 14px; overflow-y: auto; padding: 20px; }
.community-chat-guest > div { display: flex; flex-wrap: wrap; gap: 8px; }
.community-quick-post { display: grid; min-height: 0; gap: 10px; overflow-y: auto; }
.community-quick-post label { display: grid; min-width: 0; gap: 5px; font-size: 12px; font-weight: 700; }
.community-quick-post input, .community-quick-post textarea, .community-quick-post select { width: 100%; min-width: 0; padding: 9px; border: 1px solid #cbd7c8; border-radius: 0; background: #fff; }
.community-quick-post textarea { resize: vertical; }
.community-quick-post .btn { justify-self: start; }
@media (max-width: 600px) {
  .community-chat-widget { right: max(10px, env(safe-area-inset-right, 0px)); bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  .community-chat-launcher { width: 52px; min-width: 52px; min-height: 52px; padding: 0; }
  .community-chat-launcher span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .community-chat-panel { right: max(8px, env(safe-area-inset-right, 0px)); bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 60px); width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); height: min(680px, calc(100vh - 82px)); height: min(680px, calc(100dvh - 82px - env(safe-area-inset-top, 0px))); }
  .community-chat-panel.is-maximized { inset: max(6px, env(safe-area-inset-top, 0px)) max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); width: auto; height: auto; }
  .community-chat-view { padding: 9px; }
  .community-chat-presets button { min-height: 32px; }
}
@media (max-width: 360px) {
  .community-chat-head { padding: 10px; }
  .community-chat-controls button { width: 32px; height: 32px; }
  .community-chat-send { grid-template-columns: minmax(0,1fr) 68px; gap: 6px; }
  .community-chat-send button { padding-inline: 8px; }
}
