﻿/* conversation-topbar.css */
.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto;
  align-items: center;
  gap: 0.75rem;
  background: var(--header);
  min-height: 5rem;
  padding: 0.78rem 0.9rem;
  border-bottom: 0.0625rem solid var(--stroke);
  backdrop-filter: blur(0.8rem) saturate(135%);
}

body .chat-header {
  background: var(--header);
  border-bottom-color: var(--glass-border);
}

.media-history-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 0.0625rem solid var(--stroke);
  background: rgba(255, 255, 255, 0.42);
  max-height: 14rem;
  overflow-y: auto;
}

.media-history-panel[hidden] {
  display: none;
}

body .media-history-panel {
  background: var(--panel-strong);
  border-bottom-color: var(--glass-border);
}

.media-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink);
}

.media-history-header span,
.media-history-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.media-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.6rem;
}

.media-history-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.55rem;
  border-radius: var(--radius);
  border: 0.0625rem solid var(--glass-border);
  background: rgba(255, 255, 255, 0.46);
}

body .media-history-item {
  background: var(--panel-strong);
  border-color: var(--glass-border);
}

/* right-panel-chat.css */
.ai-panel {
  min-width: 0;
  min-height: 0;
}

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

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-bottom: 0.0625rem solid var(--stroke);
  background: var(--header);
}

.right-panel-header {
  min-height: 5rem;
}

.right-panel-heading {
  min-width: 0;
}

.ai-panel-header h2,
.ai-panel-header p {
  margin: 0;
}

.ai-panel-header h2 {
  font-size: 1rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-toggle {
  min-height: 2rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(102, 119, 129, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.ai-toggle.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-dark);
}

.right-panel-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.right-panel-tab {
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 0.0625rem solid transparent;
  border-radius: 0.55rem;
  background: rgba(102, 119, 129, 0.12);
  color: var(--muted);
}

.right-panel-tab img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.right-panel-tab#rightPanelAiBtn img {
  width: 1.42rem;
  height: 1.42rem;
}

.right-panel-tab:hover,
.right-panel-tab:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, rgba(102, 119, 129, 0.12));
}

.right-panel-tab.active {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.right-panel-tab.active img {
  opacity: 1;
}

.right-panel-tab.has-notifications::after {
  content: attr(data-notification-count);
  min-width: 1rem;
  height: 1rem;
  position: absolute;
  top: -0.32rem;
  right: -0.32rem;
  display: grid;
  place-items: center;
  padding: 0 0.25rem;
  border: 0.125rem solid var(--panel);
  border-radius: 999px;
  background: #e5484d;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0.25rem 0.75rem rgba(229, 72, 77, 0.32);
}

.ai-panel-body {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.ai-panel-body[data-right-panel-view="ai-chat"] {
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding-bottom: 0;
}

.ai-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.25rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.55rem;
  background: rgba(102, 119, 129, 0.1);
}

.ai-mode-tab {
  min-width: 0;
  min-height: 2rem;
  padding: 0 0.45rem;
  border: 0.0625rem solid transparent;
  border-radius: 0.42rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.15;
  cursor: pointer;
}

.ai-chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
}

.ai-chat-list {
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  padding: 0.08rem 0.12rem 0.75rem 0;
}

.ai-chat-message {
  width: min(100%, 19.5rem);
  display: grid;
  gap: 0.38rem;
  padding: 0.62rem 0.68rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.5rem;
  background: var(--panel-strong);
}

.ai-chat-message.is-user {
  width: min(86%, 17rem);
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--glass-border));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-strong));
}

.ai-chat-message.is-assistant {
  align-self: flex-start;
  border-left-width: 0.18rem;
  border-left-color: color-mix(in srgb, var(--accent) 46%, var(--glass-border));
}

.ai-chat-message-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.ai-chat-message-meta strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-message p {
  margin: 0;
  color: var(--ink);
  font-size: 0.83rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-chat-rich-response {
  display: grid;
  gap: 0.42rem;
}

.ai-chat-contact-link {
  --ai-contact-link-color: var(--accent);
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.45rem;
  margin: 0 0.08rem;
  padding: 0.05rem 0.38rem;
  border: 0.0625rem solid color-mix(in srgb, var(--ai-contact-link-color) 42%, transparent);
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--ai-contact-link-color) 14%, transparent);
  color: var(--ai-contact-link-color);
  font: inherit;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  vertical-align: baseline;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.ai-chat-contact-link:hover,
.ai-chat-contact-link:focus-visible {
  border-color: color-mix(in srgb, var(--ai-contact-link-color) 68%, transparent);
  background: color-mix(in srgb, var(--ai-contact-link-color) 22%, transparent);
  outline: none;
}

.ai-chat-metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.28rem;
}

.ai-chat-metric {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.28rem 0 0.28rem 0.55rem;
  border-left: 0.15rem solid color-mix(in srgb, var(--accent) 36%, transparent);
  background: transparent;
}

.ai-chat-metric.is-success {
  border-left-color: #12b76a;
}

.ai-chat-metric.is-warning {
  border-left-color: #f59e0b;
}

.ai-chat-metric.is-money {
  border-left-color: #0ea5e9;
}

.ai-chat-metric.is-neutral {
  border-left-color: color-mix(in srgb, var(--accent) 48%, transparent);
}

.ai-chat-metric span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-metric strong {
  flex: 0 1 auto;
  min-width: 5.2rem;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.25;
  text-align: right;
  overflow-wrap: anywhere;
}

.ai-chat-bar-track {
  height: 0.34rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  overflow: hidden;
}

.ai-chat-bar-fill {
  height: 100%;
  min-width: 0.2rem;
  border-radius: inherit;
  background: var(--accent);
}

.ai-chat-metric.is-warning .ai-chat-bar-fill {
  background: #f59e0b;
}

.ai-chat-metric.is-success .ai-chat-bar-fill {
  background: #12b76a;
}

.ai-chat-metric.is-money .ai-chat-bar-fill {
  background: #0ea5e9;
}

.ai-chat-line-list {
  display: grid;
  gap: 0.24rem;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  list-style: none;
}

.ai-chat-line-list li,
.ai-chat-line-list p {
  margin: 0;
  padding: 0.1rem 0 0.1rem 0.55rem;
  border-left: 0.12rem solid color-mix(in srgb, var(--accent) 20%, transparent);
  overflow-wrap: anywhere;
}

.ai-chat-line-list .is-warning {
  border-color: color-mix(in srgb, #f59e0b 36%, var(--glass-border));
}

.ai-chat-line-list .is-success {
  border-color: color-mix(in srgb, #12b76a 36%, var(--glass-border));
}

.ai-chat-line-list .is-money {
  border-color: color-mix(in srgb, #0ea5e9 36%, var(--glass-border));
}

.ai-chat-attachment-list,
.ai-chat-attachment-draft-list {
  display: grid;
  gap: 0.35rem;
}

.ai-chat-attachment-chip,
.ai-chat-attachment-draft {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.52rem;
  align-items: center;
  padding: 0.48rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.ai-chat-attachment-chip {
  grid-template-columns: auto minmax(0, 1fr);
  color: inherit;
  text-decoration: none;
}

a.ai-chat-attachment-chip:hover,
a.ai-chat-attachment-chip:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--glass-border));
}

.ai-chat-attachment-chip img,
.ai-chat-attachment-draft img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.35rem;
  object-fit: cover;
}

.ai-chat-attachment-chip span,
.ai-chat-attachment-draft div {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.ai-chat-attachment-chip strong,
.ai-chat-attachment-chip small,
.ai-chat-attachment-draft strong,
.ai-chat-attachment-draft span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-attachment-chip strong,
.ai-chat-attachment-draft strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.ai-chat-attachment-chip small,
.ai-chat-attachment-draft span {
  color: var(--muted);
  font-size: 0.68rem;
}

.ai-chat-attachment-draft button {
  width: 1.65rem;
  height: 1.65rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin: 0 -0.9rem;
  padding: 0.68rem 0.9rem 0.75rem;
  border-top: 0.0625rem solid var(--stroke);
  background: color-mix(in srgb, var(--header) 86%, var(--panel));
}

.ai-chat-attachment-draft,
.ai-chat-toolbar,
.ai-chat-form .ai-error {
  grid-column: 1 / -1;
}

.ai-chat-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ai-chat-form textarea {
  width: 100%;
  min-height: 2.75rem;
  max-height: 7rem;
  resize: none;
  border: 0.0625rem solid var(--stroke);
  border-radius: 0.5rem;
  padding: 0.62rem 0.68rem;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.4;
  outline: none;
}

.ai-chat-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: 0 0 0 0.12rem var(--focus-ring);
}

.ai-chat-form .primary {
  align-self: stretch;
  min-width: 4.5rem;
  min-height: 2.75rem;
  border-radius: 0.5rem;
}

.ai-chat-form .ai-chat-icon-btn {
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.ai-chat-form .button-icon {
  width: 1.28rem;
  height: 1.28rem;
}

.ai-chat-form .button-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ai-mode-tab:hover,
.ai-mode-tab:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

.ai-mode-tab.active {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

.ai-summary,
.ai-list-block,
.ai-suggested-reply {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.5rem;
  background: var(--panel-strong);
}

.ai-info-row {
  display: grid;
  gap: 0.16rem;
}

.ai-info-row span,
.ai-updated,
.ai-empty {
  color: var(--muted);
  font-size: 0.75rem;
}

.ai-empty {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.55rem;
  min-height: 12rem;
  margin: 0;
  padding: 1rem;
  border: 0.0625rem dashed color-mix(in srgb, var(--accent) 24%, var(--glass-border));
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--panel) 58%, transparent);
}

.ai-empty strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.2;
}

.ai-empty span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.ai-chat-suggestions {
  width: 100%;
  display: grid;
  gap: 0.38rem;
}

.ai-chat-suggestions button {
  width: 100%;
  min-height: 2rem;
  padding: 0.42rem 0.55rem;
  border: 0.0625rem solid color-mix(in srgb, var(--accent) 22%, var(--glass-border));
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.ai-chat-suggestions button:hover,
.ai-chat-suggestions button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--glass-border));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  outline: none;
}

.ai-info-row strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.ai-list-block h3,
.ai-suggested-reply h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
}

.ai-list-block ul {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1rem;
  color: var(--ink);
  font-size: 0.82rem;
}

.ai-list-block li {
  min-width: 0;
}

.ai-list-block.is-clickable ul {
  padding-left: 0;
  list-style: none;
}

.ai-suggestion-button {
  display: block;
  width: 100%;
  min-height: 2rem;
  padding: 0.45rem 0.55rem;
  border: 0.0625rem solid color-mix(in srgb, var(--accent) 24%, var(--glass-border));
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.ai-suggestion-button:hover,
.ai-suggestion-button:focus-visible,
.ai-suggestion-card:hover,
.ai-suggestion-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 54%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.ai-list-block.is-alert {
  border-color: color-mix(in srgb, #d97706 34%, var(--glass-border));
}

.ai-coherence-status {
  display: grid;
  gap: 0.28rem;
  padding: 0.8rem;
  border: 0.0625rem solid var(--glass-border);
  border-left-width: 0.25rem;
  border-radius: 0.55rem;
  background: var(--panel-strong);
}

.ai-coherence-status h3,
.ai-coherence-status p {
  margin: 0;
}

.ai-coherence-status h3 {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
}

.ai-coherence-status p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.38;
}

.ai-coherence-status.is-healthy {
  border-left-color: #12b76a;
}

.ai-coherence-status.is-attention {
  border-left-color: #f59e0b;
}

.ai-coherence-status.is-critical {
  border-left-color: #e5484d;
}

.ai-coherence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.ai-coherence-metric {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.5rem;
  background: var(--panel-strong);
}

.ai-coherence-metric strong {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.ai-coherence-metric span,
.ai-coherence-metric small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

.ai-coherence-comparison {
  gap: 0.52rem;
}

.ai-suggestion-card {
  width: 100%;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.ai-suggested-reply p,
.ai-error {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.45;
}

.ai-error {
  color: #b42318;
}

.ai-panel-actions {
  margin-top: auto;
  padding: 0.75rem 0.9rem;
  border-top: 0.0625rem solid var(--stroke);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.ai-panel-actions[hidden] {
  display: none;
}

.right-panel-quotation-list {
  display: grid;
  gap: 0.6rem;
}

.right-panel-quotation-item {
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.5rem;
  background: var(--panel-strong);
  overflow: hidden;
}

.right-panel-quotation-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.35rem;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

.right-panel-quotation-summary::-webkit-details-marker {
  display: none;
}

.right-panel-quotation-copy {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.right-panel-quotation-copy strong,
.right-panel-quotation-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-panel-quotation-copy strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.right-panel-quotation-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.right-panel-quotation-details {
  display: grid;
  gap: 0.45rem;
  padding: 0 0.7rem 0.7rem;
}

.right-panel-quotation-details > div {
  display: grid;
  grid-template-columns: 5.3rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.55rem;
}

.right-panel-quotation-details span {
  color: var(--muted);
  font-size: 0.72rem;
}

.right-panel-quotation-details strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.right-panel-quotation-file {
  justify-self: start;
  max-width: 100%;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-panel-body[data-right-panel-view="team"] {
  align-content: stretch;
  padding: 0;
  overflow: hidden;
}

.team-chat-panel {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.team-chat-panel.has-mobile-back {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.team-chat-mobile-back {
  width: max-content;
  margin: 0.7rem 0.9rem 0;
  border: 0.0625rem solid var(--stroke);
  border-radius: 0.5rem;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.42rem 0.65rem;
  cursor: pointer;
}

.team-chat-mobile-back:hover,
.team-chat-mobile-back:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--stroke));
  outline: none;
}

.team-chat-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem;
  overflow-y: auto;
}

.team-chat-empty,
.team-chat-error {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.team-chat-error {
  color: #b42318;
}

.team-chat-message {
  max-width: 92%;
  display: grid;
  gap: 0.28rem;
  align-self: flex-start;
  padding: 0.55rem 0.65rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.55rem;
  background: var(--panel-strong);
}

.team-chat-message.is-mine {
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--accent) 26%, var(--glass-border));
  background: color-mix(in srgb, var(--accent) 11%, var(--panel-strong));
}

.team-chat-message-meta {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.team-chat-message-meta strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-chat-message-meta span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.team-chat-message p {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.team-chat-reply-card,
.team-chat-reply-preview,
.team-chat-attachment-draft,
.team-chat-form .sticker-library-panel,
.team-chat-toolbar,
.team-chat-form .team-chat-error {
  grid-column: 1 / -1;
}

.team-chat-reply-card {
  margin: 0;
}

.team-chat-message-attachment {
  max-width: 100%;
  overflow: hidden;
}

.team-chat-message-attachment .message-media-frame,
.team-chat-message-attachment .message-attachment {
  max-width: 100%;
}

.team-chat-message-attachment .message-image {
  max-height: 12rem;
}

.team-chat-mention-list,
.team-chat-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.team-chat-mention-list span {
  max-width: 100%;
  padding: 0.14rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-chat-message-actions {
  justify-content: flex-end;
}

.team-chat-message-actions button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.team-chat-message-actions button:hover,
.team-chat-message-actions button:focus-visible {
  text-decoration: underline;
  outline: none;
}

.team-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-top: 0.0625rem solid var(--stroke);
  background: var(--header);
}

.team-chat-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
}

.team-chat-toolbar [data-action="open-sticker-library"] {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.team-chat-toolbar select {
  min-width: 0;
  height: 2rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.5rem;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  padding: 0 0.55rem;
}

.team-chat-attachment-draft {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.55rem;
  background: var(--panel-strong);
}

.team-chat-attachment-draft img,
.team-chat-file-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.45rem;
}

.team-chat-attachment-draft img {
  object-fit: cover;
}

.team-chat-file-icon {
  display: grid;
  place-items: center;
  background: rgba(102, 119, 129, 0.12);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.team-chat-attachment-draft div {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

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

.team-chat-attachment-draft strong {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.team-chat-attachment-draft span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.team-chat-attachment-draft button {
  width: 1.8rem;
  height: 1.8rem;
  border: 0.0625rem solid var(--stroke);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.team-chat-form textarea {
  width: 100%;
  min-height: 2.35rem;
  max-height: 6rem;
  resize: vertical;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 0.55rem;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.55rem 0.65rem;
}

.team-chat-form textarea:focus {
  outline: 0.15rem solid var(--focus-ring);
  border-color: color-mix(in srgb, var(--accent) 52%, var(--glass-border));
}

/* chat-panel.css */
.media-history-preview {
  width: 4.25rem;
  height: 4.25rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0.75rem;
  background: rgba(102, 119, 129, 0.1);
}

.media-history-preview img,
.media-history-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-history-preview .media-history-sticker {
  object-fit: contain;
  padding: 0.25rem;
}

.media-history-icon {
  font-size: 1.35rem;
}

.media-history-body {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.2rem;
}

.media-history-body strong,
.media-history-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-history-body span {
  color: var(--muted);
  font-size: 0.72rem;
}

.media-history-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  grid-column: 1 / 3;
  flex: 1 1 auto;
}

.mobile-back-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: transparent;
  color: var(--ink);
  flex-shrink: 0;
}

.mobile-back-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.chat-avatar {
  display: none;
}

.chat-avatar[data-status]::after {
  border-color: var(--header);
}

.chat-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  grid-template-areas:
    "title chips"
    "meta chips";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.5rem;
  width: 100%;
}

.chat-title {
  grid-area: title;
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.16rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  grid-area: meta;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-window-state {
  grid-area: chips;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  align-items: center;
  align-content: center;
  justify-content: center;
  justify-items: center;
  gap: 0.32rem;
  margin-top: 0;
  justify-self: center;
  overflow: hidden;
  text-align: center;
}

.chat-header-info-line {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-info-part {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.chat-header-info-part.is-neutral {
  color: var(--muted);
}

.chat-header-info-part.is-pending-finalization {
  color: #ffd08a;
}

.chat-header-info-part.is-finalized {
  color: #8ff0c3;
}

.chat-header-info-part.is-closed {
  color: #ffb4b4;
}

.chat-header-info-separator {
  color: var(--muted);
  opacity: 0.88;
  flex: 0 0 auto;
}

.chat-info-chip {
  --chip-accent: var(--accent);
  --chip-fg: var(--ink);
  --chip-bg: color-mix(in srgb, var(--panel-strong) 76%, transparent);
  --chip-border: var(--stroke);
  --chip-icon-bg: color-mix(in srgb, var(--chip-accent) 16%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
  min-height: 1.62rem;
  max-width: 15rem;
  padding: 0.16rem 0.48rem 0.16rem 0.22rem;
  border: 0.0625rem solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.15;
  box-shadow: none;
}

.chat-info-chip.is-compact {
  min-height: 1.45rem;
  max-width: 12rem;
  padding: 0.12rem 0.44rem;
  font-size: 0.68rem;
}

.chat-info-chip.is-neutral {
  --chip-accent: var(--muted);
  --chip-fg: var(--muted);
  --chip-bg: transparent;
  --chip-border: transparent;
  --chip-icon-bg: transparent;
}

.chat-window-state .chat-info-chip.is-open,
.chat-window-state .chat-info-chip.is-timer,
.chat-window-state .chat-info-chip.is-number,
.chat-window-state .chat-info-chip.is-reference,
.chat-window-state .chat-info-chip.is-employee,
.chat-window-state .chat-info-chip.is-muted {
  --chip-accent: var(--muted);
  --chip-fg: var(--muted);
  --chip-bg: transparent;
  --chip-border: transparent;
  --chip-icon-bg: transparent;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.chat-window-state .chat-info-chip-icon,
.chat-window-state .chat-info-avatar-stack {
  display: none;
}

.chat-info-chip.is-neutral + .chat-info-chip.is-neutral::before {
  content: "·";
  margin-right: 0.12rem;
  color: var(--muted);
}

button.chat-info-chip {
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

button.chat-info-chip:hover {
  border-color: color-mix(in srgb, var(--chip-border) 72%, var(--chip-fg));
}

.chat-info-chip-icon {
  width: 1.22rem;
  height: 1.22rem;
  border-radius: 50%;
  background: var(--chip-icon-bg);
  color: var(--chip-fg);
  flex: 0 0 auto;
  opacity: 0.92;
  position: relative;
  overflow: hidden;
}

.chat-info-chip-icon::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0.22rem;
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.chat-info-chip-icon.is-window-open::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/JanelaAberta.svg");
  mask-image: url("../SVGs/Topo%20conversas/JanelaAberta.svg");
}

.chat-info-chip-icon.is-window-closed::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/JanelaFechada.svg");
  mask-image: url("../SVGs/Topo%20conversas/JanelaFechada.svg");
}

.chat-info-chip-icon.is-timer::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/Cronometro.svg");
  mask-image: url("../SVGs/Topo%20conversas/Cronometro.svg");
}

.chat-info-chip-icon.is-timer-expired::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/TempoEsgotado.svg");
  mask-image: url("../SVGs/Topo%20conversas/TempoEsgotado.svg");
}

.chat-info-chip-icon.is-number::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/numero.svg");
  mask-image: url("../SVGs/Topo%20conversas/numero.svg");
}

.chat-info-chip-icon.is-employee::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/funcionarioativo.svg");
  mask-image: url("../SVGs/Topo%20conversas/funcionarioativo.svg");
}

.chat-info-chip-icon.is-unassigned::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/semresponsavel.svg");
  mask-image: url("../SVGs/Topo%20conversas/semresponsavel.svg");
}

.chat-info-chip-icon.is-reference::before {
  -webkit-mask-image: url("../SVGs/Topo%20conversas/referencia.svg");
  mask-image: url("../SVGs/Topo%20conversas/referencia.svg");
}

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

.chat-info-avatar-stack {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 0.1rem;
}

.employee-avatar {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 0.0625rem solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.48rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.employee-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.employee-avatar.is-empty {
  padding: 0.18rem;
  background: color-mix(in srgb, var(--panel) 84%, var(--muted));
}

.chat-info-avatar + .chat-info-avatar {
  margin-left: -0.48rem;
}

.chat-info-chip.is-open,
.chat-info-chip.is-timer,
.chat-info-chip.is-employee,
.chat-info-chip.is-number,
.chat-info-chip.is-reference,
.chat-info-chip.is-closed,
.chat-info-chip.is-muted {
  --chip-accent: var(--accent);
  --chip-fg: #c7f7e4;
  --chip-bg: color-mix(in srgb, var(--accent) 18%, var(--panel-strong));
  --chip-border: color-mix(in srgb, var(--accent) 58%, transparent);
  --chip-icon-bg: color-mix(in srgb, var(--accent) 28%, transparent);
}

.chat-info-chip.is-finalized {
  --chip-accent: #22c78a;
  --chip-fg: #8ff0c3;
  --chip-bg: color-mix(in srgb, #0f6f4c 34%, var(--panel-strong));
  --chip-border: color-mix(in srgb, #22c78a 64%, transparent);
  --chip-icon-bg: color-mix(in srgb, #22c78a 24%, transparent);
}

.chat-info-chip.is-pending-finalization {
  --chip-accent: #f59e0b;
  --chip-fg: #ffd08a;
  --chip-bg: color-mix(in srgb, #7c3f00 38%, var(--panel-strong));
  --chip-border: color-mix(in srgb, #f59e0b 68%, transparent);
  --chip-icon-bg: color-mix(in srgb, #f59e0b 24%, transparent);
}

.chat-info-chip.is-closed {
  --chip-accent: #ef4444;
  --chip-fg: #ffb4b4;
  --chip-bg: color-mix(in srgb, #7f1d1d 36%, var(--panel-strong));
  --chip-border: color-mix(in srgb, #ef4444 68%, transparent);
  --chip-icon-bg: color-mix(in srgb, #ef4444 24%, transparent);
}

.start-service-btn {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.9rem 1.1rem;
  white-space: nowrap;
  box-shadow: 0 0.45rem 1.2rem color-mix(in srgb, var(--accent) 22%, transparent);
}

.start-service-btn:hover {
  background: var(--accent-stronger);
}

.start-service-btn[hidden] {
  display: none;
}

.composer-start-service {
  width: 100%;
  min-height: 2.875rem;
  justify-content: center;
}

.chat-actions {
  display: flex;
  gap: 0.45rem;
  position: relative;
  align-items: center;
  grid-column: 3;
  justify-self: end;
}

.chat-actions .chat-call-btn {
  width: 2.375rem;
  min-width: 2.375rem;
  max-width: 2.375rem;
  height: 2.375rem;
  min-height: 2.375rem;
  max-height: 2.375rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 2.375rem;
  overflow: hidden;
  color: var(--ink);
  line-height: 0;
}

.chat-call-icon {
  width: 1.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  min-height: 1.15rem;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
  filter: var(--ui-icon-strong-filter, brightness(0) invert(1));
  opacity: 0.96;
}

.menu-btn {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.menu-btn:hover {
  background: rgba(102, 119, 129, 0.12);
  color: var(--ink);
}

.menu-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  min-width: 13rem;
  border-radius: var(--radius);
  border: 0.0625rem solid var(--glass-border);
  background: var(--glass-strong);
  display: flex;
  flex-direction: column;
  padding: 0.375rem;
  z-index: 2;
  box-shadow: var(--liquid-shadow);
  backdrop-filter: blur(1rem) saturate(145%);
}

.menu[hidden] {
  display: none;
}

.menu-item {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 0.6875rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--ink);
}

.menu-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.menu-item.danger {
  color: #7a1b1b;
}

body .menu-item.danger {
  color: #ffb7b7;
}

.chat-window {
  flex: 1;
  background-color: var(--chat-bg);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 20rem),
    radial-gradient(rgba(0, 113, 95, 0.17) 0.0625rem, transparent 0.0625rem),
    radial-gradient(rgba(17, 27, 33, 0.055) 0.0625rem, transparent 0.0625rem);
  background-size: auto, 6rem 6rem, 9rem 9rem;
  background-position: 0 0, 0 0, 2.25rem 2.25rem;
  padding: 1.125rem clamp(1rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  min-height: 0;
  scroll-behavior: smooth;
}

.chat-window {
  background-color: var(--chat-bg);
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 20rem),
    radial-gradient(color-mix(in srgb, var(--accent) 13%, transparent) 0.0625rem, transparent 0.0625rem),
    radial-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 0.0625rem, transparent 0.0625rem);
}

body[data-art-wallpaper="custom"] .chat-window {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1)),
    var(--art-chat-background);
  background-size: auto, cover;
  background-position: 0 0, center;
  background-repeat: no-repeat;
}

.message {
  --message-tools-space: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: min(68%, 32rem);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.46rem 0.58rem 0.34rem;
  border-radius: var(--radius);
  background: var(--art-inbound-bubble, #ffffff);
  color: var(--art-inbound-text, var(--ink));
  border: 0.0625rem solid rgba(35, 63, 56, 0.12);
  box-shadow: 0 0.625rem 1.25rem rgba(17, 27, 33, 0.08);
  backdrop-filter: blur(0.7rem) saturate(140%);
  position: relative;
  overflow: visible;
}

.message > * {
  min-width: 0;
  max-width: 100%;
}

.message-enter {
  animation: messageFadeSlideIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  will-change: opacity, transform;
}

.message-has-tools {
  --message-tools-space: 2.15rem;
}

.message-tools-open {
  --message-tools-space: 6.55rem;
  z-index: 20;
}

body .message {
  background: var(--art-inbound-bubble, #17362f);
  border-color: var(--glass-border);
  color: var(--art-inbound-text, #f0f7f4);
  box-shadow: 0 0.75rem 1.5rem rgba(5, 20, 18, 0.18);
}

.message-image,
.message-video,
.message-sticker,
.message-attachment {
  max-width: 100%;
}

.message-image,
.message-video {
  width: min(18rem, 62vw);
}

.message-image,
.message-video,
.message-sticker {
  display: block;
  border-radius: 0.875rem;
  background: rgba(102, 119, 129, 0.08);
}

.message-image {
  height: auto;
  max-height: min(24rem, 54vh);
  object-fit: contain;
}

.message-video {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.message-sticker {
  width: 9.5rem;
  height: 9.5rem;
  object-fit: contain;
  background: transparent;
  margin-inline: auto;
}

.message-sticker.message-image,
.message-sticker.message-video {
  width: 9.5rem;
}

.message-media-frame {
  flex: 0 0 auto;
  width: min(20rem, 100%, 62vw);
  max-width: 100%;
  max-height: min(22rem, 52vh);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0.875rem;
  background: rgba(102, 119, 129, 0.08);
  line-height: 0;
}

.message-media-frame .message-image,
.message-media-frame .message-video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(22rem, 52vh);
  object-fit: contain;
  border-radius: inherit;
  background: transparent;
}

.message-media-frame .message-video {
  min-width: min(16rem, 100%);
}

.media-unavailable-placeholder {
  min-width: min(14rem, 100%);
  min-height: 3.75rem;
  display: grid;
  place-items: center;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: rgba(102, 119, 129, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.media-history-preview .media-unavailable-placeholder,
.reply-preview-media .media-unavailable-placeholder {
  min-width: 100%;
  min-height: 100%;
  padding: 0.35rem;
  font-size: 0.62rem;
}

body .media-unavailable-placeholder {
  background: rgba(255, 255, 255, 0.08);
  color: #afc2bd;
}

.message-media-frame.is-sticker {
  width: 9.5rem;
  height: 9.5rem;
  max-height: none;
  margin-inline: auto;
  overflow: visible;
  background: transparent;
}

.message-media-frame.is-sticker .message-sticker {
  max-width: 100%;
  max-height: 100%;
}

.message p {
  width: 100%;
  max-width: 100%;
  padding-right: var(--message-tools-space);
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.message.inbound p {
  padding-right: 0;
  padding-left: var(--message-tools-space);
}

.message-has-tools .message-author {
  padding-right: var(--message-tools-space);
}

.message-has-tools.inbound .message-author {
  padding-right: 0;
  padding-left: var(--message-tools-space);
}

.message-reply-preview,
.composer-reply-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  border-left: 0.1875rem solid var(--accent-strong);
  border-radius: 0.75rem;
  background: rgba(17, 27, 33, 0.06);
  color: var(--ink);
}

.message-reply-preview {
  margin-bottom: 0.45rem;
  padding: 0.5rem 0.55rem;
}

.message-reply-preview.is-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.message-reply-preview.is-clickable:hover,
.message-reply-preview.is-clickable:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left-color: var(--accent-strong);
  outline: none;
  transform: translateY(-0.0625rem);
}

.message-has-tools .message-reply-preview {
  margin-right: var(--message-tools-space);
}

.message-has-tools.inbound .message-reply-preview {
  margin-right: 0;
  margin-left: var(--message-tools-space);
}

.composer-reply-preview {
  padding: 0.625rem 0.75rem;
  background: rgba(255, 255, 255, 0.34);
  border: 0.0625rem solid var(--glass-border);
  border-left-width: 0.1875rem;
}

.composer-reply-preview.is-cancellable.has-media {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

body .message-reply-preview,
body .composer-reply-preview {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border);
  border-left-color: var(--accent);
  color: var(--ink);
}

body .message-reply-preview.is-clickable:hover,
body .message-reply-preview.is-clickable:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left-color: var(--accent-dark);
}

.reply-preview-body {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
}

.reply-preview-author,
.reply-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview-author {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

body .reply-preview-author {
  color: var(--accent-dark);
}

.reply-preview-text {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.reply-preview-media {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.55rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(102, 119, 129, 0.12);
  color: var(--muted);
}

.reply-preview-media img,
.reply-preview-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reply-preview-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.reply-preview-cancel {
  width: 1.8rem;
  height: 1.8rem;
  border: 0.0625rem solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.reply-preview-cancel:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--stroke));
}

body .reply-preview-cancel {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border);
  color: var(--ink);
}

.message-author {
  margin-bottom: 0.25rem;
  color: #006b53;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
}

body .message-author {
  color: var(--accent-dark);
}

.message.inbound {
  align-self: flex-start;
  border-top-left-radius: 0.25rem;
}

.message.outbound {
  align-self: flex-end;
  max-width: min(64%, 30rem);
  background: var(--art-outbound-bubble, #c8f6c5);
  color: var(--art-outbound-text, var(--ink));
  border-top-right-radius: 0.25rem;
}

body .message.outbound {
  background: var(--art-outbound-bubble, #176f59);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--art-outbound-text, #f2fff8);
}

.message.message-jump-highlight {
  animation: messageJumpPulse 1.5s ease-out both;
}

body .message.outbound .message-time {
  color: #b8d6cc;
}

body .message.inbound .message-time {
  color: #afc2bd;
}

.message.outbound.message-sending {
  opacity: 0.82;
}

.message.outbound.message-sending::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-100%);
  animation: sendingSweep 1.2s ease-in-out infinite;
  pointer-events: none;
}

.message.outbound.message-failed {
  background: rgba(214, 86, 86, 0.12);
  border: 0.0625rem solid rgba(214, 86, 86, 0.28);
}

body .message.outbound.message-failed {
  border-color: rgba(255, 183, 183, 0.24);
}

.message.note {
  align-self: center;
  max-width: 30rem;
  background: #fff3c4;
  color: #5c4b16;
  font-size: 0.75rem;
  box-shadow: none;
}

body .message.note {
  background: rgba(255, 243, 196, 0.14);
  color: #ffe29b;
}

.message-caption {
  display: block;
  margin-top: 0.5rem;
  align-self: stretch;
}

.message-meta {
  display: flex;
  align-self: flex-end;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.28rem;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: calc(100% - var(--message-tools-space));
  white-space: nowrap;
}

.message.inbound .message-meta {
  align-self: flex-start;
  margin-left: var(--message-tools-space);
}

.message-time {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  text-align: right;
}

.message.inbound .message-time {
  text-align: left;
}

.message-status-label {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex: 0 0 auto;
  padding: 0.1rem 0.34rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  animation: messageStatusPop 0.22s ease-out both;
}

.message-status-label::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.55rem;
  font-size: 0.68rem;
  line-height: 1;
}

.message-status-label.is-neutral {
  background: rgba(102, 119, 129, 0.14);
  color: var(--muted);
}

.message-status-label.is-pending {
  background: rgba(59, 120, 255, 0.12);
  color: #1f4ed5;
}

.message-status-label.is-pending::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  min-width: 0.42rem;
  border: 0.1rem solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: messagePendingSpin 0.8s linear infinite;
}

.message-status-label.is-sent {
  background: rgba(59, 120, 255, 0.11);
  color: #1f4ed5;
}

.message-status-label.is-sent::before {
  content: "\2713";
}

.message-status-label.is-delivered {
  background: rgba(15, 118, 110, 0.13);
  color: #0f766e;
}

.message-status-label.is-delivered::before {
  content: "\2713\2713";
}

.message-status-label.is-read {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
}

.message-status-label.is-read::before {
  content: "\2713\2713";
}

.message-status-label.is-success {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-dark);
}

.message-status-label.is-failed {
  background: rgba(214, 86, 86, 0.14);
  color: #a12d2d;
}

.message-status-label.is-failed::before {
  content: "!";
}

body .message-status-label.is-failed {
  color: #ffb7b7;
}

body .message-status-label.is-pending {
  background: rgba(86, 147, 255, 0.18);
  color: #a9c4ff;
}

body .message-status-label.is-success {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-dark);
}

body .message-status-label.is-sent {
  background: rgba(86, 147, 255, 0.14);
  color: #a9c4ff;
}

body .message-status-label.is-delivered {
  background: rgba(74, 222, 128, 0.12);
  color: #9ee6bb;
}

body .message-status-label.is-read {
  background: rgba(56, 189, 248, 0.16);
  color: #8bdcff;
}

@keyframes messageFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageJumpPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 0 0.75rem 1.5rem rgba(5, 20, 18, 0.18);
    transform: translateY(0);
  }

  22% {
    box-shadow: 0 0 0 0.28rem color-mix(in srgb, var(--accent) 24%, transparent), 0 1rem 1.8rem rgba(5, 20, 18, 0.24);
    transform: translateY(-0.08rem);
  }

  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent), 0 0.75rem 1.5rem rgba(5, 20, 18, 0.18);
    transform: translateY(0);
  }
}

@keyframes messageStatusPop {
  from {
    opacity: 0;
    transform: translateY(0.08rem) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messagePendingSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-enter,
  .message.message-jump-highlight,
  .message-status-label,
  .message-status-label.is-pending::before {
    animation: none;
    will-change: auto;
  }
}

.message-error {
  margin-top: 0.45rem;
  color: #a12d2d;
  font-size: 0.75rem;
  line-height: 1.45;
}

body .message-error {
  color: #ffb7b7;
}

.message-actions {
  display: flex;
  align-self: flex-end;
  justify-content: flex-end;
  margin-top: 0.5rem;
  position: static !important;
  inset: auto !important;
  transform: none !important;
  z-index: 2;
}

.message-retry-btn {
  border: 0.0625rem solid rgba(161, 45, 45, 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: #8f2727;
  border-radius: 999px;
  padding: 0.3125rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.message-retry-btn:hover:not(:disabled) {
  background: rgba(214, 86, 86, 0.12);
}

@keyframes sendingSweep {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

body .message-retry-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 183, 183, 0.18);
  color: #ffd1d1;
}

.message-tools {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 5;
}

.message.inbound .message-tools {
  right: auto;
  left: 0.35rem;
}

.message-tools-trigger,
.message-tool-btn {
  border: 0.0625rem solid var(--stroke);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.message-tools-trigger {
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
  opacity: 0.72;
  transform: none;
  transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.message-tool-btn {
  width: 1.8rem;
  min-width: 1.8rem;
  height: 1.8rem;
  min-height: 1.8rem;
  box-sizing: border-box;
  display: grid;
  align-items: center;
  justify-content: center;
  place-items: center;
  position: relative;
  padding: 0;
  margin: 0;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0;
  transform: none;
}

.message-tool-btn::before {
  content: "";
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  background: currentColor;
  opacity: 0.9;
  pointer-events: none;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.message-tool-btn[data-action="reply-message"]::before {
  -webkit-mask-image: url("../SVGs/Conversas/Responder.svg?v=20260516-message-tools-center2");
  mask-image: url("../SVGs/Conversas/Responder.svg?v=20260516-message-tools-center2");
  transform: translate(0.04rem, -0.02rem) scale(0.9);
}

.message-tool-btn[data-action="download-media"]::before {
  -webkit-mask-image: url("../SVGs/Conversas/Baixar.svg?v=20260516-message-tools-center2");
  mask-image: url("../SVGs/Conversas/Baixar.svg?v=20260516-message-tools-center2");
  transform: translateY(-0.04rem) scale(0.9);
}

.message-tool-btn[data-action="forward-message"]::before {
  -webkit-mask-image: url("../SVGs/Conversas/Encaminhar.svg?v=20260516-message-tools-center2");
  mask-image: url("../SVGs/Conversas/Encaminhar.svg?v=20260516-message-tools-center2");
  transform: translate(-0.07rem, 0.06rem) scale(0.82);
}

.message-tool-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
  filter: invert(88%) sepia(13%) saturate(260%) hue-rotate(112deg) brightness(96%) contrast(92%);
}

.message-tool-btn[data-action="reply-message"] .message-tool-icon {
  transform: translate(0.04rem, -0.02rem) scale(0.9);
}

.message-tool-btn[data-action="download-media"] .message-tool-icon {
  transform: translateY(-0.04rem) scale(0.9);
}

.message-tool-btn[data-action="forward-message"] .message-tool-icon {
  transform: translate(-0.07rem, 0.06rem) scale(0.82);
}

.message-tool-btn:has(.message-tool-icon)::before {
  content: none;
}

.message-tool-btn:hover::before,
.message-tool-btn:focus-visible::before,
.message-tool-btn:hover .message-tool-icon,
.message-tool-btn:focus-visible .message-tool-icon {
  opacity: 1;
}

.message-tools-menu {
  position: absolute;
  top: 0;
  right: 0;
  width: max-content;
  min-width: 0;
  max-width: min(6.55rem, calc(100vw - 2rem));
  display: flex;
  flex-direction: row;
  gap: 0.18rem;
  padding: 0.16rem;
  border-radius: 999px;
  border: 0.0625rem solid var(--stroke);
  background: var(--panel-strong);
  box-shadow: 0 0.5rem 1.25rem rgba(5, 20, 18, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-0.25rem);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 30;
}

.message.inbound .message-tools-menu {
  right: auto;
  left: 0;
}

.message-tools.is-open .message-tools-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.message-tools.is-open .message-tools-trigger {
  opacity: 0;
  pointer-events: none;
}

.message-tools-trigger:hover,
.message-tools-trigger:focus-visible,
.message-tool-btn:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: 1;
}

body .message-tools-trigger,
body .message-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border);
  color: var(--ink);
}

.message-has-only-media {
  width: max-content;
  max-width: min(70%, 34rem);
  padding: 0.375rem;
  background: transparent;
  box-shadow: none;
}

.message-audio {
  width: min(18rem, 100%);
}

.audio-transcription-panel,
.print-quality-panel {
  width: min(18rem, 100%);
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.audio-transcription-btn,
.print-quality-btn {
  justify-self: start;
  min-height: 1.85rem;
  padding: 0.35rem 0.65rem;
  border: 0.0625rem solid var(--glass-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.audio-transcription-btn:hover,
.audio-transcription-btn:focus-visible,
.print-quality-btn:hover,
.print-quality-btn:focus-visible {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}

.audio-transcription-btn:disabled,
.print-quality-btn:disabled {
  opacity: 0.72;
}

.audio-transcription-text,
.print-quality-text {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-left: 0.1875rem solid var(--accent);
  border-radius: 0.55rem;
  background: rgba(17, 27, 33, 0.06);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-attachment {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: rgba(17, 27, 33, 0.05);
  color: inherit;
  text-decoration: none;
}

.message-media-fallback {
  width: min(18rem, 62vw);
  border: 0.0625rem solid rgba(102, 119, 129, 0.22);
}

.message-media-fallback.is-pending .message-file-icon {
  position: relative;
  color: var(--accent);
}

.message-media-fallback.is-pending .message-file-icon::after {
  content: "";
  position: absolute;
  inset: 0.375rem;
  border: 0.125rem solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-top-color: var(--accent);
  border-radius: inherit;
  animation: mediaFallbackSpin 0.9s linear infinite;
}

.message-media-fallback.is-unavailable {
  border-color: rgba(244, 63, 94, 0.32);
}

.message-media-fallback.is-unavailable .message-file-icon {
  background: rgba(244, 63, 94, 0.14);
  color: #fecdd3;
}

body .message-attachment {
  background: rgba(255, 255, 255, 0.08);
  border: 0.0625rem solid var(--glass-border);
}

.message-pdf-preview {
  width: min(18rem, 62vw);
  overflow: visible;
}

.message-pdf-frame-wrap {
  position: relative;
  width: 3.25rem;
  min-width: 3.25rem;
  height: 3.25rem;
  background: rgba(8, 17, 15, 0.62);
  border-radius: 0.875rem;
  overflow: hidden;
}

.message-pdf-marker {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(232, 245, 239, 0.72);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
}

.message-pdf-body {
  padding: 0;
}

.message-file-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 1.2rem;
}

.message-file-body {
  min-width: 0;
  display: grid;
  gap: 0.125rem;
}

.message-file-body strong,
.message-file-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-file-body span {
  font-size: 0.75rem;
  color: var(--muted);
}

@keyframes mediaFallbackSpin {
  to {
    transform: rotate(360deg);
  }
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "actions field send"
    "attachments attachments attachments";
  gap: 0.75rem;
  align-items: center;
  background: var(--header);
  padding: 0.7rem 0.9rem;
  border-top: 0.0625rem solid var(--stroke);
  backdrop-filter: blur(0.8rem) saturate(135%);
}

body .composer {
  background: var(--header);
  border-top-color: var(--glass-border);
}

.composer-left {
  grid-area: actions;
  display: flex;
  gap: 0.42rem;
  flex-wrap: wrap;
  min-width: 0;
}

.composer-action-group {
  position: relative;
}

.attachment-menu {
  top: auto;
  right: auto;
  bottom: calc(100% + 0.5rem);
  left: 0;
  min-width: 12rem;
  z-index: 30;
}

.composer-field {
  grid-area: field;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.composer-attachment {
  grid-area: attachments;
  display: grid;
  gap: 0.5rem;
  max-height: min(18rem, 34vh);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.composer-attachment[hidden] {
  display: none;
}

.composer-attachment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.875rem;
  align-items: center;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  border: 0.0625rem solid var(--glass-border);
  background: rgba(255, 255, 255, 0.34);
}

.composer-attachment-card.is-sending {
  border-color: rgba(27, 127, 204, 0.32);
  background: rgba(223, 242, 255, 0.72);
}

.composer-attachment-card.is-sent {
  border-color: rgba(18, 183, 106, 0.28);
  background: rgba(220, 252, 231, 0.72);
}

.composer-attachment-card.is-failed {
  border-color: rgba(217, 45, 32, 0.32);
  background: rgba(254, 228, 226, 0.72);
}

body .composer-attachment-card {
  background: var(--panel-strong);
  border-color: var(--glass-border);
}

body .composer-attachment-card.is-sending {
  border-color: rgba(125, 211, 252, 0.38);
  background: rgba(8, 47, 73, 0.5);
}

body .composer-attachment-card.is-sent {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-strong));
}

body .composer-attachment-card.is-failed {
  border-color: rgba(252, 165, 165, 0.4);
  background: rgba(127, 29, 29, 0.42);
}


.composer-attachment-preview {
  width: 4rem;
  height: 4rem;
  border-radius: 0.875rem;
  background: rgba(102, 119, 129, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.composer-image-preview,
.composer-video-preview,
.composer-sticker-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-sticker-preview {
  object-fit: contain;
  padding: 0.25rem;
}

.composer-audio-preview {
  width: 100%;
}

.composer-file-icon {
  font-size: 1.25rem;
}

.composer-attachment-body {
  min-width: 0;
  display: grid;
  gap: 0.1875rem;
}

.composer-attachment-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.composer-attachment-title-row strong,
.composer-attachment-name,
.composer-attachment-meta,
.composer-attachment-error {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment-status {
  flex: 0 0 auto;
  padding: 0.18rem 0.5rem;
  border-radius: 999rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0f766e;
  background: rgba(20, 184, 166, 0.14);
}

.composer-attachment-status.is-sending {
  color: #075985;
  background: rgba(14, 165, 233, 0.16);
}

.composer-attachment-status.is-sent {
  color: #047857;
  background: rgba(16, 185, 129, 0.18);
}

.composer-attachment-status.is-failed {
  color: #b42318;
  background: rgba(217, 45, 32, 0.16);
}

.sticker-library-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 0.75rem;
  max-height: min(28rem, 58dvh);
  overflow: hidden;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel-strong);
}

.sticker-library-item-footer,
.sticker-library-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sticker-library-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.sticker-library-header div:first-child {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.sticker-library-header strong {
  font-size: 0.9rem;
}

.sticker-library-header span,
.sticker-library-item-footer span {
  color: var(--muted);
  font-size: 0.76rem;
}

.sticker-library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.52rem;
  justify-content: start;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.15rem;
  overscroll-behavior: contain;
}

.sticker-library-item {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.sticker-library-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}

.sticker-library-preview:hover,
.sticker-library-preview:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
}

.sticker-library-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.18rem;
}

.sticker-library-item-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.55rem;
  min-height: 1.55rem;
}

.sticker-library-item-footer span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-library-remove {
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.sticker-library-remove:hover,
.sticker-library-remove:focus-visible {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

.sticker-library-empty,
.sticker-library-error {
  padding: 0.65rem;
  border-radius: 0.6rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.sticker-library-error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.3);
}

.composer-attachment-name,
.composer-attachment-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.composer-attachment-name {
  color: var(--ink);
}

.composer-attachment-error {
  color: #b42318;
  font-size: 0.75rem;
  font-weight: 700;
}

.composer-attachment-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#sendBtn {
  grid-area: send;
}

.composer .ghost {
  padding: 0.5625rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-color: rgba(76, 99, 92, 0.12);
  background: #ffffff;
}

.composer .ghost .button-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.composer #sendBtn .button-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.composer .button-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.composer .icon-only-btn {
  width: 2.42rem;
  min-width: 2.42rem;
  height: 2.42rem;
  padding: 0;
  border-radius: 50%;
  box-shadow: inset 0 0.0625rem 0 rgba(255, 255, 255, 0.66);
}

.composer .ghost:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.composer .ghost.danger {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
}

.composer .ghost.is-recording {
  width: 5.85rem;
  min-width: 5.85rem;
  color: #ffffff;
  background: linear-gradient(135deg, #c9362f, #8f1d18);
  border-color: rgba(180, 35, 24, 0.34);
  box-shadow: 0 0.55rem 1.2rem rgba(180, 35, 24, 0.18), 0 0 0 0 rgba(217, 72, 65, 0.3);
  animation: recordingPulse 1.5s ease-out infinite;
}

.composer .ghost.is-recording .button-icon {
  filter: none;
}

body .composer .ghost.danger {
  color: #ffb4a9;
}

body .composer .ghost.is-recording {
  color: #ffffff;
}

body .composer .ghost {
  background: var(--panel-strong);
  border-color: var(--glass-border);
}

body .composer .ghost:hover {
  background: var(--flat-hover, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

body .composer .ghost:disabled,
body .composer .emoji-toggle:disabled,
body .composer .primary:disabled {
  background: rgba(20, 36, 34, 0.54);
  border-color: rgba(180, 255, 226, 0.08);
  color: rgba(233, 237, 239, 0.46);
  box-shadow: none;
  opacity: 1;
}

.recording-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  width: 100%;
}

.recording-dot {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0.18rem rgba(255, 255, 255, 0.14);
  animation: recordingBlink 0.9s ease-in-out infinite;
}

.recording-stop {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 0.12rem;
  background: currentColor;
  opacity: 0.92;
}

.recording-time {
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.emoji-toggle {
  width: 2.875rem;
  height: 2.875rem;
  border-radius: 50%;
  border: 0.0625rem solid transparent;
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.emoji-toggle:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.emoji-toggle[aria-expanded="true"] {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.emoji-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.composer-field input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 2.875rem;
  border: 0.0625rem solid transparent;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(76, 99, 92, 0.14);
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
  color: var(--ink);
  padding: 0.75rem 1rem;
}

body .composer-field input {
  background: var(--panel-strong);
  border-color: var(--glass-border);
  color: var(--ink);
}

body .composer-field input:disabled {
  background: rgba(45, 65, 60, 0.8);
  border-color: rgba(180, 255, 226, 0.08);
  color: rgba(233, 237, 239, 0.5);
  opacity: 1;
}

.composer-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 0 0 0.18rem var(--focus-ring);
}

.composer-field input::placeholder {
  color: var(--muted);
}

.emoji-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.75rem);
  width: min(18.5rem, 100%);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 0.0625rem solid var(--glass-border);
  background: var(--glass-strong);
  box-shadow: var(--liquid-shadow);
  backdrop-filter: blur(1rem) saturate(145%);
  z-index: 4;
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
}

.emoji-option:hover {
  background: var(--panel-strong);
}

@keyframes recordingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 72, 65, 0.34);
  }

  70% {
    box-shadow: 0 0 0 0.65rem rgba(217, 72, 65, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(217, 72, 65, 0);
  }
}

@keyframes recordingBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}
.call-panel {
  position: fixed;
  left: clamp(34rem, 56vw, 52rem);
  top: 6.25rem;
  bottom: auto;
  right: auto;
  transform: translateX(-50%);
  z-index: 6000;
  width: min(19.5rem, calc(100vw - 2rem));
  padding: 0.72rem;
  border: 0.0625rem solid var(--stroke);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 84%, #0f1417);
  color: var(--ink);
  box-shadow: 0 0.75rem 1.8rem rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(0.75rem) saturate(130%);
}

.call-panel.is-outbound {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--stroke));
}

.call-panel.has-error {
  border-color: rgba(217, 72, 72, 0.7);
}

.call-panel.has-error .call-pulse {
  background: #d94848;
  box-shadow: 0 0 0 0 rgba(217, 72, 72, 0.34);
}

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

.call-panel-head,
.call-panel-actions {
  display: flex;
  align-items: center;
}

.call-panel-head {
  display: grid;
  grid-template-columns: 0.55rem minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.call-pulse {
  width: 0.52rem;
  height: 0.52rem;
  flex: 0 0 0.52rem;
  border-radius: 50%;
  background: #20b26b;
  box-shadow: 0 0 0 0 rgba(32, 178, 107, 0.38);
  animation: call-pulse 1.6s infinite;
  align-self: center;
}

.call-panel-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.call-panel-copy span,
.call-panel-copy small,
.call-panel-status {
  color: var(--muted);
  font-size: 0.7rem;
}

.call-panel-copy strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-panel time {
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--ink);
}

.call-panel-status {
  min-height: 1rem;
  margin: 0.58rem 0 0.68rem;
}

.call-panel-actions {
  justify-content: flex-end;
  gap: 0.45rem;
}

.call-control[hidden],
.call-panel.is-outbound .call-accept,
.call-panel.is-outbound .call-reject,
.call-panel.is-incoming .call-mute,
.call-panel.is-incoming .call-hangup {
  display: none !important;
}

.call-control {
  display: inline-flex;
  width: auto;
  min-width: 0;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0 0.68rem;
  border: 0.0625rem solid var(--stroke);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--stroke));
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
}

.call-control img {
  width: 1rem;
  height: 1rem;
}

.call-mute {
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border-radius: 8px;
}

.call-accept {
  border-color: color-mix(in srgb, #20b26b 44%, transparent);
  background: color-mix(in srgb, #20b26b 24%, var(--panel-strong));
  color: #ffffff;
}

.call-reject,
.call-hangup {
  border-color: color-mix(in srgb, #d94848 48%, transparent);
  background: color-mix(in srgb, #d94848 30%, var(--panel-strong));
  color: #ffffff;
}

.call-accept img,
.call-reject img,
.call-hangup img {
  filter: brightness(0) invert(1);
}

.call-reject img,
.call-hangup img {
  transform: rotate(135deg);
}

.call-mute.is-active {
  background: color-mix(in srgb, var(--accent) 54%, var(--panel-strong));
  color: #ffffff;
}

@keyframes call-pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(32, 178, 107, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(32, 178, 107, 0);
  }
}

@media (max-width: 45rem) {
  .call-panel {
    top: 4.75rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    transform: none;
  }

  .call-panel-actions {
    gap: 0.5rem;
  }

  .call-control {
    flex: 1;
    min-width: 0;
    padding: 0 0.65rem;
  }

  .call-mute {
    flex: 0 0 44px;
  }
}
