.chat-page {
  height: calc(100vh - var(--navbar-h, 0px) - 3rem);
  min-height: 34rem;
  display: grid;
  grid-template-columns: minmax(16rem, 18.5rem) minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem;
  background:
    radial-gradient(800px 320px at 0% -10%, rgba(16, 185, 129, 0.08), transparent 55%),
    #f8fafc;
}

.chat-directory,
.chat-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-directory {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.chat-global-channels {
  display: grid;
  gap: 0.12rem;
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.chat-global-channels__title {
  margin: 0 0 0.25rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.chat-global-channel {
  width: 100%;
  min-height: 2.35rem;
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-global-channel:hover,
.chat-global-channel.is-active {
  background: rgba(16, 185, 129, 0.07);
}

.chat-global-channel__icon {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f1f5f9;
  color: #64748b;
}

.chat-global-channel__icon .material-symbols-outlined {
  display: grid;
  place-items: center;
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.95rem;
  line-height: 1;
}

.chat-global-channel:first-of-type .chat-global-channel__icon {
  background: #ecfdf5;
  color: #047857;
}

.chat-global-channel:nth-of-type(2) .chat-global-channel__icon {
  background: #fff7ed;
  color: #ea580c;
}

.chat-global-channel__copy {
  min-width: 0;
  display: grid;
}

.chat-global-channel__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-global-channel__name {
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 780;
}

.chat-global-channel.is-active .chat-global-channel__name {
  color: #047857;
}

.chat-directory__tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0.65rem 0.75rem 0.55rem;
  padding: 0.18rem;
  border-radius: 8px;
  background: #f1f5f9;
}

.chat-create-group-trigger {
  height: 2.15rem;
  margin: 0 0.75rem 0.55rem;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 7px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.chat-page[data-chat-mode="group"] .chat-create-group-trigger {
  display: inline-flex;
}

.chat-create-group-trigger:hover {
  background: #d1fae5;
}

.chat-create-group-trigger .material-symbols-outlined {
  font-size: 1rem;
}

.chat-directory__tab {
  position: relative;
  z-index: 1;
  min-height: 1.9rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.chat-directory__tab.is-active {
  background: #ffffff;
  color: #065f46;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.chat-directory__search {
  height: 2.35rem;
  margin: 0 0.75rem 0.65rem;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.65rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f1f5f9;
  color: #94a3b8;
}

.chat-directory__search .material-symbols-outlined {
  font-size: 1.05rem;
}

.chat-directory__search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 0.82rem;
}

.chat-directory__search input::placeholder {
  color: #94a3b8;
}

.chat-directory__search:focus-within {
  border-color: rgba(16, 185, 129, 0.25);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.chat-thread-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.45rem 0.55rem;
  scrollbar-gutter: stable;
}

.chat-thread {
  width: 100%;
  min-height: 4rem;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.chat-thread:hover,
.chat-thread.is-active {
  background: rgba(16, 185, 129, 0.07);
}

.chat-thread.is-active {
  box-shadow: none;
}

.chat-thread__avatar,
.chat-panel__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 800;
}

.chat-avatar-tone-0 {
  background: #ecfdf5;
  color: #047857;
}

.chat-avatar-tone-1 {
  background: #eff6ff;
  color: #2563eb;
}

.chat-avatar-tone-2 {
  background: #f5f3ff;
  color: #7c3aed;
}

.chat-avatar-tone-3 {
  background: #fff7ed;
  color: #c2410c;
}

.chat-avatar-tone-4 {
  background: #fff1f2;
  color: #be123c;
}

.chat-avatar-tone-5 {
  background: #ecfeff;
  color: #0e7490;
}

.chat-thread.is-active .chat-thread__name {
  color: #047857;
}

.chat-thread__avatar {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.74rem;
}

.chat-thread__body {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.chat-thread__name,
.chat-thread__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread__name {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 760;
}

.chat-thread__meta {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 500;
}

.chat-thread__meta-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread__meta-separator,
.chat-thread__meta-date {
  flex: 0 0 auto;
}

.chat-thread__badge {
  min-width: 1.18rem;
  height: 1.18rem;
  padding: 0 0.32rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
  justify-self: end;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-panel.is-call-active {
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 50%);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-panel.is-call-active .chat-panel__header {
  grid-column: 1 / -1;
}

.chat-panel.is-call-active .chat-panel__body {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid #e2e8f0;
}

.chat-panel.is-call-active .chat-composer {
  grid-column: 1;
  grid-row: 3;
  border-right: 1px solid #e2e8f0;
}

.chat-panel.is-call-active .chat-call-panel {
  grid-column: 2;
  grid-row: 2 / 4;
  border-left: 0;
}

.chat-panel.is-call-focus {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-panel.is-call-focus .chat-panel__body,
.chat-panel.is-call-focus .chat-composer {
  display: none;
}

.chat-panel.is-call-focus .chat-call-panel {
  grid-column: 1;
  grid-row: 2;
}

.chat-panel__header {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
}

.chat-panel__avatar {
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 2.65rem;
  font-size: 0.84rem;
}

.chat-panel__identity {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.chat-panel__identity h1 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.15;
}

.chat-panel__identity span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
}

.chat-panel__actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.chat-panel__action-anchor {
  position: relative;
  display: inline-flex;
}

.chat-panel__action {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
}

.chat-panel__action:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.chat-panel__action--settings {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.chat-panel__action--pins {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.chat-panel__action--settings:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #334155;
}

.chat-panel__action--pins:hover,
.chat-panel__action--pins[aria-expanded="true"] {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #334155;
}

.chat-panel__action .material-symbols-outlined {
  font-size: 1.1rem;
}

.chat-pins-dropdown[hidden] {
  display: none;
}

.chat-pins-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 30;
  width: min(22rem, 70vw);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.chat-pins-dropdown__header {
  min-height: 2.7rem;
  display: flex;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

.chat-pins-dropdown__header strong {
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-pins-dropdown__body {
  max-height: min(24rem, 55vh);
  overflow-y: auto;
  padding: 0.45rem;
}

.chat-pins-dropdown__empty {
  min-height: 7.5rem;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  color: #64748b;
}

.chat-pins-dropdown__empty .material-symbols-outlined {
  justify-self: center;
  font-size: 1.1rem;
  color: #94a3b8;
}

.chat-pins-dropdown__empty p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-pins-dropdown__list {
  display: grid;
  gap: 0.35rem;
}

.chat-pins-dropdown__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  width: 100%;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background: #f8fafc;
}

.chat-pins-dropdown__item:hover {
  border-color: #dbe4ee;
  background: #f1f5f9;
}

.chat-pins-dropdown__jump {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-pins-dropdown__unpin {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.chat-pins-dropdown__unpin:hover,
.chat-pins-dropdown__unpin:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.chat-pins-dropdown__unpin .material-symbols-outlined {
  font-size: 1rem;
}

.chat-pins-dropdown__meta {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 750;
}

.chat-pins-dropdown__meta strong {
  color: #334155;
  font-size: 0.7rem;
  font-weight: 800;
}

.chat-pins-dropdown__text {
  margin: 0;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.chat-panel__body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 2rem;
  background: #ffffff;
}

.chat-call-panel[hidden],
.chat-call-toast[hidden] {
  display: none;
}

.chat-call-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #f8fafc;
}

.chat-call-panel__header {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.chat-call-panel__header p {
  margin: 0 0 0.14rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-call-panel__header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 820;
  line-height: 1.2;
}

.chat-call-panel__tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.chat-call-panel__status {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0 0.62rem;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 760;
  white-space: nowrap;
}

.chat-call-panel__fullscreen {
  width: 1.95rem;
  height: 1.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
}

.chat-call-panel__fullscreen:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.chat-call-panel__fullscreen .material-symbols-outlined {
  font-size: 1.05rem;
}

.chat-call-panel__videos {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  overflow: auto;
}

.chat-panel.is-call-focus .chat-call-panel__videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  align-content: center;
}

.chat-call-panel__empty {
  min-height: 17rem;
  grid-column: 1 / -1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.5rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
}

.chat-call-panel__empty .material-symbols-outlined {
  color: #94a3b8;
  font-size: 2rem;
}

.chat-call-panel__empty p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 720;
}

.chat-call-tile {
  position: relative;
  min-height: 12rem;
  flex: 1 1 12rem;
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #0f172a;
}

.chat-call-tile__media {
  width: 100%;
  height: 100%;
  min-height: 12rem;
  display: grid;
  place-items: center;
  background: #0f172a;
}

.chat-panel.is-call-focus .chat-call-tile,
.chat-panel.is-call-focus .chat-call-tile__media {
  min-height: 18rem;
}

.chat-call-tile__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-call-tile__name {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  max-width: calc(100% - 1.3rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.28rem 0.52rem;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.74);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 780;
}

.chat-call-panel__controls {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.chat-call-panel__incoming,
.chat-call-panel__active-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.chat-call-control,
.chat-call-button {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid #dbe4ee;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.chat-call-control {
  width: 2.4rem;
  padding: 0;
}

.chat-call-button {
  padding: 0 0.85rem;
}

.chat-call-control:hover,
.chat-call-button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.chat-call-button--accept {
  border-color: #059669;
  background: #059669;
  color: #ffffff;
}

.chat-call-button--accept:hover {
  border-color: #047857;
  background: #047857;
}

.chat-call-button--decline,
.chat-call-button--end {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
}

.chat-call-button--decline:hover,
.chat-call-button--end:hover {
  border-color: #b91c1c;
  background: #b91c1c;
}

.chat-call-button .material-symbols-outlined,
.chat-call-control .material-symbols-outlined {
  font-size: 1.05rem;
}

.chat-call-toast {
  position: absolute;
  right: 1rem;
  bottom: 5.25rem;
  z-index: 50;
  width: min(23rem, calc(100% - 2rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.chat-call-toast div {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.chat-call-toast strong {
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 850;
}

.chat-call-toast span {
  overflow: hidden;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-call-toast button {
  min-height: 2rem;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 780;
}

.chat-call-toast button[data-chat-call-toast-open] {
  padding: 0 0.75rem;
  border-color: #059669;
  background: #059669;
  color: #ffffff;
}

.chat-call-toast button[data-chat-call-toast-close] {
  width: 2rem;
  padding: 0;
}

.chat-message-context-menu[hidden] {
  display: none;
}

.chat-message-context-menu {
  position: fixed;
  z-index: 60;
  min-width: 10.5rem;
  display: grid;
  gap: 0.18rem;
  padding: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.chat-message-context-menu__item {
  min-height: 2rem;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: left;
}

.chat-message-context-menu__item .material-symbols-outlined {
  font-size: 0.95rem;
  color: #64748b;
}

.chat-message-context-menu__item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.chat-message-context-menu__item:hover .material-symbols-outlined {
  color: #334155;
}

.chat-empty-state {
  height: 100%;
  min-height: 12rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.45rem;
  color: #94a3b8;
  text-align: center;
}

.chat-empty-state .material-symbols-outlined {
  font-size: 2rem;
  color: #cbd5e1;
}

.chat-empty-state p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 650;
}

.chat-message-stack {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.78rem;
}

.chat-system-log {
  align-self: center;
  max-width: min(90%, 38rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.1rem auto;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}

.chat-system-log .material-symbols-outlined {
  flex: 0 0 auto;
  color: #059669;
  font-size: 0.9rem;
}

.chat-system-log time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 0.66rem;
}

.chat-message {
  width: fit-content;
  max-width: min(70%, 34rem);
  display: grid;
  gap: 0;
  position: relative;
}

.chat-message--grouped {
  margin-top: -0.58rem;
}

.chat-message__content {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 0.12rem;
}

.chat-message--out .chat-message__content {
  justify-items: end;
}

.chat-message--in {
  align-self: flex-start;
}

.chat-message--out {
  align-self: flex-end;
}

.chat-message__more {
  position: absolute;
  top: calc(50% + 0.22rem);
  right: -1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.chat-message--grouped .chat-message__more {
  top: 50%;
}

.chat-message--out .chat-message__more {
  right: auto;
  left: -1.75rem;
}

.chat-message:hover .chat-message__more,
.chat-message:focus-within .chat-message__more {
  opacity: 1;
}

.chat-message__more:hover,
.chat-message__more:focus-visible {
  background: #f1f5f9;
  color: #475569;
  opacity: 1;
  outline: none;
}

.chat-message__more .material-symbols-outlined {
  font-size: 1.05rem;
}

.chat-message__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.36rem;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 0.28rem 0.02rem;
  max-width: 100%;
}

.chat-message--out .chat-message__meta {
  justify-content: flex-end;
}

.chat-message--out .chat-message__meta > span:first-child {
  display: none;
}

.chat-message--grouped .chat-message__meta {
  display: none;
}

.chat-message__read {
  width: max-content;
  color: #94a3b8;
  font-weight: 650;
}

.chat-message__forwarded {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 760;
  padding: 0 0.2rem;
}

.chat-message--out .chat-message__forwarded {
  justify-self: end;
}

.chat-message__forwarded .material-symbols-outlined {
  font-size: 0.92rem;
}

.chat-message p {
  margin: 0;
  padding: 0.32rem 0.72rem;
  border-radius: 12px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.28;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-message--out p {
  background: #10b981;
  color: #ffffff;
}

.chat-message--group-start.chat-message--in p,
.chat-message--grouped.chat-message--in:not(.chat-message--group-end) p {
  border-bottom-left-radius: 7px;
}

.chat-message--grouped.chat-message--in p {
  border-top-left-radius: 7px;
}

.chat-message--group-start.chat-message--out p,
.chat-message--grouped.chat-message--out:not(.chat-message--group-end) p {
  border-bottom-right-radius: 7px;
}

.chat-message--grouped.chat-message--out p {
  border-top-right-radius: 7px;
}

.chat-message__question-card {
  min-width: min(20rem, 100%);
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-message--out .chat-message__question-card {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.chat-message__question-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.35;
}

.chat-message__question-options {
  display: grid;
  gap: 0.45rem;
}

.chat-message__question-option {
  width: 100%;
  min-height: 2.45rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
}

.chat-message__question-option:disabled {
  cursor: wait;
  opacity: 0.72;
}

.chat-message__question-option-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-message__question-option:hover {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.chat-message__question-option.is-selected {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}

.chat-message__question-option .material-symbols-outlined {
  font-size: 1rem;
}

.chat-message__question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 750;
}

.chat-message__question-results {
  border: 0;
  background: transparent;
  color: #047857;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-message__mention {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0 0.08rem;
  padding: 0.06rem 0.34rem;
  border-radius: 6px;
  background: #dcfce7;
  color: #047857;
  font-weight: 800;
  line-height: 1.25;
  vertical-align: baseline;
}

.chat-message--out .chat-message__mention {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.chat-message--mentions-me.chat-message--in p {
  border-left: 3px solid #10b981;
}

.chat-message--mentions-me.chat-message--in .chat-message__mention {
  background: #bbf7d0;
  color: #065f46;
}

.chat-message__reply {
  min-width: min(16rem, 100%);
  display: grid;
  gap: 0.08rem;
  padding: 0.42rem 0.58rem;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #10b981;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #334155;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-message--out .chat-message__reply {
  justify-self: end;
}

.chat-message__reply:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  border-left-color: #059669;
}

.chat-message__reply-author,
.chat-message__reply-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message__reply-author {
  color: #047857;
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-message__reply-text {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 600;
}

.chat-message--jump-highlight p,
.chat-message--jump-highlight .chat-message__attachment-group,
.chat-message--jump-highlight .chat-message__entity {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.chat-message__reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  padding-top: 0.12rem;
}

.chat-message--out .chat-message__reactions {
  justify-content: flex-end;
}

.chat-message__reactions--empty {
  position: absolute;
  top: calc(50% + 0.22rem);
  left: calc(100% + 1.75rem);
  z-index: 3;
  max-height: none;
  overflow: visible;
  opacity: 0;
  padding-top: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.16s ease;
}

.chat-message--out .chat-message__reactions--empty {
  right: calc(100% + 1.75rem);
  left: auto;
}

.chat-message--grouped .chat-message__reactions--empty {
  top: 50%;
}

.chat-message:hover .chat-message__reactions--empty,
.chat-message:focus-within .chat-message__reactions--empty {
  opacity: 1;
  pointer-events: auto;
}

.chat-message__reactions--empty .chat-message__reaction-add {
  min-width: 1.75rem;
  width: 1.75rem;
  min-height: 1.75rem;
  height: 1.75rem;
  padding: 0;
}

.chat-message__reaction,
.chat-message__reaction-add,
.chat-message__reaction-menu button {
  min-width: 1.8rem;
  min-height: 1.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.chat-message__reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.12rem 0.42rem;
}

.chat-message__reaction strong {
  font-size: 0.68rem;
}

.chat-message__reaction:hover,
.chat-message__reaction.is-active {
  border-color: rgba(16, 185, 129, 0.45);
  background: #ecfdf5;
  color: #047857;
}

.chat-message__reaction-picker {
  position: relative;
  display: inline-flex;
}

.chat-message__reaction-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #64748b;
}

.chat-message__reaction-add .material-symbols-outlined {
  font-size: 0.95rem;
}

.chat-message__reaction-menu {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 0.35rem);
  left: 0;
  display: none;
  grid-template-columns: repeat(6, 1.8rem);
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.chat-message__reaction-menu::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -0.4rem;
  left: 0;
  height: 0.4rem;
}

.chat-message--out .chat-message__reaction-menu {
  right: 0;
  left: auto;
}

.chat-message__reaction-picker:hover .chat-message__reaction-menu,
.chat-message__reaction-picker:focus-within .chat-message__reaction-menu {
  display: grid;
}

.chat-message__reaction-menu button {
  padding: 0;
}

.chat-message__reaction-menu button:hover,
.chat-message__reaction-add:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: #ecfdf5;
  color: #047857;
  transform: translateY(-1px);
}

.chat-message__entity {
  min-width: min(18rem, 100%);
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.chat-message--out .chat-message__entity {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.94);
}

.chat-message__entity-icon {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 1.05rem;
}

.chat-message__entity-copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.chat-message__entity-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.chat-message__entity-name {
  min-width: 0;
  overflow: hidden;
  color: #047857;
  font-size: 0.86rem;
  font-weight: 820;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message__entity-meta {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message__attachment-group {
  min-width: min(24rem, 100%);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-message--out .chat-message__attachment-group {
  background: rgba(255, 255, 255, 0.94);
}

.chat-message__attachment-group header {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}

.chat-message__attachment-group header .material-symbols-outlined {
  color: #047857;
  font-size: 1rem;
}

.chat-message__attachment-group header strong {
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-message__attachment-list {
  display: grid;
}

.chat-message__image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.45rem;
  padding: 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.chat-message__image-preview {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
  aspect-ratio: 4 / 3;
  display: block;
}

.chat-message__image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-message__attachment-row {
  min-width: 0;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  text-decoration: none;
}

.chat-message__attachment-row:last-child {
  border-bottom: 0;
}

.chat-message__attachment-row:hover {
  background: rgba(16, 185, 129, 0.06);
}

.chat-message__attachment-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.95rem;
}

.chat-message__attachment-row--ticket .chat-message__attachment-icon {
  background: #eff6ff;
  color: #2563eb;
}

.chat-message__attachment-row--report .chat-message__attachment-icon {
  background: #f5f3ff;
  color: #7c3aed;
}

.chat-message__attachment-row--campaign .chat-message__attachment-icon {
  background: #fff7ed;
  color: #ea580c;
}

.chat-message__attachment-copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.chat-message__attachment-copy strong,
.chat-message__attachment-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message__attachment-copy strong {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}

.chat-message__attachment-copy span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 600;
}

.chat-message__attachment-open {
  color: #047857;
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-composer {
  min-height: 4.15rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.35rem;
  align-items: end;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.chat-group-modal[hidden] {
  display: none;
}

.chat-settings-modal[hidden],
.chat-forward-modal[hidden],
.chat-question-results-modal[hidden] {
  display: none;
}

.chat-group-modal,
.chat-settings-modal,
.chat-forward-modal,
.chat-question-results-modal {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.chat-group-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.chat-group-modal__panel {
  position: relative;
  width: min(40rem, 100%);
  max-height: min(42rem, calc(100vh - 2rem));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.chat-group-modal__header,
.chat-group-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}

.chat-group-modal__footer {
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  border-bottom: 0;
}

.chat-group-modal__eyebrow {
  margin: 0 0 0.2rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chat-group-modal__header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 850;
}

.chat-group-modal__close {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
}

.chat-group-modal__step {
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem;
}

.chat-group-modal__avatar {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
}

.chat-group-modal__field,
.chat-group-modal__search {
  display: grid;
  gap: 0.4rem;
}

.chat-group-modal__field span {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}

.chat-group-modal__field input,
.chat-group-modal__search input {
  min-width: 0;
  height: 2.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  outline: 0;
  padding: 0 0.75rem;
  color: #0f172a;
  font: inherit;
  font-size: 0.86rem;
}

.chat-group-modal__search {
  position: relative;
  margin-bottom: 0.75rem;
}

.chat-group-modal__search .material-symbols-outlined {
  position: absolute;
  left: 0.72rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.05rem;
}

.chat-group-modal__search input {
  padding-left: 2.15rem;
}

.chat-group-modal__selected {
  min-height: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.chat-group-selected {
  min-width: 0;
  max-width: 12rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.35rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.74rem;
  font-weight: 800;
}

.chat-group-selected__avatar,
.chat-group-member__avatar {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-group-selected__remove {
  width: 1.2rem;
  height: 1.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.12);
  color: #047857;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.chat-group-modal__members {
  max-height: 17rem;
  overflow-y: auto;
  display: grid;
  gap: 0.35rem;
}

.chat-group-member {
  min-width: 0;
  min-height: 3.05rem;
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.chat-group-member__copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.chat-group-member__name,
.chat-group-member__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-group-member__name {
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 820;
}

.chat-group-member__meta {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
}

.chat-group-member__toggle {
  height: 1.85rem;
  border: 1px solid #d1fae5;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  padding: 0 0.65rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-group-member.is-selected .chat-group-member__toggle {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.chat-group-modal__status {
  margin: 0;
  padding: 0 1.1rem 0.75rem;
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 750;
}

.chat-group-modal__primary,
.chat-group-modal__secondary {
  min-height: 2.15rem;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 850;
}

.chat-group-modal__primary {
  background: #10b981;
  color: #ffffff;
}

.chat-group-modal__primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-group-modal__secondary {
  background: #f1f5f9;
  color: #475569;
}

.chat-settings-modal__panel {
  width: min(34rem, 100%);
  grid-template-rows: auto minmax(12rem, 1fr);
}

.chat-settings-modal__body {
  min-height: 12rem;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-forward-modal__panel {
  width: min(34rem, 100%);
  grid-template-rows: auto auto minmax(12rem, 1fr) auto;
}

.chat-question-results-modal__panel {
  width: min(34rem, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-question-results-modal__body {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
}

.chat-forward-modal__search {
  position: relative;
  margin: 1rem 1.1rem 0.75rem;
}

.chat-forward-modal__search .material-symbols-outlined {
  position: absolute;
  left: 0.72rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.05rem;
}

.chat-forward-modal__search input {
  width: 100%;
  min-width: 0;
  height: 2.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  outline: 0;
  padding: 0 0.75rem 0 2.15rem;
  color: #0f172a;
  font: inherit;
  font-size: 0.86rem;
}

.chat-forward-modal__body {
  min-height: 12rem;
  max-height: 24rem;
  overflow-y: auto;
  padding: 0 1.1rem 1rem;
}

.chat-forward-modal__section {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.chat-forward-modal__section-title {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chat-forward-destination {
  width: 100%;
  min-width: 0;
  min-height: 3.1rem;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  text-align: left;
  font: inherit;
}

.chat-forward-destination:hover {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.chat-forward-destination__avatar {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-forward-destination__copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.chat-forward-destination__name,
.chat-forward-destination__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-forward-destination__name {
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 820;
}

.chat-forward-destination__meta {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
}

.chat-forward-destination__action {
  color: #059669;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-forward-modal__empty,
.chat-forward-modal__status {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-forward-modal__status {
  padding: 0 1.1rem 1rem;
  color: #047857;
}

.chat-question-results {
  display: grid;
  gap: 1rem;
}

.chat-question-results__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.chat-question-results__summary-copy {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.chat-question-results__summary-copy strong {
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.35;
}

.chat-question-results__summary-copy span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 750;
}

.chat-question-results__export {
  flex: 0 0 auto;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  padding: 0 0.65rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 850;
}

.chat-question-results__export:hover {
  border-color: #a7f3d0;
  background: #d1fae5;
}

.chat-question-results__export .material-symbols-outlined {
  font-size: 1rem;
}

.chat-question-results__options {
  display: grid;
  gap: 0.8rem;
}

.chat-question-results__option {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.chat-question-results__option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 800;
}

.chat-question-results__option-head span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 850;
}

.chat-question-results__bar {
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.chat-question-results__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #10b981;
}

.chat-question-results__voters {
  display: grid;
  gap: 0.45rem;
}

.chat-question-results__voters p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-question-results__voter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 760;
}

.chat-question-results__avatar {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-settings-tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}

.chat-settings-tab {
  min-height: 2.8rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 780;
}

.chat-settings-tab.is-active {
  border-bottom-color: #10b981;
  color: #047857;
}

.chat-settings-content {
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem;
}

.chat-settings-section {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.chat-settings-section:last-child {
  margin-bottom: 0;
}

.chat-settings-section h3,
.chat-settings-section__head h3 {
  margin: 0;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-settings-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-settings-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chat-settings-segmented button {
  min-height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 760;
}

.chat-settings-segmented button.is-active {
  border-color: rgba(16, 185, 129, 0.32);
  background: #ecfdf5;
  color: #047857;
}

.chat-settings-field {
  display: grid;
  gap: 0.35rem;
}

.chat-settings-field span {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 780;
}

.chat-settings-field input {
  height: 2.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 0.7rem;
  font: inherit;
}

.chat-settings-save-name {
  width: max-content;
  min-height: 2rem;
  border: 0;
  border-radius: 7px;
  background: #10b981;
  color: #ffffff;
  cursor: pointer;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
}

.chat-settings-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chat-settings-danger button {
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  padding: 0 0.8rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 820;
}

.chat-settings-add-member {
  min-height: 1.9rem;
  border: 0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  padding: 0 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 850;
}

.chat-settings-members {
  display: grid;
}

.chat-settings-add-list {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.chat-settings-add-row {
  min-width: 0;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.chat-settings-add-row button {
  min-height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  padding: 0 0.65rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-settings-empty-line {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 650;
}

.chat-settings-member {
  min-width: 0;
  min-height: 3.05rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid #f1f5f9;
}

.chat-settings-member__avatar {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.7rem;
  font-weight: 850;
}

.chat-settings-member__copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.chat-settings-member__copy strong,
.chat-settings-member__copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-settings-member__copy strong {
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 820;
}

.chat-settings-member__copy span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
}

.chat-settings-member__badge {
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-settings-member__remove {
  visibility: hidden;
  border: 0;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 850;
}

.chat-settings-member:hover .chat-settings-member__remove {
  visibility: visible;
}

.chat-settings-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.chat-settings-media-grid button {
  min-height: 4.4rem;
  display: grid;
  place-items: center;
  gap: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 820;
}

.chat-entity-preview-list {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 0.45rem;
}

.chat-entity-preview-list[hidden] {
  display: none;
}

.chat-reply-preview[hidden] {
  display: none;
}

.chat-reply-preview {
  grid-column: 1 / -1;
}

.chat-reply-preview__content {
  min-width: 0;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.chat-reply-preview__bar {
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: #10b981;
}

.chat-reply-preview__copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.chat-reply-preview__copy strong,
.chat-reply-preview__copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply-preview__copy strong {
  color: #047857;
  font-size: 0.72rem;
  font-weight: 850;
}

.chat-reply-preview__copy span {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 650;
}

.chat-reply-preview__close {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.chat-reply-preview__close:hover {
  background: #e2e8f0;
  color: #334155;
}

.chat-reply-preview__close .material-symbols-outlined {
  font-size: 1rem;
}

.chat-entity-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.95rem minmax(0, 1fr) 1.8rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 8px;
  background: #ecfdf5;
}

.chat-entity-preview__icon {
  width: 1.95rem;
  height: 1.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #ffffff;
  color: #047857;
  font-size: 1rem;
}

.chat-entity-preview__copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.chat-entity-preview__label {
  color: #047857;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.chat-entity-preview__copy strong {
  min-width: 0;
  overflow: hidden;
  color: #064e3b;
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-entity-preview__meta {
  min-width: 0;
  overflow: hidden;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
  opacity: 0.82;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-entity-preview__remove {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #047857;
  cursor: pointer;
}

.chat-entity-preview__remove:hover {
  background: rgba(16, 185, 129, 0.12);
}

.chat-entity-preview__remove .material-symbols-outlined {
  font-size: 1rem;
}

.chat-question-panel[hidden] {
  display: none;
}

.chat-question-panel {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 0.75rem;
  padding: 0.78rem;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.chat-composer__field {
  grid-column: 1 / 2;
}

.chat-composer__send {
  grid-column: 2 / 3;
}

.chat-question-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.chat-question-panel__title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-question-panel__title .material-symbols-outlined {
  font-size: 1.05rem;
}

.chat-question-panel__close {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
}

.chat-question-panel__close .material-symbols-outlined {
  font-size: 1rem;
}

.chat-question-panel__field,
.chat-question-option label {
  min-width: 0;
  display: grid;
  gap: 0.32rem;
}

.chat-question-panel__field span,
.chat-question-option span,
.chat-question-panel__section-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 820;
}

.chat-question-panel__field input,
.chat-question-option input {
  width: 100%;
  min-width: 0;
  height: 2.28rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: 0;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 0.68rem;
  font: inherit;
  font-size: 0.82rem;
}

.chat-question-panel__field input:focus,
.chat-question-option input:focus {
  border-color: #86efac;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chat-question-panel__options {
  display: grid;
  gap: 0.48rem;
}

.chat-question-option {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.9rem;
  align-items: end;
  gap: 0.45rem;
}

.chat-question-option__remove {
  width: 1.9rem;
  height: 2.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
}

.chat-question-option__remove:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-question-option__remove .material-symbols-outlined {
  font-size: 0.95rem;
}

.chat-question-panel__add {
  justify-self: start;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  padding: 0 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 850;
}

.chat-question-panel__add:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.chat-question-panel__add .material-symbols-outlined {
  font-size: 1rem;
}

.chat-question-panel__status {
  margin: 0;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-entity-search {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.6rem);
  z-index: 25;
  width: min(24rem, calc(100vw - 3rem));
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.17);
}

.chat-entity-search[hidden] {
  display: none;
}

.chat-entity-search label {
  display: grid;
  gap: 0.35rem;
}

.chat-entity-search label > span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.chat-entity-search input {
  height: 2.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 0.65rem;
  font-size: 0.84rem;
}

.chat-entity-search input:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chat-entity-search__results {
  max-height: 11rem;
  display: grid;
  gap: 0.15rem;
  overflow-y: auto;
}

.chat-entity-search__result {
  width: 100%;
  min-height: 2.45rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-entity-search__result:hover {
  background: rgba(16, 185, 129, 0.08);
}

.chat-entity-search__result strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-entity-search__result span {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
}

.chat-entity-search__empty {
  margin: 0;
  padding: 0.55rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 650;
}

.chat-mention-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.6rem);
  z-index: 24;
  width: 15rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.17);
}

.chat-mention-menu[hidden] {
  display: none;
}

.chat-mention-menu__item {
  width: 100%;
  min-height: 2.3rem;
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-mention-menu__item:hover,
.chat-mention-menu__item.is-active {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

.chat-mention-menu__item .material-symbols-outlined {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1rem;
}

.chat-mention-menu__avatar {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-mention-menu__item:hover .material-symbols-outlined,
.chat-mention-menu__item.is-active .material-symbols-outlined {
  background: #ecfdf5;
  color: #047857;
}

.chat-mention-menu__copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.chat-mention-menu__name {
  font-size: 0.82rem;
  font-weight: 780;
  line-height: 1.15;
}

.chat-mention-menu__hint {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 650;
}

.chat-composer__field {
  position: relative;
  min-width: 0;
  min-height: 2.55rem;
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  align-items: end;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.chat-composer__field:focus-within {
  border-color: #e2e8f0;
  background: #ffffff;
  box-shadow: none;
}

.chat-composer__field > textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.45rem;
  max-height: 8rem;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 0.64rem 0.75rem 0.58rem 0;
  outline: 0;
  overflow-y: hidden;
  overscroll-behavior: contain;
  resize: none;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
}

@media (min-width: 821px) {
  html:has(.chat-page),
  body:has(.chat-page) {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-main:has(.chat-page) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-main:has(.chat-page) > div:has(.chat-page),
  .comms-page:has(.chat-page) {
    height: calc(100dvh - var(--content-top-gap, 0px));
    min-height: 0;
    overflow: hidden;
  }

  .chat-page {
    height: calc(100dvh - 50px - var(--content-top-gap, 0px));
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
  }
}

.chat-composer__field > textarea:focus,
.chat-composer__field > textarea:focus-visible {
  border: 0 !important;
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.chat-composer__icon,
.chat-composer__send {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1;
}

.chat-composer__icon {
  border: 0;
  background: transparent;
  color: #64748b;
}

.chat-composer__actions {
  position: relative;
  width: 2.35rem;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-composer__icon:hover,
.chat-composer__actions.is-open .chat-composer__icon {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

.chat-composer__file {
  display: none;
}

.chat-attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.55rem);
  z-index: 20;
  width: 14rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.chat-composer__actions:not(.is-open) .chat-attach-menu {
  display: none;
}

.chat-attach-menu__item {
  width: 100%;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-attach-menu__item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.chat-attach-menu__item--platform:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

.chat-attach-menu__item .material-symbols-outlined {
  width: 1.15rem;
  color: #64748b;
  font-size: 1.05rem;
}

.chat-attach-menu__item--platform:hover .material-symbols-outlined {
  color: #047857;
}

.chat-attach-menu__separator {
  height: 1px;
  margin: 0.25rem 0.15rem;
  background: #e2e8f0;
}

.chat-attach-menu__title {
  margin: 0.2rem 0.55rem 0.1rem;
  color: #94a3b8;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.chat-composer__send {
  border: 1px solid #10b981;
  background: #10b981;
  color: #ffffff;
  padding: 0;
}

.chat-composer__icon .material-symbols-outlined,
.chat-composer__send .material-symbols-outlined {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 820px) {
  .chat-page {
    height: auto;
    min-height: calc(100vh - var(--navbar-h, 0px) - 3rem);
    grid-template-columns: 1fr;
  }

  .chat-directory {
    max-height: 18rem;
  }

  .chat-panel {
    min-height: 28rem;
  }

  .chat-panel.is-call-active {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chat-panel.is-call-active .chat-panel__body,
  .chat-panel.is-call-active .chat-composer {
    display: none;
  }

  .chat-panel.is-call-active .chat-call-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .chat-panel__body {
    padding: 1rem 1rem;
  }

  .chat-message {
    max-width: 84%;
  }
}
.chat-history-tools { position: absolute; top: calc(100% + .45rem); right: 0; z-index: 20; width: 15.5rem; padding: .5rem; border: 1px solid #dbe4ee; border-radius: 8px; background: #fff; box-shadow: 0 10px 28px rgba(15, 23, 42, .14); }
.chat-history-tools[hidden] { display: none; }
.chat-history-tools label { display: flex; align-items: center; gap: .35rem; padding: .42rem .55rem; border: 1px solid #dbe4ee; border-radius: 6px; color: #64748b; }
.chat-history-tools input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #0f172a; font: inherit; font-size: .78rem; }
.chat-load-older { position: absolute; top: 5.2rem; left: 50%; z-index: 5; transform: translateX(-50%); padding: .3rem .65rem; border: 1px solid #dbe4ee; border-radius: 999px; background: rgba(255,255,255,.94); color: #047857; box-shadow: 0 2px 8px rgba(15,23,42,.08); font: inherit; font-size: .7rem; font-weight: 750; cursor: pointer; }
.chat-panel__feedback { position: absolute; right: 1rem; bottom: 4.55rem; z-index: 8; max-width: min(24rem, calc(100% - 2rem)); margin: 0; padding: .4rem .65rem; border: 1px solid #dbe4ee; border-radius: 7px; background: rgba(255,255,255,.96); color: #64748b; box-shadow: 0 4px 14px rgba(15,23,42,.08); font-size: .72rem; }
.chat-panel__feedback[data-kind='error'] { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.chat-typing-indicator { position: absolute; left: 1rem; bottom: 4.35rem; z-index: 6; margin: 0; padding: .25rem .55rem; border-radius: 999px; background: rgba(255,255,255,.92); color: #047857; font-size: .72rem; }
.chat-message-context-menu__item--danger { color: #b91c1c; }
.chat-date-separator { display: flex; justify-content: center; margin: .75rem 0; color: var(--app-text-soft); font-size: .7rem; }
.chat-date-separator span { padding: .2rem .6rem; border-radius: 999px; background: var(--app-surface-muted); }
.chat-message--failed .chat-message__content { outline: 1px solid #dc2626; }
.chat-message__retry { border: 0; background: transparent; color: #dc2626; font: inherit; font-size: .7rem; cursor: pointer; }
