.chatIdentityActions { display: flex; align-items: center; gap: 6px; }
.chatIdentityActions > button { min-height: 44px; }
.chatIdentity .chatColorToggle { display: grid; place-items: center; width: 44px; padding: 0; }
.chatColorToggle > span { width: 23px; height: 23px; border-radius: 50%; background: var(--chat-swatch); border: 2px solid rgba(255,255,255,.7); }
.chatColorToggle[aria-expanded="true"] { outline: 1px solid var(--accent); outline-offset: 1px; }
.chatColorPicker {
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.chatColorPicker[hidden] { display: none; }
.chatRoom:has(.chatColorPicker:not([hidden])) { grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; }
.chatColorHeading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chatColorHeading strong { font-size: 13px; line-height: 1.4; }
.chatColorHeading button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.chatColorHeading .icon-close { width: 16px; height: 16px; }
.chatColorSwatches { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 4px; }
.chatColorSwatches button { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.chatColorSwatches button > span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--chat-swatch); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.chatColorSwatches button[aria-pressed="true"] > span { outline: 2px solid #fff; outline-offset: 3px; }
.chatColorCustomRow { display: flex; align-items: center; gap: 4px 12px; }
.chatColorCustom { display: flex; flex: 1.15 1 0; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.chatColorCustom input { display: block; flex: 0 0 44px; box-sizing: border-box; width: 44px; height: 44px; padding: 4px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; background: transparent; cursor: pointer; }
.chatColorCustom span { overflow-wrap: anywhere; }
.chatColorReset { flex: .85 1 0; min-width: 0; min-height: 44px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.chatColorReset[aria-pressed="true"] { border-color: rgba(255,255,255,.4); }
.chatColorPreview { justify-self: start; max-width: 100%; padding: 9px 12px; border-radius: 14px 14px 5px 14px; background: var(--chat-bubble-color); color: var(--chat-bubble-ink); font-size: 13px; overflow-wrap: anywhere; }
.chatColorPicker button:focus-visible,
.chatColorPicker input:focus-visible,
.chatColorToggle:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.chatMessage.has-custom-color:not(.is-team) .chatBubble {
  border-color: rgba(255,255,255,.24);
  background: var(--chat-bubble-color);
  color: var(--chat-bubble-ink);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.chatMessage.has-custom-color:not(.is-team) .chatBubble p,
.chatMessage.has-custom-color:not(.is-team) .chatMessageMeta strong,
.chatMessage.has-custom-color:not(.is-team) .chatMessageMeta time,
.chatMessage.has-custom-color:not(.is-team) .chatRolePill,
.chatMessage.has-custom-color:not(.is-team) .chatReplyQuote,
.chatMessage.has-custom-color:not(.is-team) .chatAcknowledgements button {
  color: var(--chat-bubble-ink);
}
.chatMessage.has-custom-color:not(.is-team) .chatRolePill,
.chatMessage.has-custom-color:not(.is-team) .chatReplyQuote,
.chatMessage.has-custom-color:not(.is-team) .chatAcknowledgements button {
  background: transparent;
}
.chatMessage.has-custom-color:not(.is-team) .chatRolePill,
.chatMessage.has-custom-color:not(.is-team) .chatReplyQuote { border-color: currentColor; }
.chatMessage.has-custom-color:not(.is-team) .chatReplyQuote > span { opacity: 1; }
.chatMessage.has-custom-color:not(.is-team) .chatAcknowledgements button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; }
html .sheet.is-mobile-editor.is-short-editor .chatColorPicker { display: none; }
html .sheet.is-mobile-editor .chatColorPicker {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(260px, 34dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 380px) {
  .chatIdentity { gap: 7px; }
  .chatIdentityActions { gap: 4px; }
  .chatIdentityActions [data-chat-change] { padding: 0 7px; }
}
