/* Gerado por scripts/build-shell-css.mjs — não editar à mão.
   Fonte: css/components.css (@import). Rode o script após mudar CSS do shell. */

/* === components/Icons.css === */
.icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  box-sizing: content-box;
}

.icon--sm {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}

.icon--xs {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

.icon--checks {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
}

/* === components/Base.css === */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.overlay[hidden] {
  display: none !important;
}

.popover {
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-panel-shell {
  --side-panel-w: 320px;
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 4;
  min-height: 0;
  align-self: stretch;
  transition: width 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width;
}

.side-panel-shell.is-open {
  width: min(var(--side-panel-w), 100%);
}

.side-panel {
  width: min(var(--side-panel-w), 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid rgb(0 0 0 / 0.06);
  box-shadow: -12px 0 28px rgb(0 0 0 / 0.06);
  min-height: 0;
  opacity: 0;
  transform: translateX(22px) scale(0.985);
  transform-origin: right center;
  transition:
    opacity 0.28s ease,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.side-panel-shell.is-open .side-panel {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%) translateY(2px);
  padding: 5px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 92%, var(--surface));
  color: var(--surface);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.18);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: color-mix(in srgb, var(--text) 92%, var(--surface));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
}

.tip:hover::after,
.tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tip:hover::before,
.tip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

/* === components/ChatEmpty.css === */
/* ChatEmpty */
.chat-empty {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  background-color: var(--surface);
  opacity: 0.5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  transition:
    opacity 0.22s ease,
    box-shadow 0.22s ease,
    border-radius 0.2s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-empty__logo {
  width: min(220px, 55%);
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-empty__logo--canvas {
  display: block;
  /* width/height vêm do JS (canvas mais alto que a imagem) */
  max-width: min(220px, 55%);
  transition: none;
  will-change: auto;
  aspect-ratio: auto;
  pointer-events: auto;
  cursor: default;
}

.chat-empty:hover .chat-empty__logo:not(.chat-empty__logo--canvas) {
  transition-duration: 0.12s;
}

html[data-theme-mode="dark"] .chat-empty__logo:not(.chat-empty__logo--canvas) {
  filter: brightness(0) invert(1);
}

@media (prefers-reduced-motion: reduce) {
  .chat-empty__logo {
    transition: none !important;
    transform: none !important;
  }
}

.chat-empty--loading {
  opacity: 1;
}

.chat-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(200px, 70%);
  height: 5px;
  z-index: 12;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.chat-progress.is-active {
  opacity: 1;
}

.chat-progress__bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.35s ease-out;
}

.chat-progress.is-active .chat-progress__bar {
  animation: chat-progress-load 1.1s cubic-bezier(0.25, 0.8, 0.3, 1) forwards;
}

@keyframes chat-progress-load {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .chat-empty {
    display: none;
    border-radius: var(--radius);
    width: 100%;
  }

  .app[data-mobile-panel="list"] .chat-empty {
    display: none;
  }

  .app[data-mobile-panel="chat"] .chat-empty {
    display: grid;
  }
}

/* === components/ConfirmModal.css === */
/* ConfirmModal */
/* Modal confirmação geral */
.confirm-modal {
  z-index: 1500;
}

.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 18 24 / 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.confirm-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: var(--radius-default);
  padding: 24px 22px 18px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.22);
  animation: confirm-in 0.18s ease;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .confirm-modal__dialog {
  border-radius: var(--radius);
}

@keyframes confirm-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-modal__desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-modal__btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-default);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.15s ease, border-radius 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}

html[data-template="rounded"] .confirm-modal__btn {
  border-radius: var(--radius-full);
}

.confirm-modal__btn:hover {
  transform: translateY(-1px);
}

.confirm-modal__btn--ghost {
  background: color-mix(in srgb, var(--icon) 10%, var(--surface));
  color: var(--text);
  border: 1px solid var(--border);
}

.confirm-modal__btn--ghost:hover {
  background: var(--menu-hover-bg);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.confirm-modal__btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.confirm-modal__btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.confirm-modal__btn--danger {
  background: var(--danger);
  color: #fff;
}

.confirm-modal__btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 82%, #000);
}

/* === components/SpyChatModal.css === */
/* SpyChatModal */
.spy-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
}

.spy-modal[hidden] {
  display: none !important;
}

.spy-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 18 24 / 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.spy-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(72vh, 720px);
  background: var(--surface);
  border-radius: var(--radius-default);
  padding: 20px 18px 16px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.22);
}

html[data-template="rounded"] .spy-modal__dialog {
  border-radius: var(--radius);
}

.spy-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.spy-modal__title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 40px 12px 0;
}

.spy-modal__title:has(+ .spy-modal__subtitle:not([hidden])) {
  margin-bottom: 8px;
}

.spy-modal__title .priority-tag {
  margin-left: 8px;
  vertical-align: middle;
}

.spy-modal__subtitle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 40px 12px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.spy-modal__subtitle-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spy-modal__subtitle-line strong {
  font-weight: 600;
  color: var(--text);
}

.spy-modal__subtitle-line .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.spy-modal__messages {
  flex: 1;
  min-height: 180px;
  overflow: auto;
  padding: 8px 4px 0;
}

.spy-modal__status {
  margin: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spy-modal__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 2px 0;
}

.spy-modal__footer[hidden] {
  display: none;
}

.spy-modal__resolve-btn {
  flex-shrink: 0;
}

.spy-modal__resolved-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* === components/EditMessageModal.css === */
/* EditMessageModal */
.edit-msg-modal {
  z-index: 1400;
}

.edit-msg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 18 24 / 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.edit-msg-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-default);
  padding: 24px 22px 18px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.22);
  animation: edit-msg-in 0.18s ease;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .edit-msg-modal__dialog {
  border-radius: var(--radius);
}

@keyframes edit-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.edit-msg-modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.edit-msg-modal__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.edit-msg-modal__textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
  padding: 10px 12px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.45;
  transition: border-color 0.18s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .edit-msg-modal__textarea {
  border-radius: calc(var(--radius-default) - 2px);
}

.edit-msg-modal__textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.edit-msg-modal__error {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--danger);
}

.edit-msg-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.edit-msg-modal__btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-default);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .edit-msg-modal__btn {
  border-radius: var(--radius-full);
}

.edit-msg-modal__btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.edit-msg-modal__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.edit-msg-modal__btn--ghost {
  background: #f3f3f5;
  color: var(--text);
}

.edit-msg-modal__btn--ghost:hover:not(:disabled) {
  background: #e9e9ee;
}

.edit-msg-modal__btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.edit-msg-modal__btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.edit-msg-modal.is-saving .edit-msg-modal__btn--primary {
  pointer-events: none;
}

/* === components/MessageMenu.css === */
/* MessageMenu */
/* Menu contexto mensagem */
.msg-menu {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(205px, calc(100vw - 16px));
  filter: drop-shadow(0 10px 28px rgb(0 0 0 / 0.18));
}

.msg-menu[hidden] {
  display: none !important;
}

.msg-menu__reactions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  background: var(--surface);
  border-radius: var(--radius-default);
  border: 1px solid var(--border);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .msg-menu__reactions {
  border-radius: var(--radius-full);
}

.msg-menu__emoji {
  width: 28px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  transition: background 0.12s ease, transform 0.12s ease;
}

.msg-menu__emoji:hover {
  background: var(--menu-hover-bg);
  transform: scale(1.12);
}

.msg-menu__emoji--more {
  color: var(--text-muted);
}

.msg-menu__emoji--more .icon {
  width: 18px;
  height: 18px;
}

.msg-menu__card {
  background: var(--surface);
  border-radius: var(--radius-default);
  border: 1px solid var(--border);
  padding: 6px;
  overflow: hidden;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .msg-menu__card {
  border-radius: var(--radius-default);
}

.msg-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-default);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  transition: background 0.12s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .msg-menu__item {
  border-radius: var(--radius-default);
}

.msg-menu__item:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

html[data-theme-mode="dark"] .msg-menu__item:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
}

.msg-menu__item--danger {
  color: var(--danger, #dc2626);
}

.msg-menu__item--danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.msg-menu__icon {
  width: 22px;
  display: grid;
  place-items: center;
  color: inherit;
}

.msg-menu__divider {
  height: 1px;
  background: #eee;
  margin: 4px 8px;
}

/* === components/magnetic.css === */
.magnet {
  width: 64px;
  height: 64px;
  margin: -12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  touch-action: manipulation;
}

.magnet__inner {
  display: grid;
  place-items: center;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.magnet__inner > * {
  border-radius: var(--radius-full);
  transition: border-radius 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .magnet__inner {
    transition: none !important;
    transform: none !important;
  }
}

/* === components/FilterChip.css === */
/* FilterChip */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: none;
  flex-shrink: 0;
  padding: 7px 8px;
  border-radius: var(--radius-default);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--surface);
  color: var(--icon);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-radius 0.2s ease, border-color 0.15s ease;
}

html[data-template="rounded"] .filter-chip {
  border-radius: var(--radius-full);
}

.filter-chip:hover:not(.filter-chip--active),
.filter-chip--active {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.filter-chip--active:hover {
  color: var(--menu-hover-fg);
  background: color-mix(in srgb, var(--accent) 28%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

html[data-theme-mode="dark"] .filter-chip:hover:not(.filter-chip--active),
html[data-theme-mode="dark"] .filter-chip--active,
html[data-theme-mode="dark"] .filter-chip--active:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.filter-chip__label,
.filter-chip__count {
  white-space: nowrap;
}

.filter-chip__label {
  font-weight: 500;
}

.filter-chip__count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e26e4c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-chip__chevron {
  display: inline-flex;
  margin-left: -2px;
  color: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

.filter-chip__chevron .icon {
  width: 14px;
  height: 14px;
}

/* === components/ChatListSkeleton.css === */
/* ChatListSkeleton */
.filter-chip--skeleton {
  display: block;
  height: 28px;
  padding: 0;
  border: none;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgb(0 0 0 / 0.06) 25%,
    rgb(0 0 0 / 0.1) 37%,
    rgb(0 0 0 / 0.06) 63%
  );
  background-size: 400% 100%;
}

.chat-list__items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  /* espaço pra as curvas não cortarem no scroll */
  padding: calc(var(--curve) + 4px) 0 calc(var(--curve) + 16px);
}

.chat-list__empty {
  list-style: none;
  margin: 24px 16px;
  padding: 20px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Skeleton da lista */
.chat-item--skeleton {
  pointer-events: none;
  cursor: default;
  border-left-color: transparent;
}

.chat-item--skeleton:hover {
  background: linear-gradient(
    88deg,
    rgb(255 255 255 / 68%) 0%,
    rgb(255 255 255 / 84%) 100%
  );
}

.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    rgb(0 0 0 / 0.06) 25%,
    rgb(0 0 0 / 0.1) 37%,
    rgb(0 0 0 / 0.06) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton--avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.skeleton--line {
  height: 10px;
}

.skeleton--name {
  width: 42%;
  max-width: 140px;
}

.skeleton--time {
  width: 36px;
  flex-shrink: 0;
}

.skeleton--preview {
  width: 58%;
  max-width: 180px;
  margin-top: 2px;
}

.skeleton--preview-wide {
  width: 72%;
  max-width: 220px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}

/* === components/ChatItem.css === */
/* ChatItem */
.chat-item {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 73px;
  padding: 10px;
  margin: 0 0 2px;
  border-radius: var(--radius-default);
  cursor: pointer;
  position: relative;
  background: transparent;
  border: 0;
  border-bottom: none;
  will-change: transform;
  box-shadow: none;
  transition: background 0.15s ease, border-radius 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

html[data-template="rounded"] .chat-item {
  border-radius: calc(var(--radius-default) * 0.6) var(--radius-default) var(--radius-default) calc(var(--radius-default) * 0.6);
}

.chat-item--active,
.chat-item:hover {
  background: var(--menu-hover-bg);
}

html[data-template="rounded"] .chat-item--active {
  border-radius: calc(var(--radius-default) * 0.6) var(--radius-default) var(--radius-default) calc(var(--radius-default) * 0.6);
}

.chat-item:hover {
  opacity: 1;
}

.chat-item--active .chat-item__name,
.chat-item:hover .chat-item__name {
  color: var(--text);
}

.chat-item--active .chat-item__preview,
.chat-item:hover .chat-item__preview,
.chat-item--active .chat-item__time,
.chat-item:hover .chat-item__time,
.chat-item--active .chat-item__mute,
.chat-item:hover .chat-item__mute,
.chat-item--active .chat-item__preview-icon,
.chat-item:hover .chat-item__preview-icon {
  color: var(--icon);
}

.chat-item__dept-bar {
  position: absolute;
  left: -2px;
  top: 10px;
  bottom: 10px;
  width: 5px;
  border-radius: 2px;
  pointer-events: none;
}

.chat-item::before,
.chat-item::after {
  content: none;
  display: none;
}

html:not([data-template="rounded"]) .chat-item--active::before {
  content: "";
  display: block;
  position: absolute;
  left: -9px;
  top: 50%;
  width: 3px;
  height: 30px;
  margin-top: -15px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}


html[data-template="rounded"] .chat-item::after {
  bottom: calc(var(--curve) * -1);
  border-top-right-radius: var(--curve);
  box-shadow: 10px -10px 0 10px transparent;
}

html[data-template="rounded"] .chat-item--active::before {
  box-shadow: 10px 10px 0 10px var(--chat-bg);
}

html[data-template="rounded"] .chat-item--active::after {
  box-shadow: 10px -10px 0 10px var(--chat-bg);
}

.chat-item__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #ddd;
  transition: border-radius 0.2s ease;
}

.avatar--letter {
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: -0.5px;
  color: #fff;
  user-select: none;
}

.avatar-blue { background: linear-gradient(145deg, #4aa4d6, #1878b4); }
.avatar-purple { background: linear-gradient(145deg, #a18bdf, #7251c9); }
.avatar-violet { background: linear-gradient(145deg, #c19bef, #8964d7); }
.avatar-indigo { background: linear-gradient(145deg, #7591de, #536bc1); }
.avatar-teal { background: linear-gradient(145deg, #43c2b2, #189c98); }
.avatar-rose { background: linear-gradient(145deg, #eaa0b5, #c96c88); }
.avatar-slate { background: linear-gradient(145deg, #91a0b2, #65758a); }

html[data-template="rounded"] .avatar {
  border-radius: var(--radius-full);
}

.chat-item__connection-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
  cursor: default;
  outline: none;
}

.chat-item__connection-badge .icon {
  width: 12px;
  height: 12px;
}

.chat-item__connection-badge__img {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
}

.chat-item__connection-badge--meta,
.chat-item__connection-badge--qr {
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06);
}

html[data-theme-mode="dark"] .chat-item__connection-badge--meta,
html[data-theme-mode="dark"] .chat-item__connection-badge--qr {
  background: rgb(255 255 255 / 0.94);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.14),
    0 1px 4px rgb(0 0 0 / 0.35);
}

html[data-theme-mode="dark"] .chat-item__connection-badge--meta .chat-item__connection-badge__img,
html[data-theme-mode="dark"] .chat-item__connection-badge--qr .chat-item__connection-badge__img {
  filter: brightness(1.05) saturate(1.08);
}

.chat-item__connection-badge::after {
  z-index: 6;
}

.chat-item__connection-badge::before {
  z-index: 6;
}

.chat-tag {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  position: absolute;
  right: -1px;
  bottom: -1px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.chat-tag--icon {
  width: 18px;
  height: 18px;
  overflow: hidden;
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06);
}

.chat-tag--icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-item__top,
.chat-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-item__meta {
  display: flex;
  align-items: flex-end;
  align-self: stretch;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.chat-item__name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item__ticket {
  margin: 0;
  font-size: 11px;
  line-height: 15px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item__snippet {
  margin: 0;
  font-size: 11px;
  line-height: 15px;
  font-weight: 400;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
  word-break: break-word;
}

.chat-item--unread .chat-item__name {
  font-weight: 500;
}

.chat-item--unread .chat-item__snippet {
  color: var(--text);
  font-weight: 500;
}

.chat-item--unread .chat-item__time {
  color: var(--accent);
  font-weight: 700;
}

.chat-item__time {
  font-size: 10px;
  color: var(--text-soft);
  flex-shrink: 0;
}

.chat-item__preview {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 0;
}

.chat-item__preview--assignee {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.chat-item__preview-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--icon);
}

.chat-item__preview-icon .icon {
  width: 12px;
  height: 12px;
}

.chat-item__preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item__subrow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.chat-item__label {
  width: max-content;
  margin-top: 3px;
  padding: 2px 6px;
  color: var(--dept-color, #7f91a1);
  background: color-mix(in srgb, var(--dept-color, #9aa8b5) 16%, var(--surface));
  border-radius: 4px;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.chat-item__tags {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 0;
  margin-left: 0;
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
}

.chat-item__tag {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}

.chat-item__tag::after {
  top: auto;
  z-index: 5;
}

.chat-item__tag::before {
  top: auto;
  border-bottom-color: transparent;
  z-index: 5;
}

.chat-item__meta .chat-item__mute {
  display: inline-flex;
}

.chat-item__mute {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon);
  flex-shrink: 0;
}

.chat-item__mute .icon {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.chat-item__unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .chat-item {
    background: transparent;
    margin-left: 0;
    margin-right: 0;
    padding-right: 16px;
    border-radius: var(--radius-default);
    z-index: auto;
  }

  .chat-item--active,
  .chat-item--active:hover,
  .chat-item:hover:not(.chat-item--active) {
    background: var(--menu-hover-bg);
    margin-left: 0;
    margin-right: 0;
    padding-right: 16px;
    border-radius: var(--radius-default);
    z-index: auto;
  }

  html[data-template="rounded"] .chat-item,
  html[data-template="rounded"] .chat-item--active,
  html[data-template="rounded"] .chat-item--active:hover,
  html[data-template="rounded"] .chat-item:hover:not(.chat-item--active) {
    border-radius: calc(var(--radius-default) * 0.6) var(--radius-default) var(--radius-default) calc(var(--radius-default) * 0.6);
  }

  .chat-item::before,
  .chat-item::after {
    display: none !important;
    content: none !important;
  }
}

.chat-item.is-removing {
  pointer-events: none;
  animation: chat-item-remove 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: left center;
  z-index: 0;
}

@keyframes chat-item-remove {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 88px;
    margin-top: 4px;
    margin-bottom: 4px;
  }
  to {
    opacity: 0;
    transform: translateX(-28px) scale(0.96);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-item.is-removing {
    animation: none;
  }
}

/* === components/ResolvedTickets.css === */
.chat-item__expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0 -6px 0 -4px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-item__expand-slot {
  flex-shrink: 0;
  width: 22px;
  margin: 0 -6px 0 -4px;
}

.chat-item__expand:hover,
.chat-item__expand:focus-visible {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  outline: none;
}

.chat-item__expand .icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  transition: transform 0.2s ease;
}

.chat-item.is-expanded .chat-item__expand .icon {
  transform: rotate(90deg);
}

.chat-item.is-expanded,
.resolved-tickets {
  --resolved-border: color-mix(in srgb, var(--text) 16%, transparent);
}

.chat-item.is-expanded:hover,
.chat-item.is-expanded:has(+ .resolved-tickets:hover),
.chat-item.is-expanded:hover + .resolved-tickets,
.resolved-tickets:hover,
.chat-item--active.is-expanded,
.chat-item--active.is-expanded + .resolved-tickets {
  --resolved-border: color-mix(in srgb, var(--accent) 55%, transparent);
}

.chat-item.is-expanded,
html[data-template="rounded"] .chat-item.is-expanded {
  margin-bottom: 0;
  padding: 9px 9px 10px;
  border: 1px solid var(--resolved-border);
  border-bottom: 0;
  border-radius: var(--radius-default) var(--radius-default) 0 0;
  background: transparent;
  transition: border-color 0.15s ease;
}

.resolved-tickets {
  container-type: inline-size;
  margin: 0 0 8px;
  padding: 4px 4px 4px;
  list-style: none;
  border: 1px solid var(--resolved-border);
  border-top: 0;
  border-radius: 0 0 var(--radius-default) var(--radius-default);
  background: transparent;
  transition: border-color 0.15s ease;
}

.resolved-tickets.is-entering {
  animation: resolved-tickets-in 0.18s ease both;
}

.resolved-tickets__title {
  margin: 0 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
}

.resolved-tickets__list {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@supports selector(::-webkit-scrollbar) {
  .resolved-tickets .resolved-tickets__list {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
}

.resolved-tickets__empty {
  margin: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.resolved-tickets__skeleton {
  height: 40px;
  margin: 4px 6px;
  border-radius: var(--radius-default);
}

.resolved-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.resolved-ticket + .resolved-ticket {
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.resolved-ticket:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -2px;
}

.resolved-ticket__number,
.resolved-ticket__summary,
.resolved-ticket__dates {
  transition: color 0.15s ease;
}

.resolved-ticket:hover .resolved-ticket__number,
.resolved-ticket.is-active .resolved-ticket__number {
  color: var(--accent-hover, var(--accent));
  font-weight: 800;
}

.resolved-ticket:hover .resolved-ticket__summary,
.resolved-ticket.is-active .resolved-ticket__summary {
  color: var(--text);
  font-weight: 600;
}

.resolved-ticket:hover .resolved-ticket__dates,
.resolved-ticket.is-active .resolved-ticket__dates {
  color: var(--text);
}

.resolved-ticket__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.resolved-ticket__number {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.resolved-ticket__summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.resolved-ticket__summary.is-empty {
  font-style: italic;
}

.resolved-ticket__summary-skeleton {
  width: 90%;
  height: 9px;
}

.resolved-ticket__dates {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px 6px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  white-space: nowrap;
}

.resolved-ticket__date {
  display: contents;
}

.resolved-ticket__status {
  justify-self: start;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-align: center;
  text-transform: uppercase;
}

.resolved-ticket__status--resolved {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

html[data-theme-mode="dark"] .resolved-ticket__status--resolved {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
}

html[data-theme-mode="dark"] .resolved-tickets .skeleton {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--text) 8%, transparent) 25%,
    color-mix(in srgb, var(--text) 16%, transparent) 37%,
    color-mix(in srgb, var(--text) 8%, transparent) 63%
  );
  background-size: 400% 100%;
}

@container (max-width: 330px) {
  .resolved-ticket {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .resolved-ticket__dates {
    justify-content: start;
  }
}

@keyframes resolved-tickets-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .resolved-tickets.is-entering {
    animation: none;
  }

  .chat-item__expand .icon {
    transition: none;
  }
}

/* === components/ChatInput.css === */
/* ChatInput */
.message__bubble--failed { border-color: #dc2626; color: #991b1b; }
.message__failed-status { color: #dc2626; font-weight: 600; }
.message__retry { color: #b91c1c; font-weight: 600; }
/* ========== Floating composer ========== */
.composer-window-warning {
  padding: 10px 14px;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  font-size: 13px;
}

.chat-composer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 24px 19px;
  pointer-events: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  transition: bottom 0.12s ease-out;
  z-index: 4;
}

@media (max-width: 800px) {
  .composer-window-warning {
    padding: 10px 14px;
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    font-size: 13px;
  }

  .chat-composer-wrap {
    padding-inline: 10px;
  }
}

.composer-preview {
  pointer-events: auto;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid #e8e8ec;
  border-radius: var(--radius-default);
  padding: 10px 12px;
  box-shadow: var(--shadow-float);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .composer-preview {
  border-radius: var(--radius-default);
}

.composer-preview__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.composer-preview__item {
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.composer-preview__item--file {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
  padding-right: 32px;
}

.composer-preview__media {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-default);
  overflow: hidden;
  flex-shrink: 0;
  background: #eee;
}

.composer-preview__media img,
.composer-preview__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer-preview__media--video::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.composer-preview__file {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #fce8e6;
  color: var(--danger);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.composer-preview__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-preview__meta strong {
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-preview__meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.composer-preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--icon);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.08);
  pointer-events: auto;
  cursor: pointer;
}

.composer-preview__remove:hover {
  background: var(--menu-hover-bg);
  color: var(--danger);
}

.composer-preview__item--file .composer-preview__remove {
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.composer-reply {
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid #e8e8ec;
  border-radius: var(--radius-default);
  padding: 10px 12px;
  box-shadow: var(--shadow-float);
}

.composer-reply__bar {
  width: 4px;
  border-radius: var(--radius-full);
  background: var(--accent);
  flex-shrink: 0;
}

.composer-reply__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-reply__body strong {
  font-size: 0.8125rem;
  color: var(--accent);
}

.composer-reply__body span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-reply__remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--icon);
  flex-shrink: 0;
  align-self: center;
}

.composer-reply__remove:hover {
  background: var(--menu-hover-bg);
}

.composer-file-input {
  display: none;
}

.chat-composer-row {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
}

.composer-toggles {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
  padding: 0 4px;
}

.composer-toggles__end {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.composer-reply-countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  user-select: none;
}

.composer-reply-countdown[hidden] {
  display: none;
}

.composer-reply-countdown__icon {
  display: inline-grid;
  place-items: center;
  color: var(--icon, var(--text-soft));
}

.composer-reply-countdown__icon .icon {
  width: 14px;
  height: 14px;
}

.composer-reply-countdown__time {
  min-width: 3.2em;
  text-align: left;
  color: var(--text);
  font-weight: 600;
}

.composer-reply-countdown.is-expired {
  color: var(--danger, #dc2626);
}

.composer-reply-countdown.is-expired .composer-reply-countdown__icon,
.composer-reply-countdown.is-expired .composer-reply-countdown__time {
  color: var(--danger, #dc2626);
}

.chat-composer {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 53px;
  background: var(--surface);
  border: 1px solid var(--border);
  /* Square: 2px; rounded: teto de 26px (evita oval com texto longo) */
  border-radius: min(26px, var(--radius-full));
  padding: 7px;
  box-shadow: 0 6px 20px #163c5c0c;
  flex: 1;
  min-width: 0;
}

.composer-signature {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 0;
}

.composer-signature__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}

.composer-signature:has(input:disabled) {
  opacity: 0.45;
  pointer-events: none;
}

.composer-field {
  position: relative;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 8px 6px;
  min-height: 28px;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.45;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.composer-field.is-empty::before {
  content: attr(data-placeholder);
  color: var(--text-soft);
  pointer-events: none;
}

.composer-field:not(:empty)::before {
  content: none;
}

.composer-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--icon);
  flex-shrink: 0;
  transition: 0.15s ease;
}

.composer-btn:hover {
  background: var(--menu-hover-bg);
  color: var(--icon);
}

.composer-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-height: 42px;
}

.composer-audio {
  position: relative;
  color: var(--text-muted);
}

.composer-audio-wrap {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.composer-audio--error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.composer-audio--error:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.composer-audio.is-shake {
  animation: composer-audio-shake 0.45s ease;
}

.composer-audio-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 5;
  max-width: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  background: var(--danger, #e11d48);
  pointer-events: none;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.16);
  animation: composer-audio-tip-float 2.4s ease forwards;
}

@keyframes composer-audio-tip-float {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.94);
  }
  8% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  72% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-22px) scale(0.98);
  }
}

@keyframes composer-audio-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px) rotate(-4deg);
  }
  40% {
    transform: translateX(3px) rotate(4deg);
  }
  60% {
    transform: translateX(-2px) rotate(-2deg);
  }
  80% {
    transform: translateX(2px) rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .composer-audio-tip {
    animation: none;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  .composer-audio.is-shake {
    animation: none;
  }
}

.composer-recording {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  min-height: 28px;
}

.composer-recording__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e11d48;
  flex-shrink: 0;
  animation: composer-rec-pulse 1s ease-in-out infinite;
}

.composer-recording__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.composer-recording__time {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin-right: auto;
}

.composer-recording__cancel {
  color: var(--danger);
}

.composer-send {
  height: 35px;
  border-radius: var(--radius-default);
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.35);
  width: 0;
  margin: 0;
  pointer-events: none;
  transition:
    transform 0.28s cubic-bezier(0.22, 1.2, 0.36, 1),
    opacity 0.2s ease,
    width 0.28s cubic-bezier(0.22, 1.2, 0.36, 1),
    margin 0.28s ease,
    background 0.15s ease;
}

.composer-send.is-ready,
.composer-send--audio {
  width: 35px;
  margin-left: 2px;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.composer-send:hover:not(:disabled),
.composer-send--audio:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
  transform: scale(1.06);
}

.composer-send:disabled {
  cursor: default;
}

.composer-send-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  border-top-color: transparent;
  display: none;
  flex-shrink: 0;
  animation: composer-spin 0.7s linear infinite;
}

#chat-composer.is-sending .composer-send-spinner {
  display: grid;
}

#chat-composer.is-sending .composer-send:not(.composer-send--audio) {
  width: 0;
  margin: 0;
  opacity: 0;
  transform: scale(0.35);
  pointer-events: none;
}

@keyframes composer-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes composer-rec-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .composer-send {
    transition: opacity 0.15s ease, width 0.15s ease;
  }

  .composer-recording__dot {
    animation: none;
  }
}

.composer-slash {
  pointer-events: auto;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}

.composer-slash[hidden] {
  display: none;
}

.composer-slash__item {
  width: 100%;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}

.composer-slash__item:hover,
.composer-slash__item.is-active {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.composer-slash__item:hover .composer-slash__text,
.composer-slash__item.is-active .composer-slash__text {
  color: var(--menu-hover-fg);
}

.composer-slash__shortcut {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.composer-slash__text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-slash__empty {
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.composer-emoji-picker {
  pointer-events: auto;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.composer-emoji-picker[hidden] {
  display: none;
}

.composer-emoji-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 2px;
}

.composer-emoji-picker__btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-default);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.composer-emoji-picker__btn:hover {
  background: var(--menu-hover-bg);
}

.composer-attach {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.composer-attach-menu {
  position: fixed;
  z-index: 80;
  pointer-events: auto;
  min-width: 180px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
}

.composer-attach-menu[hidden] {
  display: none;
}

.composer-attach-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: calc(var(--radius-default) - 2px);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.composer-attach-menu__item:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.composer-attach-menu__item .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-soft);
}

.composer-attach-menu__item:hover .icon {
  color: inherit;
}

html[data-theme-mode="dark"] .composer-attach-menu__item:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
}

.composer-contact-picker {
  position: fixed;
  z-index: 81;
  pointer-events: auto;
  width: min(320px, calc(100vw - 32px));
  max-height: 340px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.composer-contact-picker[hidden] {
  display: none;
}

.composer-contact-picker__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
}

.composer-contact-picker__search {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  background-color: var(--input-bg);
}

.composer-contact-picker__search:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.composer-contact-picker__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.composer-contact-picker__close:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.composer-contact-picker__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px;
}

.composer-contact-picker__empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.composer-contact-picker__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: calc(var(--radius-default) - 2px);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.composer-contact-picker__item:hover {
  background: var(--menu-hover-bg);
}

.composer-contact-picker__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.composer-contact-picker__meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-contact-picker__name {
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-contact-picker__phone {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === components/MessageBubble.css === */
/* MessageBubble */
.message__retry {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: 6px;
  border: 0;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
}

.message__retry-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  position: relative;
  margin-bottom: 10px;
  touch-action: pan-y;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-select: none;
}

.message__swipe-reply {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text, #fff);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.14);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}

.message--in .message__swipe-reply {
  left: 4px;
}

.message--out .message__swipe-reply {
  right: 4px;
}

.message__swipe-delete {
  position: absolute;
  left: 50%;
  top: -52px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  box-shadow: 0 4px 14px rgb(225 29 72 / 0.4);
  pointer-events: none;
  opacity: 0;
  z-index: 3;
}

.message__swipe-delete.is-armed {
  background: #be123c;
  box-shadow: 0 6px 18px rgb(190 18 60 / 0.5);
}

.message__trash {
  width: 22px;
  height: 26px;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.message__trash-lid {
  transition: none;
}

.message.is-swiping {
  transition: none;
  user-select: none;
  z-index: 20;
  position: relative;
}

.message.is-deleting {
  z-index: 20;
  position: relative;
}

.message.is-deleting .message__bubble {
  background: color-mix(
    in srgb,
    #e11d48 calc(var(--delete-p, 0.5) * 78%),
    var(--bubble-out)
  ) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, #e11d48 calc(var(--delete-p, 0.5) * 50%), transparent);
}

.message.is-deleting .message__time,
.message.is-deleting .message__checks,
.message.is-deleting .message__quote-author,
.message.is-deleting .message__quote-text,
.message.is-deleting .message__forwarded {
  color: rgb(255 255 255 / 0.85) !important;
}

.message.is-deleting.message--out::after {
  border-color: transparent transparent transparent
    color-mix(in srgb, #e11d48 calc(var(--delete-p, 0.5) * 78%), var(--bubble-out));
}

.message.is-removing {
  pointer-events: none;
  animation: message-remove 0.36s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: center top;
  z-index: 20;
}

.message.is-removing.message--in {
  transform-origin: left top;
}

.message.is-removing.message--out {
  transform-origin: right top;
}

@keyframes message-remove {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 320px;
    margin-bottom: 10px;
  }
  35% {
    opacity: 1;
    transform: translateY(-12px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateY(-56px) scale(0.9);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message {
    transition: none;
  }

  .message.is-removing {
    animation: none;
  }
}

.message.message--in::after,
.message.message--out::after {
  content: none;
  display: none;
}

.message--in {
  align-self: flex-start;
}

.message--out {
  align-self: flex-end;
}

.message--out:has(.message__retry) {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.message__retry {
  flex: 0 0 auto;
  margin-left: 0;
}

.message--has-reactions {
  margin-bottom: 6px;
}

.message__bubble {
  padding: 6px 9px 7px;
  border-radius: calc(var(--radius-default) * 0.4) var(--radius-default) var(--radius-default) var(--radius-default);
  overflow: hidden;
  color: var(--text);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 13px #23415c08;
}

.message__bubble--media {
  padding: 5px;
  max-width: 640px;
}

.message--in .message__bubble {
  background: var(--bubble-in);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-default) * 0.4) var(--radius-default) var(--radius-default) var(--radius-default);
}

.message--out .message__bubble {
  background: var(--bubble-out);
  color: var(--bubble-out-text);
  border: 1px solid var(--bubble-out);
  border-radius: var(--radius-default) calc(var(--radius-default) * 0.4) var(--radius-default) var(--radius-default);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--bubble-out) 17%, transparent);
}

.message--out .message__time {
  color: color-mix(in srgb, var(--bubble-out-text) 65%, transparent);
}

.message--out .message__checks {
  color: color-mix(in srgb, var(--bubble-out-text) 70%, transparent);
}

.message--out .message__checks--read {
  color: color-mix(in srgb, var(--bubble-out-text) 90%, #53bdeb);
}

.message__text {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  word-break: break-word;
  padding: 0;
  color: inherit;
  white-space: pre-wrap;
}

.message__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
  float: right;
  margin-left: 10px;
  padding: 0 4px;
}

.message__edited {
  font-size: 10px;
  font-weight: 400;
  font-style: italic;
  opacity: 0.72;
  line-height: 1;
}

.message__sender {
  font-size: 11px;
  font-weight: 600;
  color: #b03a2e;
  padding: 0 0 2px;
  line-height: 1.2;
}

.message--out .message__sender {
  color: color-mix(in srgb, var(--bubble-out-text) 55%, var(--accent));
}

.message--note {
  align-self: center;
  width: min(100%, 420px);
  max-width: 100%;
}

.message__bubble--note {
  position: relative;
  background: #fff8e8;
  border: 1px solid #f0e0b8;
  color: #5c4a1f;
  box-shadow: none;
  width: 100%;
}

.message__note-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--danger, #b26161);
  cursor: pointer;
}

.message__note-remove:hover {
  color: var(--danger, #b26161);
  background: color-mix(in srgb, var(--danger, #b26161) 12%, transparent);
}

.message__note-remove .icon {
  width: 12px;
  height: 12px;
}

.chat-window.is-resolved .message__note-remove {
  display: none;
}

.message__note-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 28px;
}

.message__note-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #b8860b;
  background: rgb(184 134 11 / 0.12);
}

.message__note-badge .icon {
  width: 14px;
  height: 14px;
}

.message__note-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.message__note-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #8a6d1d;
}

.message__note-author {
  font-size: 0.6875rem;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message__note-body {
  font-size: 0.8125rem;
  line-height: 1.45;
  word-break: break-word;
}

.message__note-body h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.message__note-body p,
.message__note-body ul,
.message__note-body ol {
  margin: 0 0 6px;
}

.message__note-body ul,
.message__note-body ol {
  padding-left: 1.2rem;
}

.message__bubble--note .message__meta {
  color: rgb(92 74 31 / 0.65);
}

.message__contact {
  min-width: 220px;
  max-width: 280px;
  margin: 2px 0 0;
}

.message__contact-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-default);
  background: rgb(0 0 0 / 0.05);
}

.message--out .message__contact-main {
  background: rgb(0 0 0 / 0.08);
}

.message__contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.message__contact-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message__contact-name {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message__contact-phone {
  font-size: 11px;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message__contact-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.message__contact-badge .icon {
  width: 14px;
  height: 14px;
}

.message__contact-avatar--icon {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.message__contact-avatar--icon .icon {
  width: 18px;
  height: 18px;
}

.message__contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: var(--radius-default);
  background: rgb(0 0 0 / 0.06);
}

.message__contact-actions:has(> :only-child) {
  grid-template-columns: 1fr;
}

.message__contact-action {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.message--out .message__contact-action {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.message__contact-action:hover {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

.message__contact-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.message__quote {
  display: block;
  width: 100%;
  margin: 2px 2px 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.06);
  border-left: 4px solid var(--accent);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
}

.message__quote--link {
  cursor: pointer;
}

.message__quote--link:hover {
  filter: brightness(0.97);
}

.message__quote--link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

.message__quote:disabled {
  cursor: default;
  opacity: 1;
}

.message__quote-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.message__quote-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Resposta dentro de bolha enviada: segue a cor do texto da bolha */
.message--out .message__quote {
  background: color-mix(in srgb, var(--bubble-out-text) 14%, transparent);
  border-left-color: color-mix(in srgb, var(--bubble-out-text) 85%, transparent);
}

.message--out .message__quote-author {
  color: color-mix(in srgb, var(--bubble-out-text) 95%, transparent);
}

.message--out .message__quote-text {
  color: color-mix(in srgb, var(--bubble-out-text) 82%, transparent);
}

.message__forwarded {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  padding: 2px 6px 4px;
}

.message__forwarded .icon {
  width: 14px;
  height: 14px;
}

.message__reactions {
  position: absolute;
  bottom: -6px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
  pointer-events: none;
}

.message--in .message__reactions {
  left: 8px;
}

.message--out .message__reactions {
  right: 8px;
}

.message__reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--surface);
  border: 1px solid rgb(0 0 0 / 0.06);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
  line-height: 1;
}

.message__reaction-emoji {
  font-size: 0.75rem;
  line-height: 1;
}

.message__reaction-count {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.message__time {
  font-size: 9px;
  color: var(--text-soft);
}

.message__checks {
  display: inline-flex;
  align-items: center;
  color: #9aa3a7;
  line-height: 0;
  margin-left: 2px;
}

.message__checks--read {
  color: #53bdeb;
}

.icon--checks {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message__media {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: var(--radius-default);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .message__media {
  border-radius: 10px;
}

.message__media img,
.message__media video {
  display: block;
  width: 100%;
  height: 320px;
  max-height: 420px;
  object-fit: cover;
  background: #111;
}

.message__media--video {
  cursor: default;
}

.message__media--video video {
  height: 300px;
  max-height: 380px;
  object-fit: contain;
  background: #0b0b0b;
}

.message__media-hint {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  background: rgb(0 0 0 / 0.45);
  padding: 4px 8px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.message__media--image:hover .message__media-hint {
  opacity: 1;
}

.message__audio {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 320px;
}

.message__bubble--audio {
  padding: 6px 8px 4px;
}

.message__audio-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  background: transparent;
  transition: transform 0.15s ease, color 0.15s ease;
}

.message--in .message__audio-play {
  color: var(--accent);
}

.message--out .message__audio-play,
.message__audio--out .message__audio-play {
  color: var(--bubble-out-text);
}

.message__audio-play:hover {
  transform: scale(1.06);
}

.message__audio-play .icon {
  width: 22px;
  height: 22px;
}

.message__audio-main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.message__audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  cursor: pointer;
  user-select: none;
}

.message__audio-bar {
  flex: 1;
  min-width: 2px;
  max-width: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 42%, transparent);
  transition: background 0.08s linear;
}

.message__audio-bar.is-played {
  background: var(--accent);
}

.message--out .message__audio-bar {
  background: color-mix(in srgb, var(--bubble-out-text) 35%, transparent);
}

.message--out .message__audio-bar.is-played {
  background: color-mix(in srgb, var(--bubble-out-text) 78%, transparent);
}

.message__audio-time {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  line-height: 1;
  padding-left: 1px;
  position: absolute;
  bottom: -15px;
  left: 0;
}

.message--out .message__audio-time {
  color: color-mix(in srgb, var(--bubble-out-text) 65%, transparent);
}

.message__audio-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: visible;
}

.message__audio-avatar img,
.message__audio-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
  color: var(--text-muted);
}

.message--in .message__audio-avatar-fallback {
  background: color-mix(in srgb, var(--accent) 16%, var(--bubble-in));
  color: var(--accent);
}

.message--out .message__audio-avatar-fallback,
.message__audio--out .message__audio-avatar-fallback {
  background: color-mix(in srgb, var(--bubble-out-text) 20%, transparent);
  color: var(--bubble-out-text);
}

.message__audio-mic {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text, #fff);
  box-shadow: 0 0 0 2px var(--bubble-in);
}

.message--in .message__audio-mic {
  background: var(--accent);
  color: var(--accent-text, #fff);
  box-shadow: 0 0 0 2px var(--bubble-in);
}

.message--out .message__audio-mic,
.message__audio--out .message__audio-mic {
  background: var(--bubble-out-text);
  color: var(--bubble-out);
  box-shadow: 0 0 0 2px var(--bubble-out);
}

.message__audio-mic .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2.5;
}

.message__attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  padding: 10px;
  margin: 2px 2px 8px;
  max-width: 100%;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .message__attachment {
  border-radius: 10px;
}

.attachment__preview-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--text);
}

.attachment__preview-btn:hover .attachment__name {
  color: var(--accent);
}

.attachment__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fce8e6;
  color: #d93025;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

.attachment__info {
  flex: 1;
  min-width: 0;
}

.attachment__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment__meta {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.attachment__download {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.attachment__download:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  transform: scale(1.05);
}

/* === components/ChatMoreMenu.css === */
/* ChatMoreMenu — hover alinhado ao nav-submenu__menu */
.chat-more {
  position: relative;
}

.chat-more__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 180px;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .chat-more__menu {
  border-radius: var(--radius-default);
}

.chat-more__menu[hidden] {
  display: none;
}

.chat-more__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-default);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-radius 0.2s ease, color 0.12s ease;
}

.chat-more__item-label {
  min-width: 0;
}

.chat-more__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-soft);
}

.chat-more__item-icon .icon {
  width: 14px;
  height: 14px;
  stroke-width: 1.5;
}

html[data-template="rounded"] .chat-more__item {
  border-radius: var(--radius-default);
}

.chat-more__item:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.chat-more__item:hover .chat-more__item-icon {
  color: var(--menu-hover-fg);
}

html[data-theme-mode="dark"] .chat-more__item:hover,
html[data-theme-mode="dark"] .chat-more__item:hover .chat-more__item-icon {
  color: var(--text);
  background: var(--menu-hover-bg);
}

html[data-theme-mode="dark"] .chat-more__item:hover .chat-more__item-icon {
  background: transparent;
}

.chat-more__item--danger {
  color: var(--danger, #dc2626);
}

.chat-more__item--danger .chat-more__item-icon {
  color: inherit;
}

.chat-more__item--danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.chat-more__item--danger:hover .chat-more__item-icon {
  color: var(--danger);
}

/* Menu de contexto na lista de conversas */
.chat-list-menu.chat-more__menu {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  z-index: 1200;
}

.chat-more__item--mobile {
  display: none;
}

@media (max-width: 800px) {
  .chat-more__item.chat-more__item--mobile {
    display: flex;
  }
}

/* === components/ThemePickerMenu.css === */
/* ThemePickerMenu */
.theme-picker__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 220px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.12);
  transition: border-radius 0.2s ease;
}

.theme-picker__menu::before,
.theme-picker__menu::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
}

.theme-picker__menu::before {
  top: -8px;
  border-width: 0 9px 8px 9px;
  border-color: transparent transparent var(--border) transparent;
  z-index: 0;
}

.theme-picker__menu::after {
  top: -7px;
  right: 13px;
  border-width: 0 8px 7px 8px;
  border-color: transparent transparent var(--surface) transparent;
  z-index: 1;
}

html[data-template="rounded"] .theme-picker__menu {
  border-radius: var(--radius-default);
}

.theme-picker__menu[hidden] {
  display: none;
}

.theme-picker__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.theme-picker__title::after {
  content: "";
  flex: 1;
  border-top: 1px dotted var(--border);
}

.theme-picker__title--spaced {
  margin-top: 14px;
}

.theme-picker__swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 2px;
}

.theme-picker__swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-default);
  background: var(--swatch);
  border: 1px solid color-mix(in srgb, var(--swatch-edge, var(--swatch)) 35%, transparent);
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-radius 0.2s ease;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}

html[data-template="rounded"] .theme-picker__swatch {
  border-radius: 50%;
}

.theme-picker__swatch--icon {
  background: var(--surface);
}

.theme-picker__swatch-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

html[data-theme-mode="dark"] .theme-picker__swatch-icon {
  filter: brightness(0) invert(1);
}

.theme-picker__swatch:hover {
  transform: scale(1.08);
}

.theme-picker__swatch.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.theme-picker__templates {
  display: flex;
  gap: 8px;
}

.theme-picker__template {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-picker__template--square {
  border-radius: 2px;
}

.theme-picker__template--rounded {
  border-radius: 50%;
}

.theme-picker__template:hover {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.theme-picker__template.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.theme-picker__template-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* === components/ChatList.css === */
/* ChatList */
/* ========== Chat list ========== */
.chat-list {
  width: var(--list-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  z-index: 2;
  position: relative;
  margin: 0 8px 0 0;
  padding: 0;
  overflow: hidden;
}


.sidebar-search {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.chat-list__search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 15px 7px;
}

.chat-list-filter-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-list-filter-btn {
  position: relative;
  width: 37px;
  height: 37px;
}

.chat-list-filter-btn.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.chat-list-filter-btn .filter-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.chat-list-filter-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: min(272px, calc(100vw - 40px));
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-list-filter-menu[hidden] {
  display: none;
}

.chat-list-filter__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-list-filter__label {
  margin: 0;
  padding: 0 2px;
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chat-list-filter__multi {
  position: relative;
}

.chat-list-filter__multi-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.chat-list-filter__multi-trigger:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.chat-list-filter__multi-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-filter__multi-chevron {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.65;
}

.chat-list-filter__multi-menu {
  position: absolute;
  z-index: 2;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 180px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.chat-list-filter__multi-menu[hidden] {
  display: none;
}

.chat-list-filter__multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 3px;
  padding: 7px 8px;
  border: 0;
  border-radius: calc(var(--radius-default) - 2px);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.74rem;
  text-align: left;
  cursor: pointer;
}

.chat-list-filter__multi-option:last-child {
  margin-bottom: 0;
}

.chat-list-filter__multi-option:hover {
  background: var(--menu-hover-bg);
}

.chat-list-filter__multi-option.is-active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.chat-list-filter__multi-check {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.chat-list-filter__multi-check .icon {
  width: 14px;
  height: 14px;
}

.chat-list-filter__multi-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-filter__multi-empty {
  margin: 0;
  padding: 8px;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.chat-list-filter__seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--input-bg, var(--surface));
}

.chat-list-filter__seg-btn {
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: calc(var(--radius-default) - 2px);
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.chat-list-filter__seg-btn:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
}

.chat-list-filter__seg-btn.is-active {
  color: var(--accent-text, #fff);
  background: var(--accent);
}

html[data-theme-mode="dark"] .chat-list-filter__seg-btn.is-active {
  color: var(--accent-text);
}

.chat-list-filter__clear {
  width: 100%;
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.72rem;
  cursor: pointer;
}

.chat-list-filter__clear:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.sidebar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid var(--border);
}

.sidebar-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  margin-left: 2px;
}

.sidebar-actions .icon-button {
  width: 31px;
  height: 31px;
  border-radius: var(--radius-default);
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--icon);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
}

.icon-button:hover {
  color: var(--icon);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.icon-button .icon {
  width: 15px;
  height: 15px;
}

/* Filtros em linha — os 4 cabem sem cortar */
.chat-filters.embla {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 0;
  border-bottom: 0;
  --slide-spacing: 3px;
  --fade-w: 0px;
}

.chat-filters .embla__viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  scrollbar-width: none;
}

.chat-filters .embla__viewport::-webkit-scrollbar {
  display: none;
}

.chat-filters .embla__container {
  display: flex;
  width: max-content;
  touch-action: pan-y pinch-zoom;
  margin-left: calc(var(--slide-spacing) * -1);
}

.chat-filters .embla__slide {
  flex: 0 0 auto;
  min-width: auto;
  width: auto;
  padding-left: var(--slide-spacing);
}

/* Setas do Embla — escondidas: os 4 filtros cabem na faixa */
.chat-filters .embla__prev,
.chat-filters .embla__next {
  display: none;
}

.chat-filters .embla__viewport::before,
.chat-filters .embla__viewport::after {
  content: none;
}

.chat-list__empty {
  list-style: none;
  margin: 24px 16px;
  padding: 20px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.chat-list__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 20px;
}

.chat-list__add {
  width: 44px;
  height: 44px;
}

.chat-list__items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 8px 3px 8px 9px;
}

@supports selector(::-webkit-scrollbar) {
  .chat-list .chat-list__items {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
}

.chat-list__fab {
  display: none;
}


@media (max-width: 800px) {
  .chat-list {
    width: 100%;
    margin: 0;
    padding: 0;
    display: none;
  }

  .app[data-mobile-panel="list"] .chat-list {
    display: flex;
  }

  .app[data-mobile-panel="chat"] .chat-list {
    display: none;
  }

  .chat-list__items {
    padding: 8px 12px 24px;
  }
}

/* === components/ChatWindow.css === */
.chat-window {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--chat-bg);
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.chat-window__column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-radius 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-window.is-contact-open .chat-window__column {
  border-radius: var(--radius) 0 0 0;
}

.chat-window.has-contact-panel .contact-panel-shell {
  border-radius: 0 var(--radius) 0 0;
}

.chat-window__header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 72px;
  padding: 0 20px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  user-select: none;
  -webkit-user-select: none;
}

.chat-window__header::before {
  content: none;
}

.chat-window__header > * {
  position: relative;
  z-index: 1;
}

.chat-window__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.chat-window__back {
  display: grid;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--icon);
  border: 1px solid var(--border);
}

.chat-window__back:hover {
  background: var(--menu-hover-bg);
  color: var(--icon);
}

.chat-window__header .icon-btn {
  border-radius: var(--radius-default);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: border-radius 0.2s ease, background 0.15s ease;
}

html[data-template="rounded"] .chat-window__header .icon-btn {
  border-radius: var(--radius-full);
}

.chat-window__header .icon-btn:hover,
.chat-window__actions .icon-btn:hover,
.chat-window__actions .icon-btn.is-active {
  background: var(--menu-hover-bg);
  color: var(--icon);
}

.chat-window__avatar-btn {
  position: relative;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 0;
  cursor: pointer;
}

.chat-window__avatar-btn .chat-item__connection-badge--window {
  width: 20px;
  height: 20px;
  right: -1px;
  bottom: -1px;
}

.chat-window__avatar-btn .chat-item__connection-badge--window .chat-item__connection-badge__img,
.chat-window__avatar-btn .chat-item__connection-badge--window .icon {
  width: 13px;
  height: 13px;
}

.chat-window__avatar-btn:hover {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}

.chat-window__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.chat-window__avatar:not(.avatar--letter) {
  background: #ddd;
}

.chat-window__avatar.avatar--letter {
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 13px;
  color: #fff;
  user-select: none;
}

.chat-window__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.chat-window__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-window__name {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.2px;
  color: var(--text);
  text-align: left;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  cursor: pointer;
}

.chat-window__name:hover {
  color: var(--accent-hover, var(--menu-hover-fg));
}

.priority-tag,
.chat-window__dept {
  flex-shrink: 0;
  padding: 3px 6px;
  color: var(--dept-color, #a96146);
  background: color-mix(in srgb, var(--dept-color, #a96146) 16%, var(--surface));
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.chat-window__tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  overflow: visible;
}

.chat-window__tag {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}

.chat-window__tag::after {
  z-index: 8;
}

.chat-window__tag::before {
  z-index: 8;
}

.chat-window__sub,
.chat-window__assignee {
  margin: 0;
  width: max-content;
  max-width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-window__sub:empty {
  display: none;
}

.chat-window__etiqueta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 1px;
}

.chat-window__assignee-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-window__etiqueta-picker {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
}

button.chat-window__etiqueta-add {
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--icon);
  line-height: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

button.chat-window__etiqueta-add:hover,
.chat-window__etiqueta-picker.is-open button.chat-window__etiqueta-add {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--icon);
  background: var(--menu-hover-bg);
}

button.chat-window__etiqueta-add .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.chat-window__etiqueta-menu {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: min(280px, 72vw);
  z-index: 40;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.chat-window__etiqueta-menu .etiqueta-select__list {
  flex: 1;
  min-height: 0;
}

.chat-window__etiqueta-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-window__etiqueta-apply {
  height: 32px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-text, #fff);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.chat-window__etiqueta-apply:hover {
  background: var(--accent-hover, var(--accent));
}

.chat-window__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.chat-window__actions .icon-btn.is-active {
  background: var(--menu-hover-bg);
  color: var(--icon);
}

.chat-msg-search {
  position: absolute;
  top: 85px;
  left: 12px;
  right: 12px;
  z-index: 5;
}

.chat-msg-search[hidden] {
  display: none !important;
}

.chat-msg-search__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 1.2em;
  text-align: center;
}

.chat-msg-search__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-msg-search__close:hover {
  background: var(--menu-hover-bg);
  color: var(--icon);
}

.chat-window:has(.chat-msg-search.is-open) .chat-window__messages {
  padding-top: 140px;
}

.message.is-search-dim {
  opacity: 0.35;
}

.message.is-search-hit .message__bubble {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}

.message.is-quote-target .message__bubble {
  animation: quote-target-flash 1.25s ease;
}

@keyframes quote-target-flash {
  0%,
  100% {
    outline-color: transparent;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.04);
  }
  20%,
  55% {
    outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  }
}

.chat-window__messages {
  flex: 1;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 96px 0 calc(110px + var(--keyboard-inset, 24px));
  padding-inline: clamp(20px, 5vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--chat-bg-pattern);
  user-select: none;
  -webkit-user-select: none;
}

.chat-window__messages.has-composer-preview {
  padding-bottom: calc(190px + var(--keyboard-inset, 24px));
}

.date-separator {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin: 0 auto 18px;
}

.date-separator::before,
.date-separator::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.chat-notice {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: min(420px, 92%);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  padding: 6px 9px;
  border-radius: 6px;
  margin: 4px 0 10px;
  line-height: 1.35;
}

.chat-notice time {
  font-size: 10px;
  color: var(--text-soft);
}

.chat-window__messages.has-composer-reply {
  padding-bottom: calc(180px + var(--keyboard-inset, 24px));
}

.chat-window__assume {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 0 24px 22px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(to top, var(--chat-bg) 35%, transparent);
}

.chat-window__assume-btn {
  pointer-events: auto;
  height: 40px;
  min-width: 130px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-float);
}

.chat-window__assume-btn:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.chat-window.is-drop-target .chat-window__column::after {
  content: "Solte o arquivo aqui";
  position: absolute;
  inset: 12px;
  z-index: 20;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0;
  border: 2px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  pointer-events: none;
}

@media (max-width: 800px) {
  .chat-window {
    display: none;
    border-radius: var(--radius);
    width: 100%;
  }

  .chat-window__messages {
    padding-inline: 12px;
  }

  .app[data-mobile-panel="list"] .chat-window {
    display: none;
  }

  .app[data-mobile-panel="chat"] .chat-window {
    display: flex;
  }

  .workspace .page-panel.chat-window {
    display: flex;
  }

  .chat-window.is-drop-target .chat-window__column::after {
    border-radius: var(--radius);
  }
}

@media (max-width: 800px) {
  .chat-window__actions #chat-search-toggle,
  .chat-window__actions #chat-notes-toggle {
    display: none;
  }

  .chat-window__etiqueta-row {
    display: none;
  }
}

/* === components/TopNav.css === */
/* TopNav */
/* ========== Top nav ========== */
.top-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: var(--app-max-w);
  width: 100%;
  margin: 0 auto 18px;
  padding: 0;
  background: transparent;
  border-bottom: none;
  overflow: visible;
  z-index: 40;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 136px;
  color: var(--text);
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-default);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 17%, transparent);
}

.brand-icon .icon {
  width: 17px;
  height: 17px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.brand-name span {
  color: var(--accent);
}

.profile-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 152px;
  max-width: 168px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 5px 18px #18395c08;
  box-sizing: border-box;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.profile-button__who {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.profile-button__chevron {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  border-radius: var(--radius-default);
  flex-shrink: 0;
}

.profile-button__chevron:hover,
.profile-button__chevron[aria-expanded="true"] {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
}

.profile-button:hover,
.profile-menu-wrap.is-open .profile-button,
.profile-button[aria-expanded="true"] {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.profile-button__name {
  flex: 1;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.profile-button .avatar-sm {
  width: 29px;
  height: 29px;
  font-size: 9px;
}

.profile-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 9px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 190px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: 0 16px 35px #1839571f;
  overflow: visible;
}

/* Seta com borda: ::before = contorno, ::after = preenchimento (por cima da borda do card) */
.profile-menu::before,
.profile-menu::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
}

.profile-menu::before {
  top: -8px;
  border-width: 0 9px 8px 9px;
  border-color: transparent transparent var(--border) transparent;
  z-index: 0;
}

.profile-menu::after {
  top: -7px;
  border-width: 0 8px 7px 8px;
  border-color: transparent transparent var(--surface) transparent;
  right: 13px;
  z-index: 1;
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu__item,
.profile-menu .theme-picker__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: max(0px, calc(var(--radius-default) - 7px));
  text-align: left;
  font-size: 0.75rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

.profile-menu__item .icon,
.profile-menu .theme-picker__btn .icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  flex-shrink: 0;
}

.profile-menu__item:hover,
.profile-menu__item.is-active,
.profile-menu .theme-picker__btn:hover,
.theme-picker.is-open .theme-picker__btn {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
}

html[data-theme-mode="dark"] .profile-menu__item:hover,
html[data-theme-mode="dark"] .profile-menu__item.is-active,
html[data-theme-mode="dark"] .profile-menu .theme-picker__btn:hover,
html[data-theme-mode="dark"] .theme-picker.is-open .theme-picker__btn,
html[data-theme-mode="dark"] .nav-submenu__item:hover,
html[data-theme-mode="dark"] .nav-submenu__item.is-active,
html[data-theme-mode="dark"] .nav-submenu__item:hover .nav-submenu__icon,
html[data-theme-mode="dark"] .nav-submenu__item.is-active .nav-submenu__icon {
  color: var(--text);
  background: var(--menu-hover-bg);
}

.profile-menu__sep {
  display: block;
  height: 1px;
  margin: 5px 4px;
  background: var(--border);
}

.profile-menu .profile-logout {
  color: #b26161;
}

.profile-menu .profile-logout:hover {
  color: #b26161;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.profile-menu-wrap .theme-picker {
  position: static;
}

.profile-menu-wrap .theme-picker__menu {
  top: calc(100% + 9px);
  right: 0;
}

.start-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgb(15 18 24 / 0.28);
}

.start-chat-backdrop[hidden],
.start-chat[hidden] {
  display: none !important;
}

.start-chat {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 21;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
}

.start-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.start-chat__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.start-chat__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.start-chat__close:hover {
  background: rgb(0 0 0 / 0.05);
  color: var(--text);
}

.start-chat__field {
  display: grid;
  gap: 4px;
}

.start-chat__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.start-chat__field input,
.start-chat__field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background-color: var(--input-bg);
}

.start-chat__submit {
  width: 100%;
  border: 0;
  border-radius: var(--radius-default);
  padding: 10px 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  cursor: pointer;
}

.start-chat__submit:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.start-chat__submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.top-nav__spacer {
  flex: 1;
  min-width: 0;
}

.top-nav__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 0;
}

.top-nav__links {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: 0 5px 18px #18395c08;
}

.top-nav__links--desktop {
  position: relative;
  gap: 5px;
}

.top-nav__links--mobile {
  display: none;
}

.nav-menu {
  display: none;
  position: relative;
  flex-shrink: 0;
}

.nav-menu__btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nav-menu.is-open .nav-menu__btn,
.nav-menu__btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.nav-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 200px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.12);
}

.nav-menu__panel[hidden] {
  display: none;
}


.nav-submenu {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-submenu__trigger {
  gap: 7px;
  padding: 9px 12px;
  border-left: 1px solid #edf1f5;
  border-radius: 0 max(0px, calc(var(--radius-full) - 4px)) max(0px, calc(var(--radius-full) - 4px)) 0;
}

.nav-submenu__chevron {
  display: inline-flex;
  margin-left: 2px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.nav-submenu__chevron .icon {
  width: 14px;
  height: 14px;
}

.nav-submenu.is-open .nav-submenu__chevron {
  transform: rotate(180deg);
}

.nav-submenu__menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 50;
  min-width: 160px;
  transition: border-radius 0.2s ease;
}

.nav-submenu__menu::before,
.nav-submenu__menu::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
}

.nav-submenu__menu::before {
  top: -8px;
  border-width: 0 9px 8px 9px;
  border-color: transparent transparent var(--border) transparent;
  z-index: 0;
}

.nav-submenu__menu::after {
  top: -7px;
  right: 13px;
  border-width: 0 8px 7px 8px;
  border-color: transparent transparent var(--surface) transparent;
  z-index: 1;
}

html[data-template="rounded"] .nav-submenu__menu {
  border-radius: var(--radius-default);
}

.nav-submenu__menu[hidden] {
  display: none;
}

.nav-submenu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: max(0px, calc(var(--radius-default) - 4px));
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: border-radius 0.2s ease;
}

.nav-submenu__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-soft);
}

.nav-submenu__icon .icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  stroke-width: 1.5;
}

.nav-submenu__item:hover .nav-submenu__icon,
.nav-submenu__item.is-active .nav-submenu__icon {
  color: var(--menu-hover-fg);
}

.nav-submenu__item:hover,
.nav-submenu__item.is-active {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.nav-submenu__item--danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.nav-submenu__item--danger:hover .nav-submenu__icon {
  color: var(--danger);
}

.nav-submenu--mobile {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.nav-submenu__menu--inline {
  position: static;
  top: auto;
  right: auto;
  min-width: 0;
  margin-top: 4px;
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0 0 0 8px;
}

.nav-submenu__menu--inline::before,
.nav-submenu__menu--inline::after {
  display: none;
}

.nav-submenu__menu--inline .nav-submenu__item {
  padding: 8px 12px;
  border-radius: max(0px, calc(var(--radius-default) - 8px));
}

/* Seletor de tema */
.theme-picker {
  position: relative;
  flex-shrink: 0;
  touch-action: none;
  will-change: transform;
}

.theme-picker.is-pulling {
  z-index: 40;
}

.theme-picker.is-pulling .magnet__inner {
  transition: none;
}

.theme-picker.is-pull-freed .theme-picker__btn {
  color: var(--accent);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.04),
    0 8px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .theme-picker {
    touch-action: manipulation;
  }
}

.theme-picker__btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, border-radius 0.2s ease;
}

.theme-picker__btn:hover,
.theme-picker.is-open .theme-picker__btn {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.theme-picker__btn .palette-dot {
  fill: currentColor;
  stroke: none;
}

.theme-picker.is-open .theme-picker__btn .palette-dot {
  animation: palette-dot-pulse 1.1s ease-in-out infinite;
}

.theme-picker.is-open .theme-picker__btn .palette-dot:nth-child(1) {
  animation-delay: 0s;
}

.theme-picker.is-open .theme-picker__btn .palette-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.theme-picker.is-open .theme-picker__btn .palette-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.theme-picker.is-open .theme-picker__btn .palette-dot:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes palette-dot-pulse {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}


@media (max-width: 800px) {
  .top-nav {
    margin-bottom: 10px;
    gap: 12px;
  }

  .brand-name {
    display: none;
  }

  .brand-mark {
    min-width: 36px;
  }

  .profile-button {
    min-width: 0;
    max-width: none;
  }

  .profile-button__name {
    display: none;
  }

  .top-nav__links--desktop {
    display: none;
  }

  .nav-menu {
    display: block;
  }

  .top-nav__links--mobile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  .top-nav__links--mobile .top-nav__link {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: max(0px, calc(var(--radius-default) - 8px));
    font-size: 0.75rem;
    font-weight: 400;
  }

  .top-nav {
    position: relative;
  }

  .top-nav .stalled-alerts {
    position: static;
  }

  .top-nav .stalled-alerts__menu {
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
  }
}

/* Shell estático do index.html (antes do JS) */
.top-nav--boot .top-nav__links {
  gap: 12px;
  padding: 8px 12px;
}

.stalled-alerts {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.stalled-alerts.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.stalled-alerts__btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-default);
  display: grid;
  place-items: center;
  color: var(--icon);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .stalled-alerts__btn {
  border-radius: var(--radius-full);
}

.stalled-alerts__btn:hover,
.stalled-alerts.is-open .stalled-alerts__btn {
  color: var(--icon);
  background: var(--menu-hover-bg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.stalled-alerts__btn .top-nav__unread {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
}

.stalled-alerts__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 260px;
  max-width: 320px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-card);
}

.stalled-alerts__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: max(0px, calc(var(--radius-default) - 6px));
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text);
  background: transparent;
}

.stalled-alerts__item:hover {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
}

html[data-theme-mode="dark"] .stalled-alerts__item:hover {
  color: var(--text);
}

/* === components/AddButton.css === */
.add-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-text);
  transition: background 0.15s ease, border-radius 0.2s ease;
  box-shadow: var(--shadow-card);
}

.add-btn:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

/* === components/NavLink.css === */
/* NavLink */
.top-nav__link .icon {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex-shrink: 0;
}

.top-nav__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: var(--radius-default);
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-radius 0.2s ease;
}

/* Stub sem ícone: reserva o mesmo 16px do SVG final */
.top-nav__links--desktop .top-nav__link:not(:has(> .icon))::before {
  content: "";
  width: 16px;
  min-width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Dentro do chip desktop: raio interno = raio do container − padding (4px) */
.top-nav__links--desktop .top-nav__link {
  border-radius: max(0px, calc(var(--radius-full) - 4px));
}

.top-nav__link:hover,
.top-nav__link--active {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
}

.top-nav__link--active:hover {
  color: var(--menu-hover-fg);
  background: var(--menu-hover-bg);
}

.top-nav__links--mobile .top-nav__link--active {
  background: var(--accent);
  color: var(--accent-text);
}

.top-nav__links--mobile .top-nav__link--active:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

/* Dark: texto claro no hover/active — nunca accent-text preto */
html[data-theme-mode="dark"] .top-nav__link:hover,
html[data-theme-mode="dark"] .top-nav__link--active,
html[data-theme-mode="dark"] .top-nav__link--active:hover,
html[data-theme-mode="dark"] .top-nav__links--mobile .top-nav__link--active,
html[data-theme-mode="dark"] .top-nav__links--mobile .top-nav__link--active:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
}

.top-nav__unread {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: #e26e4c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-nav__link.has-unread .top-nav__unread {
  display: inline-flex;
}

.top-nav__link--active .top-nav__unread {
  background: #e26e4c;
  color: #fff;
}

/* === components/LetterAvatar.css === */
.letter-avatar {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
}

.letter-avatar__circle {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: #7f55df;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1;
  user-select: none;
  border: 1px solid rgb(0 0 0 / 15%);
}

.letter-avatar__status {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.letter-avatar__status.is-online {
  background: var(--online, #22c55e);
}

.letter-avatar__status.is-offline {
  background: var(--danger);
}

/* === components/ContactPanel.css === */
/* ContactPanel */
.contact-panel__header,
.contact-panel__avatar-wrap,
.contact-panel__phone-row,
.contact-panel__edit,
.contact-panel__media {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-panel-shell.is-open .contact-panel__header {
  opacity: 1;
  transform: none;
  transition-delay: 0.06s;
}

.contact-panel-shell.is-open .contact-panel__avatar-wrap {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

.contact-panel-shell.is-open .contact-panel__phone-row {
  opacity: 1;
  transform: none;
  transition-delay: 0.14s;
}

.contact-panel-shell.is-open .contact-panel__edit {
  opacity: 1;
  transform: none;
  transition-delay: 0.18s;
}

.contact-panel-shell.is-open .contact-panel__media {
  opacity: 1;
  transform: none;
  transition-delay: 0.22s;
}

.contact-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px 8px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  height: 72px;
}

.contact-panel__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.contact-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.contact-panel__close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--icon);
}

.contact-panel__close:hover {
  background: var(--menu-hover-bg);
  color: var(--icon);
}

.contact-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.contact-panel__avatar-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}

.contact-panel__avatar {
  width: 168px;
  height: 168px;
  border-radius: var(--radius-default);
  object-fit: cover;
  background: #e8e8ec;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .contact-panel__avatar {
  border-radius: 18px;
}

.contact-panel__avatar--empty {
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}

.contact-panel__phone-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.contact-panel__phone {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.contact-panel__phone--empty {
  cursor: default;
  color: var(--text-muted);
}

.contact-panel__copy {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--icon);
  flex-shrink: 0;
}

.contact-panel__copy:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.contact-panel__copy.is-copied {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.contact-panel__copy .icon {
  width: 14px;
  height: 14px;
}

.contact-panel__copied-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #fff;
  background: var(--accent, #0063a3);
  pointer-events: none;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.14);
  animation: contact-copied-float 0.7s ease forwards;
}

@keyframes contact-copied-float {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  10% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  55% {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-22px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-panel__copied-tip {
    animation: none;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.contact-panel__edit {
  height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text, #fff);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
}

.contact-panel__edit:hover {
  background: var(--accent-hover, var(--accent));
}

.contact-panel__media {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-default);
  background: color-mix(in srgb, var(--icon) 10%, var(--surface));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--icon) 22%, var(--border));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
  max-height: min(480px, 55vh);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .contact-panel__media {
  border-radius: 8px;
}

.contact-panel__media-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.contact-panel__media-head:hover .contact-panel__media-title {
  text-decoration: underline;
  color: var(--icon);
}

.contact-panel__media-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--icon) 14%, var(--surface));
  color: var(--icon);
  flex-shrink: 0;
}

.contact-panel__media-icon .icon {
  width: 15px;
  height: 15px;
}

.contact-panel__media-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.contact-panel__media-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--icon) 18%, var(--surface));
  color: var(--icon);
  font-size: 0.75rem;
  font-weight: 500;
}

.contact-panel__media-head .icon {
  width: 14px;
  height: 14px;
  color: var(--icon);
  flex-shrink: 0;
}

.contact-panel__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.contact-panel__thumbs--scroll {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.contact-panel__thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: hidden;
  background: #e4e4e8;
  padding: 0;
}

.contact-panel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.contact-panel__thumb-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: #d4d4da;
}

.contact-panel__thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.28);
  color: #fff;
}

.contact-panel__thumb-play .icon {
  width: 18px;
  height: 18px;
}

.contact-panel__thumb--file {
  display: grid;
  place-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px;
}

.contact-panel__thumb-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--icon);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.contact-panel__thumb--link .contact-panel__thumb-label {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: none;
}

.contact-panel__file-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--icon) 12%, var(--surface));
  color: var(--icon);
}

.contact-panel__media-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: inherit;
  opacity: 0.85;
}

/* Modal — galeria completa */
.contact-media-modal {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.contact-media-modal[hidden] {
  display: none !important;
}

.contact-media-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(10 10 14 / 0.45);
}

.contact-media-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-default);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.28);
  overflow: hidden;
}

html[data-template="rounded"] .contact-media-modal__panel {
  border-radius: 12px;
}

.contact-media-modal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.contact-media-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.contact-media-modal__count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.contact-media-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.contact-media-modal__close:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.contact-media-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 18px;
  overscroll-behavior: contain;
}

.contact-media-modal__body .contact-panel__thumbs {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.contact-media-modal__body .contact-panel__thumbs--scroll {
  overflow: visible;
  flex: none;
  max-height: none;
}

@media (max-width: 900px) {
  .contact-panel-shell {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 8;
    transform: translateX(100%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  .contact-panel-shell.is-open {
    width: 100%;
    transform: translateX(0);
  }

  .contact-panel {
    width: 100%;
    border-left: none;
    box-shadow: none;
    transform: translateX(12px);
  }

  .contact-panel-shell.is-open .contact-panel {
    transform: translateX(0);
  }

  .contact-panel__media {
    max-height: min(360px, 42vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-panel-shell,
  .contact-panel,
  .contact-panel__header,
  .contact-panel__avatar-wrap,
  .contact-panel__phone-row,
  .contact-panel__edit,
  .contact-panel__media {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* === components/NotesPanel.css === */
.notes-panel {
  border-left: 1px solid var(--border);
}
.notes-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 72px;
  box-sizing: border-box;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notes-panel__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.notes-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.notes-panel__count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--menu-hover-bg);
}

.notes-panel__close {
  flex-shrink: 0;
}

.notes-panel__body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent;
}

.notes-panel__body::-webkit-scrollbar {
  width: 6px;
}

.notes-panel__body::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.notes-panel__body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 999px;
}

.notes-panel__body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text) 38%, transparent);
}

.notes-panel__new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-default);
  background: color-mix(in srgb, var(--icon) 8%, var(--surface));
  color: var(--icon);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.notes-panel__new .icon {
  color: inherit;
}

.notes-panel__new:hover {
  background: var(--menu-hover-bg);
  color: var(--icon);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.notes-panel__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-panel__empty {
  margin: 18px 4px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.notes-panel__item {
  position: relative;
  padding: 10px 12px;
  border-radius: var(--radius-default);
  background: #fff8e8;
  border: 1px solid #f0e0b8;
  color: #5c4a1f;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notes-panel__item:hover {
  background: #fff3d6;
  border-color: #e8d4a0;
}

.notes-panel__item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notes-panel__item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.notes-panel__action {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: rgb(92 74 31 / 0.4);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.notes-panel__action:hover {
  color: rgb(92 74 31 / 0.75);
  background: rgb(92 74 31 / 0.08);
}

.notes-panel__action--danger {
  color: var(--danger, #b26161);
}

.notes-panel__action--danger:hover {
  color: var(--danger, #b26161);
  background: color-mix(in srgb, var(--danger, #b26161) 12%, transparent);
}

.notes-panel__action .icon {
  width: 12px;
  min-width: 12px;
  height: 12px;
  min-height: 12px;
}

.notes-panel__author {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5c4a1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.notes-panel__time {
  display: block;
  margin-top: 6px;
  font-size: 0.6875rem;
  color: rgb(92 74 31 / 0.55);
}

.notes-panel__preview {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #5c4a1f;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-window.has-notes-panel .notes-panel-shell {
  border-radius: 0 var(--radius) 0 0;
}

.chat-window.is-notes-open .chat-window__column {
  border-radius: var(--radius) 0 0 0;
}

/* Mobile: anotações e histórico de tickets ocupam a tela toda, igual ao painel do contato */
@media (max-width: 900px) {
  .chat-window > .notes-panel-shell {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 8;
    border-radius: var(--radius);
    transform: translateX(100%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  .chat-window > .notes-panel-shell.is-open {
    width: 100%;
    transform: translateX(0);
  }

  .chat-window > .notes-panel-shell .notes-panel {
    width: 100%;
    border-left: none;
    box-shadow: none;
  }

  .chat-window.is-notes-open .chat-window__column {
    border-radius: var(--radius);
  }
}

/* === components/ResolvedMenu.css === */
.app {
  position: relative;
}

#resolved-menu-host {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  z-index: 80;
  width: min(var(--list-w), 100%);
  pointer-events: none;
}

.resolved-menu-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.resolved-menu-shell.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.resolved-menu {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-radius: 0;
  box-shadow: -12px 0 28px rgb(0 0 0 / 0.08), var(--shadow-card);
  overflow: hidden;
}

.resolved-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 72px;
  box-sizing: border-box;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.resolved-menu__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.resolved-menu__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.resolved-menu__count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--menu-hover-bg);
}

.resolved-menu__close {
  flex-shrink: 0;
}

.resolved-menu__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.resolved-menu__list {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent;
}

.resolved-menu__list::-webkit-scrollbar {
  width: 6px;
}

.resolved-menu__list::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.resolved-menu__list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 999px;
}

.resolved-menu__list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text) 38%, transparent);
}

.resolved-menu__empty {
  margin: 18px 16px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* === components/TicketMenu.css === */
/* TicketMenu — contexto do ticket (botão direito), espelho do chat-list-menu */
.ticket-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  min-width: 210px;
}

.ticket-menu[hidden] {
  display: none;
}

.ticket-menu .chat-more__item[disabled] {
  opacity: 0.45;
  cursor: default;
}

.ticket-menu .chat-more__item[disabled]:hover {
  background: transparent;
  color: var(--text);
}

/* === components/PageModal.css === */
.page-panel:has(.page-modal.is-open) .page-panel__body {
  overflow: hidden;
}

.page-modal {
  z-index: 1400;
}

.page-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 18 24 / 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.page-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-default);
  padding: 24px 22px 18px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.22);
}

html[data-template="rounded"] .page-modal__dialog {
  border-radius: 18px;
}

.page-modal__dialog--wide {
  width: min(920px, 100%);
  max-height: calc(100% - 24px);
  overflow-y: auto;
}

.page-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.page-modal__close:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.page-modal__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 28px 18px 0;
  color: var(--text);
}

/* === components/NoteModal.css === */
.note-modal .page-modal__dialog {
  width: min(520px, 100%);
}

.note-modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-modal__tool {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.note-modal__tool:hover,
.note-modal__tool.is-active {
  background: var(--menu-hover-bg);
  color: var(--accent-hover, var(--menu-hover-fg));
}

.note-modal__editor {
  min-height: 180px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text);
  outline: none;
  background: var(--surface);
}

.note-modal__editor:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.note-modal__editor.is-empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.note-modal__editor h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.note-modal__editor p,
.note-modal__editor ul,
.note-modal__editor ol {
  margin: 0 0 8px;
}

.note-modal__editor ul,
.note-modal__editor ol {
  padding-left: 1.25rem;
}

.note-modal__error {
  margin: 0;
  color: #b03a2e;
  font-size: 0.8125rem;
}

.note-modal__actions {
  margin-top: 4px;
}

/* === components/DocumentPreview.css === */
/* DocumentPreview — overlay no mesmo espírito do lightbox */
.document-preview {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgb(10 10 14 / 0.88);
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.document-preview[hidden] {
  display: none !important;
}

.document-preview__panel {
  position: relative;
  width: min(960px, 96vw);
  height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-default);
  overflow: hidden;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.45);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .document-preview__panel {
  border-radius: 12px;
}

.document-preview__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.document-preview__badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fce8e6;
  color: var(--danger);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

.document-preview__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.document-preview__name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.document-preview__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.document-preview__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.document-preview__action {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #5f5f68;
  transition: background 0.15s ease, color 0.15s ease;
}

.document-preview__action:hover {
  background: #f3f3f5;
  color: var(--text);
}

.document-preview__action--accent {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.document-preview__action--accent:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--accent);
}

.document-preview__body {
  flex: 1;
  min-height: 0;
  background: #f3f3f5;
  position: relative;
}

.document-preview__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.document-preview__text {
  margin: 0;
  height: 100%;
  overflow: auto;
  padding: 20px 22px;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  background: var(--surface);
}

.document-preview__fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  text-align: center;
}

.document-preview__fallback-card {
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.document-preview__fallback-card p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.document-preview__fallback-link {
  margin-top: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.875rem;
}

.document-preview__fallback-link:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.document-preview__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: #f3f3f5;
}

.document-preview__status--error {
  color: #b91c1c;
}

/* === components/Lightbox.css === */
/* Lightbox zoom */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgb(10 10 14 / 0.88);
  display: grid;
  place-items: center;
  padding: 40px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__img {
  max-width: min(960px, 92vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.45);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.lightbox__close:hover {
  background: rgb(255 255 255 / 0.22);
}

/* === components/PagePanel.css === */
/* PagePanel — shell das páginas internas */

/* workspace com página: folga dos dois lados, igual ao painel do chat */
.workspace:has(.page-panel),
.workspace:has(.contacts-page) {
  padding: 0;
  justify-content: center;
}

.page-panel {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--page-panel-max);
  min-width: 0;
  margin: 0 auto;
}

.page-container {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-panel .chat-window__header {
  padding-left: 28px;
  padding-right: 28px;
}

.page-panel .chat-window__header .page-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.page-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 84px 30px 32px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.page-panel__body .page-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.page-container--contacts {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-panel__body--center {
  justify-content: center;
}

.page-panel__body--center .page-container {
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
}

.page-panel__search--header {
  flex: 1;
  min-width: 0;
  max-width: 360px;
  margin-left: auto;
}

.contatos-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 1;
  min-width: 0;
  max-width: 420px;
  justify-content: flex-end;
}

.contatos-header-actions .page-panel__search--header {
  flex: 1;
  margin-left: 0;
  max-width: none;
}

.page-panel .chat-window__header .chat-window__identity {
  flex: 0 1 auto;
}

.page-panel .chat-window__back {
  display: grid;
}

.page-panel__list {
  display: flex;
  flex-direction: column;
}

.page-panel__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* Skeleton enquanto a página lazy carrega */
.page-panel--loading {
  pointer-events: none;
}

.page-panel__skeleton-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.page-panel__skeleton-search {
  display: block;
  width: min(100%, 280px);
  height: 36px;
  border-radius: var(--radius-default);
}

.page-panel__skeleton-btn {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.page-panel__skeleton-back {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.page-panel__skeleton-title {
  width: 120px;
  max-width: 40vw;
  height: 14px;
}

.page-panel__skeleton-subtitle {
  width: 72px;
  height: 10px;
  margin-top: 6px;
}

.page-panel__list--skeleton {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-default);
  overflow: hidden;
}

.page-panel__skeleton-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(100px, 1fr) 100px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.page-panel__skeleton-row:last-child {
  border-bottom: none;
}

.page-panel__skeleton-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-panel__skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.page-panel__skeleton-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.page-panel__skeleton-name {
  width: 48%;
  max-width: 160px;
  height: 11px;
}

.page-panel__skeleton-phone {
  width: 38%;
  max-width: 120px;
  height: 9px;
}

.page-panel__skeleton-chip {
  width: 72%;
  max-width: 140px;
  height: 22px;
  border-radius: var(--radius-full);
}

.page-panel__skeleton-action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  justify-self: end;
}

@media (max-width: 720px) {
  .page-panel__skeleton-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "person action"
      "chip action";
  }

  .page-panel__skeleton-person {
    grid-area: person;
  }

  .page-panel__skeleton-chip {
    grid-area: chip;
    max-width: 120px;
  }

  .page-panel__skeleton-action {
    grid-area: action;
    align-self: center;
  }

  .page-panel__skeleton-search {
    display: none;
  }
}


@media (max-width: 800px) {
  .workspace:has(.page-panel) {
    padding: 0;
  }

  .page-panel {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
  }

  .page-panel .chat-window__header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-panel__body {
    padding: 76px 16px 20px;
  }

  .page-panel__search--header {
    max-width: none;
    flex: 1;
  }

  .contatos-header-actions {
    flex: 1;
    min-width: 0;
  }
}

/* === components/PageLoading.css === */
.app-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  height: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-progress.is-active {
  opacity: 1;
}

.app-progress.is-done {
  opacity: 0;
  transition-delay: 0.12s;
}

.app-progress__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transform: translateX(-100%);
}

.app-progress.is-active .app-progress__bar {
  animation: app-progress-slide 1.1s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.app-progress.is-done .app-progress__bar {
  width: 100%;
  transform: none;
  animation: none;
  transition: width 0.2s ease;
}

html.is-busy,
html.is-busy body {
  cursor: progress;
}

@keyframes app-progress-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

.page-loading {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--app-max-w);
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0 auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  color: var(--text);
  animation: page-loading-in 0.2s ease both;
}

.page-loading[data-boot-page] {
  animation: none;
}

.app[data-boot-skeleton]:not([data-boot-skeleton="chat"]) .workspace > [data-boot-chat],
.app:not([data-boot-slot]) .workspace > [data-boot-chat] .chat-item__expand-slot,
.workspace > [data-boot-page][hidden] {
  display: none;
}

.page-loading .skeleton {
  display: block;
  flex-shrink: 0;
}

.page-loading__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 30px;
  flex-shrink: 0;
}

.page-loading__header--split {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-loading__header--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.page-loading__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

.page-loading__header h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.45px;
}

.page-loading__subtitle {
  width: min(220px, 60%);
  height: 10px;
}

.page-loading__heading .page-loading__subtitle {
  width: 180px;
  max-width: 100%;
}

.page-loading__tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.page-loading__button {
  width: 132px;
  height: 40px;
  border-radius: var(--radius-default);
}

html[data-template="rounded"] .page-loading__button {
  border-radius: var(--radius-full);
}

.page-loading__button--sm {
  width: 110px;
}

.page-loading__select {
  width: 124px;
  height: 36px;
  border-radius: var(--radius-default);
}

.page-loading__select--sm {
  width: 94px;
}

.page-loading__select--wide {
  width: 220px;
  height: 40px;
}

.page-loading__toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 30px 18px;
  flex-shrink: 0;
}

.page-loading__search {
  flex: 1 1 auto;
  max-width: 420px;
  height: 40px;
  border-radius: var(--radius-default);
}

.page-loading__segment {
  width: 132px;
  height: 38px;
  border-radius: var(--radius-default);
}

.page-loading__card {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 30px 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
}

.page-loading__card-head,
.page-loading__table-row--head {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--icon) 6%, var(--surface));
}

.page-loading__label {
  width: 90px;
  height: 9px;
}

.page-loading__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.page-loading__row:last-child {
  border-bottom: 0;
}

.page-loading__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.page-loading__text {
  height: 10px;
}

.page-loading__chip {
  width: 64px;
  height: 18px;
  margin-left: auto;
  border-radius: var(--radius-full);
}

.page-loading__table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(5, minmax(0, 1fr));
  align-items: center;
  column-gap: 20px;
  min-height: 60px;
  padding: 10px 15px;
  border-top: 1px solid var(--border);
}

.page-loading__table-row.page-loading__table-row--head {
  min-height: 0;
  padding: 12px 15px;
  border-top: 0;
}

.page-loading__cell {
  height: 10px;
}

.page-loading__table-row--head .page-loading__cell {
  height: 8px;
}

.page-loading__pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 30px 16px;
  flex-shrink: 0;
}

.page-loading__page {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-default);
}

.page-loading__scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 30px 30px;
  overflow: hidden;
}

.page-loading__stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.page-loading__stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
}

.page-loading__stat-line {
  display: block;
  height: 1px;
  background: var(--border);
}

.page-loading__value {
  width: 40%;
  height: 18px;
}

.page-loading__panel {
  flex-shrink: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
}

.page-loading__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.page-loading__panel-title {
  width: 190px;
  max-width: 60%;
  height: 12px;
}

.page-loading__date {
  width: 110px;
  height: 14px;
}

.page-loading__chart {
  height: 230px;
  margin: 0 12px;
  border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 56px,
    color-mix(in srgb, var(--border) 85%, transparent) 56px,
    color-mix(in srgb, var(--border) 85%, transparent) 57px
  );
}

.page-loading__axis {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
}

.page-loading__tick {
  width: 36px;
  height: 9px;
}

.page-loading__rank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 16px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.page-loading__panel-head + .page-loading__rank {
  border-top: 0;
}

.page-loading__rank-name,
.page-loading__rank-value {
  height: 10px;
}

.page-loading__rank-track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.page-loading__rank-track .page-loading__rank-bar {
  height: 100%;
}

.page-loading__panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.page-loading__tabs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin: 0 30px 16px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-loading__tab {
  width: 158px;
  height: 36px;
  border-radius: var(--radius-default) var(--radius-default) 0 0;
}

.page-loading__tab + .page-loading__tab {
  width: 142px;
}

.page-loading__calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 0 30px 16px;
  overflow: hidden;
}

.page-loading__weekday {
  justify-self: center;
  width: 28px;
  height: 10px;
  margin: 6px 0;
}

.page-loading__day {
  height: 105px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
}

.page-loading__day-num {
  width: 14px;
  height: 10px;
}

.page-loading__pills {
  display: flex;
  gap: 8px;
  padding: 0 30px 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.page-loading__pill {
  width: 116px;
  height: 36px;
  border-radius: var(--radius-full);
}

.page-loading__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 0 0 auto;
  padding: 22px;
}

.page-loading__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}

.page-loading__field-label {
  width: 110px;
  height: 9px;
}

.page-loading__input {
  height: 42px;
  border-radius: var(--radius-default);
}

.page-loading__board {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 30px 20px;
  overflow: hidden;
}

.page-loading__column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 300px;
  padding: 14px 12px 12px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-default) + 4px);
  background: color-mix(in srgb, var(--icon) 6%, var(--surface));
}

.page-loading__column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 2px;
}

.page-loading__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.page-loading__column-title {
  width: 90px;
  height: 12px;
}

.page-loading__kcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
}

.page-loading__ktag {
  width: 52px;
  height: 14px;
  border-radius: 6px;
}

.page-loading__ktitle {
  width: 75%;
  height: 12px;
}

.page-loading__kmeta {
  width: 40%;
  height: 9px;
}

html[data-theme-mode="dark"] .page-loading__column {
  background: var(--surface-deep);
}

html[data-theme-mode="dark"] .page-loading .skeleton {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--text) 8%, transparent) 25%,
    color-mix(in srgb, var(--text) 16%, transparent) 37%,
    color-mix(in srgb, var(--text) 8%, transparent) 63%
  );
  background-size: 400% 100%;
}

@keyframes page-loading-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .page-loading {
    box-shadow: none;
  }

  .page-loading__header {
    padding: 11px;
  }

  .page-loading__header--split {
    flex-wrap: wrap;
  }

  .page-loading__tools {
    flex-wrap: wrap;
  }

  .page-loading__select--wide {
    width: 160px;
  }

  .page-loading__toolbar,
  .page-loading__pills {
    padding: 0 11px 14px;
  }

  .page-loading__card {
    margin: 0 11px 11px;
  }

  .page-loading__row {
    padding: 12px 14px;
  }

  .page-loading__table-row {
    grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  }

  .page-loading__table-row > :nth-child(n + 4) {
    display: none;
  }

  .page-loading__pager {
    padding: 0 11px 11px;
  }

  .page-loading__scroll {
    padding: 0 11px 11px;
  }

  .page-loading__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-loading__chart {
    height: 160px;
    margin: 0;
  }

  .page-loading__tick:nth-child(even) {
    display: none;
  }

  .page-loading__panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-loading__tabs {
    margin: 0 11px 14px;
  }

  .page-loading__calendar {
    gap: 4px;
    margin: 0 11px 15px;
  }

  .page-loading__weekday {
    width: 22px;
    margin: 2px 0;
  }

  .page-loading__day {
    height: 46px;
    padding: 5px 2px;
    border-radius: 10px;
  }

  .page-loading__day-num {
    margin: 0 auto;
  }

  .page-loading__form {
    padding: 16px;
  }

  .page-loading__board {
    gap: 10px;
    padding: 0 11px 11px;
  }

  .page-loading__column {
    flex-basis: min(86vw, 320px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-progress.is-active .app-progress__bar {
    width: 100%;
    transform: none;
    animation: none;
    opacity: 0.7;
  }

  .page-loading {
    animation: none;
  }
}

/* === components/FormField.css === */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-field__control {
  position: relative;
  display: block;
}

.form-field__input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background-color: var(--input-bg);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.18s ease, border-radius 0.2s ease, box-shadow 0.18s ease;
}

textarea.form-field__input {
  resize: vertical;
  min-height: 72px;
}

.form-field__input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

html[data-theme-mode="dark"] .form-field__input {
  color-scheme: dark;
}

.form-field .password-field .form-field__input {
  padding-right: 44px;
}

.form-field.is-invalid .form-field__input,
.form-field.is-invalid .phone-field__number {
  border-color: var(--danger, #dc2626);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger, #dc2626) 22%, transparent);
}

.form-field.is-invalid .form-field__input:focus,
.form-field.is-invalid .phone-field__number:focus {
  border-color: var(--danger, #dc2626);
}

.form-field__error {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 0 2px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--danger, #dc2626);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.form-field.is-invalid .form-field__error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.form-field__control.is-shake {
  animation: form-field-shake 0.4s ease;
}

@keyframes form-field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

.form-field--login {
  gap: 0;
}

.form-field--login .form-field__control.login-field {
  position: relative;
}

.form-field--login .form-field__input {
  width: 100%;
  flex: 1;
  min-width: 0;
  height: 42px;
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: 0.875rem;
}

.form-field--login .form-field__input:focus {
  border: none;
  box-shadow: none;
}

.form-field--login.is-invalid .login-field {
  border-color: var(--danger, #dc2626);
  background: color-mix(in srgb, var(--danger, #dc2626) 8%, var(--input-bg));
}

.form-field--login.is-invalid .form-field__input {
  border: none;
  box-shadow: none;
}

.form-field--login .form-field__error {
  left: 4px;
  right: 4px;
}

.form-field .departamento-name-row__fields .form-field__input {
  flex: 1;
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .form-field__control.is-shake {
    animation: none;
  }

  .form-field__error {
    transition: none;
  }
}

html[data-template="rounded"] .form-field__input {
  border-radius: var(--radius-default);
}

/* === components/FormActions.css === */
.contact-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  min-height: 38px;
}

.contact-form__btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-default);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  transition:
    border-radius 0.2s ease,
    opacity 0.28s ease,
    transform 0.28s ease;
}

.contact-form__btn.is-leaving {
  opacity: 0;
  transform: scale(0.96) translateX(8px);
  pointer-events: none;
}

html[data-template="rounded"] .contact-form__btn {
  border-radius: var(--radius-default);
}

.contact-form__btn--ghost {
  background: color-mix(in srgb, var(--icon) 10%, var(--surface));
  color: var(--text);
  border: 1px solid var(--border);
}

.contact-form__btn--ghost:hover {
  background: var(--menu-hover-bg);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.contact-form__btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.contact-form__btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.contact-form__spinner-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 38px;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-form__spinner-wrap.is-visible {
  opacity: 1;
  transform: scale(1);
}

.contact-form__spinner {
  width: 40px;
  height: 40px;
  object-fit: contain;
  animation: contact-form-spin 0.85s linear infinite;
}

@keyframes contact-form-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 800px) {
  .page-modal__dialog {
    --modal-pad-x: 22px;
    --modal-pad-b: 18px;
  }

  .new-ticket-modal__dialog,
  .bh-modal__dialog {
    --modal-pad-x: 22px;
    --modal-pad-b: 20px;
  }

  .page-modal__dialog,
  .new-ticket-modal__dialog,
  .bh-modal__dialog {
    max-height: 100%;
    overflow-y: auto;
  }

  :is(.page-modal__dialog, .new-ticket-modal__dialog, .bh-modal__dialog) .contact-form__actions {
    position: sticky;
    bottom: calc(var(--modal-pad-b) * -1);
    z-index: 3;
    margin-right: calc(var(--modal-pad-x) * -1);
    margin-bottom: calc(var(--modal-pad-b) * -1);
    margin-left: calc(var(--modal-pad-x) * -1);
    padding: 12px var(--modal-pad-x) var(--modal-pad-b);
    --form-actions-shadow: 0 -10px 18px -14px color-mix(in srgb, var(--text) 22%, transparent);
    background: color-mix(in srgb, var(--surface) 62%, transparent);
    -webkit-backdrop-filter: blur(6px) saturate(1.4);
    backdrop-filter: blur(6px) saturate(1.4);
    box-shadow: var(--form-actions-shadow);
  }

  html[data-theme-mode="dark"] :is(.page-modal__dialog, .new-ticket-modal__dialog, .bh-modal__dialog) .contact-form__actions {
    --form-actions-shadow: 0 -12px 22px -12px color-mix(in srgb, #000 70%, transparent);
  }

  @supports (animation-timeline: scroll()) {
    :is(.page-modal__dialog, .new-ticket-modal__dialog, .bh-modal__dialog) .contact-form__actions {
      box-shadow: none;
      animation: form-actions-edge linear both;
      animation-timeline: scroll(nearest block);
    }
  }
}

@keyframes form-actions-edge {
  0%,
  92% {
    box-shadow: var(--form-actions-shadow);
  }

  100% {
    box-shadow: none;
  }
}

/* === components/EtiquetaSelect.css === */
.etiqueta-select {
  position: relative;
  width: 100%;
}

/* Chip de cor + nome (Contatos, selects, ticket…) */
.etiqueta-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.etiqueta-chip__bar {
  display: block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: 0 0 20px;
  border-radius: var(--radius-default);
  background: var(--etiqueta-color, #9ca3af);
  border: 1px solid rgb(0 0 0 / 0.08);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .etiqueta-chip__bar {
  border-radius: 50%;
}

.etiqueta-chip__name {
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-etiqueta-picker__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.etiqueta-select__trigger {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: var(--radius-default);
  border: 1px solid var(--border);
  background-color: var(--input-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-radius 0.2s ease;
}

.etiqueta-select__trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.etiqueta-select__value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: center;
  padding: 2px 0;
  margin-top: auto;
  margin-bottom: auto;
}

.etiqueta-select__placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.etiqueta-select__chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding-right: 2px;
}

.etiqueta-select__chip .etiqueta-chip__name {
  padding: 4px 8px;
  font-size: 0.8125rem;
}

.etiqueta-select__chip-remove {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.etiqueta-select__chip-remove:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.etiqueta-select__chip-remove .icon {
  width: 12px;
  height: 12px;
}

.etiqueta-select__chevron {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  align-self: center;
  margin-top: 0;
  color: var(--text-muted);
}

.etiqueta-select__chevron .icon {
  width: 14px;
  height: 14px;
}

.etiqueta-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.14);
  overflow: hidden;
  transition: border-radius 0.2s ease;
}

.etiqueta-select__menu--above {
  top: auto;
  bottom: calc(100% + 6px);
  box-shadow: 0 -10px 28px rgb(0 0 0 / 0.14);
}

.etiqueta-select__menu[hidden] {
  display: none;
}

.etiqueta-select__search {
  margin: 8px 8px 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  font: inherit;
  font-size: 0.875rem;
  background-color: var(--input-bg);
  color: var(--text);
  transition: border-radius 0.2s ease;
}

.etiqueta-select__search:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.etiqueta-select__clear {
  margin: 0 8px 4px;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
}

.etiqueta-select__clear:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.etiqueta-select__clear[hidden] {
  display: none;
}

.etiqueta-select__list {
  overflow-y: auto;
  padding: 0 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.etiqueta-select__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 2px 10px;
  border-radius: var(--radius-default);
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: transparent;
  transition: border-radius 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.etiqueta-select__option:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.etiqueta-select__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid color-mix(in srgb, var(--text) 35%, var(--border));
  background: var(--input-bg);
  position: relative;
}

html[data-theme-mode="dark"] .etiqueta-select__check {
  border-color: color-mix(in srgb, var(--text) 55%, transparent);
  background: var(--input-bg);
}

.etiqueta-select__option.is-active .etiqueta-select__check {
  border-color: var(--accent);
  background: var(--accent);
}

.etiqueta-select__option.is-active .etiqueta-select__check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-text, #fff);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.etiqueta-select__option .etiqueta-chip {
  flex: 1;
  max-width: calc(100% - 24px);
  pointer-events: none;
  background: transparent;
}

html[data-theme-mode="dark"] .etiqueta-select__option:hover {
  color: var(--text);
  background: var(--menu-hover-bg);
}

html[data-template="rounded"] .etiqueta-select__trigger {
  border-radius: 10px;
}

html[data-template="rounded"] .etiqueta-select__menu {
  border-radius: 12px;
}

html[data-template="rounded"] .etiqueta-select__search,
html[data-template="rounded"] .etiqueta-select__option {
  border-radius: 8px;
}

.etiqueta-select--single .etiqueta-select__trigger {
  align-items: center;
  min-height: 0;
  padding: 10px 10px 10px 12px;
}

.etiqueta-select--single .etiqueta-select__value {
  padding: 0;
}

.etiqueta-select__text {
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.etiqueta-select__option--text {
  padding: 8px 10px;
}

.etiqueta-select__option[hidden] {
  display: none;
}

/* === components/NewTicketModal.css === */
/* NewTicketModal */
.new-ticket-modal {
  z-index: 1400;
}

.new-ticket-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 18 24 / 0.42);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.new-ticket-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-default);
  padding: 24px 22px 20px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.22);
  animation: new-ticket-in 0.2s ease;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .new-ticket-modal__dialog {
  border-radius: 18px;
}

@keyframes new-ticket-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.new-ticket-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.new-ticket-modal__close:hover {
  background: rgb(0 0 0 / 0.05);
  color: var(--text);
}

.new-ticket-modal__title {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 36px 18px 0;
  color: var(--text);
}

.new-ticket-modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.new-ticket-modal__contact-wrap {
  position: relative;
}

.new-ticket-modal__contact-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: var(--radius-default);
  border: 1px solid var(--border);
  background-color: var(--input-bg);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .new-ticket-modal__contact-input {
  border-radius: 10px;
}

.new-ticket-modal__contact-input:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.new-ticket-modal__contact-input .icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.new-ticket-modal__contact-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  padding-left: 4px;
}

.new-ticket-modal__contact-input input:disabled {
  color: var(--text);
  opacity: 1;
}

.new-ticket-modal__clear {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.new-ticket-modal__clear:hover {
  background: rgb(0 0 0 / 0.06);
  color: var(--text);
}

.new-ticket-modal__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgb(0 0 0 / 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.14);
  padding: 6px;
}

.new-ticket-modal__menu-empty {
  margin: 0;
  padding: 12px 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.new-ticket-modal__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  background: transparent;
}

.new-ticket-modal__option:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.new-ticket-modal__option-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
  flex-shrink: 0;
}

.new-ticket-modal__option .letter-avatar {
  width: 32px;
  height: 32px;
}

.new-ticket-modal__option .letter-avatar__circle {
  font-size: 0.75rem;
}

.new-ticket-modal__option-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.new-ticket-modal__option-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-ticket-modal__option-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.new-ticket-modal__select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-default);
  border: 1px solid var(--border);
  background-color: var(--input-bg);
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .new-ticket-modal__select {
  border-radius: 10px;
}

.new-ticket-modal__select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.new-ticket-modal__error {
  margin: 0;
  font-size: 0.8125rem;
  color: #dc2626;
}

.new-ticket-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.new-ticket-modal .etiqueta-select__trigger {
  align-items: center;
}

.new-ticket-modal .etiqueta-select__chip-remove {
  width: 18px;
  height: 18px;
  margin-right: 4px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.new-ticket-modal .etiqueta-select__chip-remove:hover {
  background: rgb(0 0 0 / 0.08);
  color: var(--text);
}

.new-ticket-modal .etiqueta-select__chip-remove .icon {
  width: 12px;
  height: 12px;
}

input.etiqueta-select__search {
  width: auto;
}

/* === components/Interno.css === */
/* Chat interno — modal + composer só texto */

.chat-composer--text-only {
  padding-left: 14px;
}

.chat-composer--text-only .composer-field {
  margin-left: 0;
}

.interno-modal {
  z-index: 80;
}

.interno-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.35);
}

.interno-modal__dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: min(640px, calc(100vh - 40px));
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-float);
  padding: 22px 22px 18px;
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .interno-modal__dialog {
  border-radius: 16px;
}

.interno-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border-radius: var(--radius-full);
}

.interno-modal__close:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.interno-modal__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 14px;
  padding-right: 36px;
}

.interno-modal__tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.interno-modal__tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-default);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .interno-modal__tab {
  border-radius: 999px;
}

.interno-modal__tab.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.interno-modal__search {
  width: 100%;
  margin-bottom: 10px;
}

.interno-modal__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
  margin-bottom: 12px;
}

.interno-modal__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-default);
  transition: background 0.12s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .interno-modal__option {
  border-radius: 10px;
}

.interno-modal__option:hover,
.interno-modal__option.is-selected {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.interno-modal__avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.interno-modal__option-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interno-modal__check {
  color: var(--accent);
  display: grid;
  place-items: center;
}

.interno-modal__empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 8px 2px;
}

.interno-modal__error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 10px;
}

.interno-modal__avatar.avatar--letter {
  width: 32px;
  height: 32px;
  font-size: 10px;
  flex-shrink: 0;
}

#interno-composer.is-sending .composer-send-spinner {
  opacity: 1;
}

#interno-composer.is-sending .composer-send:not(.composer-send--audio) {
  opacity: 0;
  pointer-events: none;
}

/* Painel de membros do grupo (slide + fade, estilo WhatsApp) */
.chat-window.has-contact-panel .interno-group-shell {
  border-radius: 0 var(--radius) 0 0;
}

.interno-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  flex-shrink: 0;
}

.interno-group__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.interno-group__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.interno-group__close:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-fg);
}

.interno-group__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.interno-group__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  text-align: center;
}

.interno-group__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.interno-group__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  word-break: break-word;
}

.interno-group__count {
  color: #8d99a8;
  font-size: 11px;
}

.interno-group__owner-note {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 8px;
}

.interno-group__transfer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.interno-group__transfer:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.interno-group__transfer:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.interno-group__transfer .icon {
  width: 14px;
  height: 14px;
}

.interno-group__add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-weight: 600;
  transition: background 0.15s ease, border-radius 0.2s ease;
}

.interno-group__add-btn:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.interno-group__add-icon {
  display: grid;
  place-items: center;
}

.interno-group__add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  transition: border-radius 0.2s ease;
}

html[data-template="rounded"] .interno-group__add {
  border-radius: 12px;
}

.interno-group__search {
  width: 100%;
}

.interno-group__add-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow: auto;
}

.interno-group__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: var(--radius-default);
  transition: background 0.12s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .interno-group__option {
  border-radius: 10px;
}

.interno-group__option:hover,
.interno-group__option.is-selected {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.interno-group__confirm {
  padding: 10px 12px;
  border-radius: var(--radius-default);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  transition: background 0.15s ease, border-radius 0.2s ease;
}

html[data-template="rounded"] .interno-group__confirm {
  border-radius: 10px;
}

.interno-group__confirm:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--accent-hover-text);
}

.interno-group__confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.interno-group__error {
  color: var(--danger);
  font-size: 0.875rem;
  margin: 0;
}

.interno-group__section-title {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.interno-group__member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-radius: var(--radius-default);
}

.interno-group__member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.interno-group__member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.interno-group__remove {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
}

.interno-group__remove:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.interno-group__empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 8px 2px;
  margin: 0;
}

.interno-group__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  background: color-mix(in srgb, var(--danger) 6%, #fff);
  color: var(--danger);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 10px;
}

html[data-template="rounded"] .interno-group__delete {
  border-radius: 999px;
}

.interno-group__delete:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 12%, #fff);
}

.interno-group__delete:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.interno-group__delete .icon {
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .chat-window.is-contact-open .chat-window__column {
    display: none;
  }

  .interno-group-shell.is-open {
    width: 100%;
  }
}

/* === components/Scrollbar.css === */
.bh-modal__dialog,
.bh-days,
.page-modal__dialog--wide,
.interno-modal__dialog,
.interno-modal__list,
.contact-media-modal__body,
.spy-modal__messages,
.note-modal__editor,
.document-preview__text,
.etiqueta-select__list,
.phone-ddi__list,
.new-ticket-modal__menu,
.chat-list-filter__multi-menu,
.contatos-filter-menu,
.stalled-alerts__menu,
.composer-slash,
.composer-emoji-picker,
.composer-contact-picker__list,
.interno-group__add-list,
.chat-list__items,
.resolved-tickets__list,
.chat-window__messages,
.composer-field,
.contact-panel__body,
.contact-panel__thumbs--scroll,
.interno-group__body,
.page-panel__body,
.perfil-page,
.dept-table,
.conexoes-table,
.quick-reply-table,
.agenda-page {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent;
}

.bh-modal__dialog::-webkit-scrollbar,
.bh-days::-webkit-scrollbar,
.page-modal__dialog--wide::-webkit-scrollbar,
.interno-modal__dialog::-webkit-scrollbar,
.interno-modal__list::-webkit-scrollbar,
.contact-media-modal__body::-webkit-scrollbar,
.spy-modal__messages::-webkit-scrollbar,
.note-modal__editor::-webkit-scrollbar,
.document-preview__text::-webkit-scrollbar,
.etiqueta-select__list::-webkit-scrollbar,
.phone-ddi__list::-webkit-scrollbar,
.new-ticket-modal__menu::-webkit-scrollbar,
.chat-list-filter__multi-menu::-webkit-scrollbar,
.contatos-filter-menu::-webkit-scrollbar,
.stalled-alerts__menu::-webkit-scrollbar,
.composer-slash::-webkit-scrollbar,
.composer-emoji-picker::-webkit-scrollbar,
.composer-contact-picker__list::-webkit-scrollbar,
.interno-group__add-list::-webkit-scrollbar,
.chat-list__items::-webkit-scrollbar,
.resolved-tickets__list::-webkit-scrollbar,
.chat-window__messages::-webkit-scrollbar,
.composer-field::-webkit-scrollbar,
.contact-panel__body::-webkit-scrollbar,
.contact-panel__thumbs--scroll::-webkit-scrollbar,
.interno-group__body::-webkit-scrollbar,
.page-panel__body::-webkit-scrollbar,
.perfil-page::-webkit-scrollbar,
.dept-table::-webkit-scrollbar,
.conexoes-table::-webkit-scrollbar,
.quick-reply-table::-webkit-scrollbar,
.agenda-page::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.bh-modal__dialog::-webkit-scrollbar-track,
.bh-days::-webkit-scrollbar-track,
.page-modal__dialog--wide::-webkit-scrollbar-track,
.interno-modal__dialog::-webkit-scrollbar-track,
.interno-modal__list::-webkit-scrollbar-track,
.contact-media-modal__body::-webkit-scrollbar-track,
.spy-modal__messages::-webkit-scrollbar-track,
.note-modal__editor::-webkit-scrollbar-track,
.document-preview__text::-webkit-scrollbar-track,
.etiqueta-select__list::-webkit-scrollbar-track,
.phone-ddi__list::-webkit-scrollbar-track,
.new-ticket-modal__menu::-webkit-scrollbar-track,
.chat-list-filter__multi-menu::-webkit-scrollbar-track,
.contatos-filter-menu::-webkit-scrollbar-track,
.stalled-alerts__menu::-webkit-scrollbar-track,
.composer-slash::-webkit-scrollbar-track,
.composer-emoji-picker::-webkit-scrollbar-track,
.composer-contact-picker__list::-webkit-scrollbar-track,
.interno-group__add-list::-webkit-scrollbar-track,
.chat-list__items::-webkit-scrollbar-track,
.resolved-tickets__list::-webkit-scrollbar-track,
.chat-window__messages::-webkit-scrollbar-track,
.composer-field::-webkit-scrollbar-track,
.contact-panel__body::-webkit-scrollbar-track,
.contact-panel__thumbs--scroll::-webkit-scrollbar-track,
.interno-group__body::-webkit-scrollbar-track,
.page-panel__body::-webkit-scrollbar-track,
.perfil-page::-webkit-scrollbar-track,
.dept-table::-webkit-scrollbar-track,
.conexoes-table::-webkit-scrollbar-track,
.quick-reply-table::-webkit-scrollbar-track,
.agenda-page::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.bh-modal__dialog::-webkit-scrollbar-thumb,
.bh-days::-webkit-scrollbar-thumb,
.page-modal__dialog--wide::-webkit-scrollbar-thumb,
.interno-modal__dialog::-webkit-scrollbar-thumb,
.interno-modal__list::-webkit-scrollbar-thumb,
.contact-media-modal__body::-webkit-scrollbar-thumb,
.spy-modal__messages::-webkit-scrollbar-thumb,
.note-modal__editor::-webkit-scrollbar-thumb,
.document-preview__text::-webkit-scrollbar-thumb,
.etiqueta-select__list::-webkit-scrollbar-thumb,
.phone-ddi__list::-webkit-scrollbar-thumb,
.new-ticket-modal__menu::-webkit-scrollbar-thumb,
.chat-list-filter__multi-menu::-webkit-scrollbar-thumb,
.contatos-filter-menu::-webkit-scrollbar-thumb,
.stalled-alerts__menu::-webkit-scrollbar-thumb,
.composer-slash::-webkit-scrollbar-thumb,
.composer-emoji-picker::-webkit-scrollbar-thumb,
.composer-contact-picker__list::-webkit-scrollbar-thumb,
.interno-group__add-list::-webkit-scrollbar-thumb,
.chat-list__items::-webkit-scrollbar-thumb,
.resolved-tickets__list::-webkit-scrollbar-thumb,
.chat-window__messages::-webkit-scrollbar-thumb,
.composer-field::-webkit-scrollbar-thumb,
.contact-panel__body::-webkit-scrollbar-thumb,
.contact-panel__thumbs--scroll::-webkit-scrollbar-thumb,
.interno-group__body::-webkit-scrollbar-thumb,
.page-panel__body::-webkit-scrollbar-thumb,
.perfil-page::-webkit-scrollbar-thumb,
.dept-table::-webkit-scrollbar-thumb,
.conexoes-table::-webkit-scrollbar-thumb,
.quick-reply-table::-webkit-scrollbar-thumb,
.agenda-page::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 999px;
}

.bh-modal__dialog::-webkit-scrollbar-thumb:hover,
.bh-days::-webkit-scrollbar-thumb:hover,
.page-modal__dialog--wide::-webkit-scrollbar-thumb:hover,
.interno-modal__dialog::-webkit-scrollbar-thumb:hover,
.interno-modal__list::-webkit-scrollbar-thumb:hover,
.contact-media-modal__body::-webkit-scrollbar-thumb:hover,
.spy-modal__messages::-webkit-scrollbar-thumb:hover,
.note-modal__editor::-webkit-scrollbar-thumb:hover,
.document-preview__text::-webkit-scrollbar-thumb:hover,
.etiqueta-select__list::-webkit-scrollbar-thumb:hover,
.phone-ddi__list::-webkit-scrollbar-thumb:hover,
.new-ticket-modal__menu::-webkit-scrollbar-thumb:hover,
.chat-list-filter__multi-menu::-webkit-scrollbar-thumb:hover,
.contatos-filter-menu::-webkit-scrollbar-thumb:hover,
.stalled-alerts__menu::-webkit-scrollbar-thumb:hover,
.composer-slash::-webkit-scrollbar-thumb:hover,
.composer-emoji-picker::-webkit-scrollbar-thumb:hover,
.composer-contact-picker__list::-webkit-scrollbar-thumb:hover,
.interno-group__add-list::-webkit-scrollbar-thumb:hover,
.chat-list__items::-webkit-scrollbar-thumb:hover,
.resolved-tickets__list::-webkit-scrollbar-thumb:hover,
.chat-window__messages::-webkit-scrollbar-thumb:hover,
.composer-field::-webkit-scrollbar-thumb:hover,
.contact-panel__body::-webkit-scrollbar-thumb:hover,
.contact-panel__thumbs--scroll::-webkit-scrollbar-thumb:hover,
.interno-group__body::-webkit-scrollbar-thumb:hover,
.page-panel__body::-webkit-scrollbar-thumb:hover,
.perfil-page::-webkit-scrollbar-thumb:hover,
.dept-table::-webkit-scrollbar-thumb:hover,
.conexoes-table::-webkit-scrollbar-thumb:hover,
.quick-reply-table::-webkit-scrollbar-thumb:hover,
.agenda-page::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text) 38%, transparent);
}

/* === components/Pwa.css === */
.pwa-install {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-default);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgb(15 26 42 / 0.18);
  transform: translateX(-50%);
  animation: pwa-install-in 0.22s ease both;
}

.pwa-install__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.pwa-install__body {
  flex: 1;
  min-width: 0;
}

.pwa-install__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.pwa-install__text {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.pwa-install__text strong {
  color: var(--text);
  font-weight: 600;
}

.pwa-install__glyph {
  display: inline-flex;
  vertical-align: -3px;
  color: var(--accent);
}

.pwa-install__glyph .icon {
  width: 15px;
  height: 15px;
}

.pwa-install__action {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.pwa-install__action:hover,
.pwa-install__action:focus-visible {
  background: var(--accent-hover, var(--accent));
  color: var(--accent-hover-text, var(--accent-text));
}

.pwa-install__close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  align-self: flex-start;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.pwa-install__close:hover,
.pwa-install__close:focus-visible {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  outline: none;
}

.pwa-install--ios::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transform: translateX(-50%) rotate(45deg);
}

html[data-theme-mode="dark"] .pwa-install {
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
}

@media (min-width: 801px) {
  .pwa-install--ios::after {
    display: none;
  }
}

@keyframes pwa-install-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install {
    animation: none;
  }
}
