.halo-preview {
  --chat-top: calc(var(--vitals-top) + var(--vitals-height) + 8px);
  --chat-height: 214px;
  --chat-max-height: 40dvh;
}
.halo-preview #chat-ui.chat {
  position: fixed;
  top: var(--chat-top);
  left: var(--edge);
  right: auto;
  z-index: 8;
  display: flex;
  flex-direction: column;
  width: var(--left-hud-width);
  max-width: calc(100vw - 2 * var(--edge) - 54px);
  height: var(--chat-height);
  max-height: var(--chat-max-height);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgb(184 207 190 / 18%);
  border-radius: 5px;
  color: #dde5d8;
  background: rgb(11 23 23 / 20%);
  font: 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: auto;
  text-shadow: 0 1px 3px rgb(0 0 0 / 85%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: height 200ms ease, background 160ms, border-color 160ms;
}
.halo-preview #chat-ui.chat:hover { background: rgb(11 23 23 / 28%); border-color: rgb(184 207 190 / 26%); }
.halo-preview #chat-ui.chat.is-focused { background: rgb(11 23 23 / 36%); border-color: rgb(184 207 190 / 30%); }
.halo-preview #chat-ui.chat.is-collapsed { height: 44px; max-height: none; }
.halo-preview:has(#chat-ui.chat:not(.is-collapsed)) .last-transmission-reopen { top: max(190px, calc(var(--chat-top) + min(var(--chat-height), var(--chat-max-height)) + 12px)); }
.chat .chat-header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 44px; min-height: 44px; padding-left: 8px; border-bottom: 1px solid rgb(164 195 178 / 12%); }
.chat .chat-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; margin-right: auto; }
.chat .chat-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 65px; margin: 0; padding: 8px 10px; border: 0; border-radius: 0; color: #9daea4; background: transparent; font: inherit; font-size: 10px; box-shadow: inset 0 -1px transparent; }
.chat .chat-tab[aria-selected="true"] { color: #e0e9dc; box-shadow: inset 0 -1px #bed0af; }
.chat .chat-tab:hover { color: #e0e9dc; background: rgb(188 217 194 / 5%); }
.chat .chat-tab.has-unread { color: #f0d4a2; }
.chat .chat-unread { box-sizing: border-box; display: inline-flex; align-items: flex-start; justify-content: center; flex-shrink: 0; min-width: 17px; height: 19px; padding: 2px 4px 5px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); color: #1c2624; background: rgb(234 195 132 / 92%); text-shadow: none; font-size: 9px; font-weight: 650; line-height: 12px; font-variant-numeric: tabular-nums; }
.chat .chat-toggle { flex: 0 0 44px; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; color: #aebfaf; background: transparent; font: inherit; font-size: 18px; }
.chat .chat-toggle:hover { color: #e1eadb; background: rgb(188 217 194 / 7%); }
.chat .chat-presence-toggle { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 44px; width: 44px; height: 44px; margin: 0; padding: 0 2px; border: 0; border-radius: 0; color: #bdcfbc; background: transparent; font: inherit; font-size: 10px; }
.chat .chat-presence-toggle:hover, .chat .chat-presence-toggle[aria-expanded="true"] { color: #e1eadb; background: rgb(188 217 194 / 9%); }
.chat .chat-presence-count { font-variant-numeric: tabular-nums; }
.chat .chat-presence-icon { position: relative; flex: 0 0 14px; width: 14px; height: 15px; }
.chat .chat-presence-icon::before { content: ""; position: absolute; top: 1px; left: 2px; width: 4px; height: 4px; border: 1px solid currentColor; border-radius: 50%; box-shadow: 5px 1px 0 -1px currentColor; }
.chat .chat-presence-icon::after { content: ""; position: absolute; bottom: 1px; left: 0; width: 8px; height: 5px; border: 1px solid currentColor; border-radius: 5px 5px 1px 1px; box-shadow: 4px 1px 0 -1px currentColor; }
.chat .chat-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat .chat-presence-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat .chat-presence-header { display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-height: 36px; padding-left: 12px; }
.chat .chat-presence-title { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: #c7d8b9; font: inherit; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chat .chat-presence-back { flex-shrink: 0; align-self: stretch; min-height: 36px; margin: 0; padding: 0 10px; border: 0; border-radius: 0; color: #bdcfbc; background: transparent; font: inherit; font-size: 9px; }
.chat .chat-presence-back:hover { color: #e1eadb; background: rgb(188 217 194 / 7%); }
.chat .chat-presence-summary { flex-shrink: 0; margin: 0; padding: 0 12px 4px; color: #b4c5ba; font-size: 9px; }
.chat .chat-presence-list { flex: 1; min-height: 0; max-height: 300px; margin: 0; padding: 0 12px 6px; overflow-y: auto; overscroll-behavior: contain; list-style: none; scrollbar-width: thin; scrollbar-color: #526357 transparent; }
.chat .chat-presence-member { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; border-top: 1px solid rgb(164 195 178 / 9%); }
.chat .chat-presence-identity { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.chat .chat-presence-name { overflow: hidden; color: #d8e1d4; text-overflow: ellipsis; white-space: nowrap; }
.chat .chat-presence-self { flex-shrink: 0; color: #a3b89f; font-size: 8px; }
.chat .chat-presence-status { flex-shrink: 0; color: #9aaca2; font-size: 9px; }
.chat .chat-presence-member[data-online="true"] .chat-presence-status { color: #c0d4ac; }
.chat .chat-presence-member[data-online="true"] .chat-presence-status::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 4px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.chat .chat-context { flex-shrink: 0; margin: 5px 12px 0; overflow: hidden; color: #8faaa0; font-size: 8px; line-height: 1.6; white-space: nowrap; text-overflow: ellipsis; }
.chat .chat-messages { position: relative; flex: 1; min-height: 0; margin: 0; padding: 5px 12px 8px; overflow-y: auto; overscroll-behavior: contain; list-style: none; scrollbar-width: thin; scrollbar-color: #526357 transparent; }
.chat .chat-message + .chat-message { margin-top: 7px; }
.chat .chat-message-meta { display: flex; align-items: baseline; gap: 7px; }
.chat .chat-author { overflow: hidden; color: #c7d8b9; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chat .chat-time { flex-shrink: 0; color: #b4c5ba; font-size: 8px; font-variant-numeric: tabular-nums; }
.chat .chat-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #d8e1d4; font-size: 11px; line-height: 1.45; }
.chat .chat-empty { padding: 7px 0; color: #93a49a; font-size: 10px; }
.chat .chat-compose { display: flex; align-items: center; gap: 3px; flex: 0 0 44px; min-height: 44px; padding-left: 12px; border-top: 1px solid rgb(164 195 178 / 12%); background: rgb(10 21 21 / 8%); }
.chat .chat-input { display: block; flex: 1; width: 0; min-width: 0; min-height: 44px; padding: 0 4px 0 0; border: 0; border-radius: 0; color: #e2ebdc; background: transparent; font: inherit; font-size: 11px; box-shadow: none; }
.chat .chat-input::placeholder { color: #93a699; opacity: 1; }
.chat .chat-input:focus { outline: none; }
.chat .chat-compose:focus-within { box-shadow: inset 0 1px #b2cab4; }
.chat .chat-send { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #c6dbc0; font: inherit; font-size: 21px; }
.chat .chat-send:hover:not(:disabled) { background: rgb(188 217 194 / 9%); color: #e1efd8; }
.chat .chat-send:disabled { color: #728279; cursor: default; }
.chat .chat-feedback { flex-shrink: 0; margin: 0; padding: 3px 12px 5px; color: #d7c79f; font-size: 9px; line-height: 1.4; }
.chat :is(button, .chat-messages, .chat-presence-list):focus-visible { outline: 1px solid #bfd7bd; outline-offset: -3px; }
.chat .chat-announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.chat [hidden] { display: none !important; }
@media (min-width: 721px) and (max-height: 660px) {
  .halo-preview { --chat-height: 176px; }
}
@media (max-width: 720px) {
  .halo-preview { --chat-height: 176px; --chat-max-height: 38dvh; }
  .chat .chat-context { margin-top: 3px; }
  .chat .chat-message + .chat-message { margin-top: 5px; }
  .chat .chat-input { font-size: 16px; }
}
@media (max-width: 420px) {
  .chat .chat-header { padding-left: 2px; }
  .chat .chat-tabs { gap: 0; }
  .chat .chat-tab { min-width: 0; padding-right: 6px; padding-left: 6px; }
}
@media (max-height: 560px) and (orientation: portrait) {
  .halo-preview { --chat-height: 144px; --chat-max-height: 30dvh; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .halo-preview:has(#chat-ui.chat:not(.is-collapsed)) .hud-left-stack .place { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .halo-preview #chat-ui.chat { transition: none; } }
