:root {
  --green: #ff5a36;
  --green-dark: #e5451f;
  --green-deep: #7a2410;
  --green-soft: #ffd8c2;
  --chat-bg: #fff1e6;
  --sidebar: #2a1410;
  --sidebar-2: #3a1d16;
  --sidebar-3: #4a251b;
  --sidebar-muted: #c98f79;
  --sidebar-text: #fff3ea;
  --panel: #fff6ef;
  --text: #2a1410;
  --text-soft: #6b3a2a;
  --muted: #8a5645;
  --line: #f3d8c9;
  --danger: #d61f2c;
  --white: #fffaf6;
  --shadow-lg: 0 24px 70px rgba(42, 20, 16, 0.18);
  --shadow-sm: 0 1px 1px rgba(42, 20, 16, 0.12);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #fff2e7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(255, 90, 54, 0.45);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--sidebar-muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  color: var(--green);
}

.brand-light {
  color: #fff6ee;
}

.brand-dark {
  color: var(--text);
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fffaf6;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  user-select: none;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}

.avatar-md {
  width: 44px;
  height: 44px;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 1.08rem;
}

.av-0 { background: linear-gradient(135deg, #ff7a45, #b52a0b); }
.av-1 { background: linear-gradient(135deg, #ff4d6d, #ad1457); }
.av-2 { background: linear-gradient(135deg, #ff8a65, #d84315); }
.av-3 { background: linear-gradient(135deg, #ff4d8d, #a4084f); }
.av-4 { background: linear-gradient(135deg, #ffb347, #e65100); }
.av-5 { background: linear-gradient(135deg, #f2b544, #b26a00); }
.av-6 { background: linear-gradient(135deg, #f06292, #ad1457); }
.av-7 { background: linear-gradient(135deg, #ff6f61, #b71c1c); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green);
  color: #5a1b06;
  box-shadow: 0 8px 20px rgba(255, 90, 54, 0.26);
}

.btn-primary:hover {
  background: var(--green-dark);
  color: #fffaf6;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-ghost {
  background: var(--white);
  border-color: #f0cdb9;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green-deep);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  transition: background 0.16s ease;
}

.icon-btn:hover {
  background: rgba(42, 20, 16, 0.07);
}

.icon-btn-dark {
  color: #e3a993;
}

.icon-btn-dark:hover {
  background: rgba(255, 250, 246, 0.08);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sidebar-muted);
  flex: none;
}

.dot-online {
  background: #ffb703;
  box-shadow: 0 0 0 3px rgba(255, 183, 3, 0.14);
}

/* ---------- Entrada ---------- */

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
  background: #fff2e7;
}

.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 5.6vw, 76px);
  color: #fff6ee;
  background-color: #1f0d08;
  background-image:
    radial-gradient(rgba(255, 90, 54, 0.22) 1px, transparent 1.4px),
    radial-gradient(rgba(134, 150, 160, 0.12) 1px, transparent 1.4px);
  background-size: 30px 30px, 54px 54px;
  background-position: 0 0, 15px 15px;
  isolation: isolate;
}

.auth-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 560px;
  height: 560px;
  right: -200px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 54, 0.4), transparent 68%);
  filter: blur(10px);
}

.auth-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 480px;
  height: 480px;
  left: -220px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 36, 16, 0.6), transparent 70%);
}

.auth-copy {
  margin: clamp(42px, 8vh, 96px) 0 30px;
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffc2a1;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.4vw, 3.65rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  max-width: 13ch;
}

.auth-lead {
  margin: 22px 0 0;
  max-width: 47ch;
  font-size: clamp(0.98rem, 1.25vw, 1.1rem);
  line-height: 1.65;
  color: rgba(255, 243, 234, 0.72);
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-size: 0.94rem;
  color: rgba(255, 243, 234, 0.88);
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 11px;
}

.point-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 90, 54, 0.18);
  color: #ffc2a1;
  font-size: 0.74rem;
  font-weight: 800;
  flex: none;
}

.auth-preview {
  width: min(370px, 100%);
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(42, 20, 16, 0.86);
  border: 1px solid rgba(255, 243, 234, 0.09);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 243, 234, 0.08);
}

.preview-top div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-top strong {
  font-size: 0.9rem;
}

.preview-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #ffc2a1;
}

.preview-online .dot {
  width: 6px;
  height: 6px;
}

.preview-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 0;
}

.preview-bubble {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.14);
}

.preview-in {
  align-self: flex-start;
  background: #fffaf6;
  color: var(--text);
  border-top-left-radius: 3px;
}

.preview-out {
  align-self: flex-end;
  background: var(--green-soft);
  color: var(--text);
  border-top-right-radius: 3px;
}

.preview-ticks {
  margin-left: 8px;
  font-size: 0.68rem;
  color: #ff8a5b;
}

.preview-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 250, 246, 0.07);
  color: var(--sidebar-muted);
  font-size: 0.8rem;
}

.preview-send {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #5a1b06;
  font-size: 0.8rem;
}

.auth-legal {
  margin: 22px 0 0;
  font-size: 0.75rem;
  color: rgba(255, 243, 234, 0.45);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 90, 54, 0.09), transparent 42%),
    #fff2e7;
}

.auth-card {
  width: min(430px, 100%);
  padding: clamp(24px, 3.4vw, 36px);
  border-radius: 22px;
  background: #fffaf6;
  box-shadow: var(--shadow-lg);
}

.auth-card-head {
  margin-bottom: 24px;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #ffe9db;
  margin-bottom: 22px;
}

.tab {
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: #fffaf6;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(42, 20, 16, 0.12);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
}

.field input {
  width: 100%;
  border: 1px solid #f0cdb9;
  border-radius: 12px;
  background: #fff8f2;
  padding: 13px 14px;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input::placeholder {
  color: #b07a66;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  background: #fffaf6;
  box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.12);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  color: var(--muted);
}

.hint {
  margin: 7px 0 0;
  font-size: 0.77rem;
  color: var(--muted);
}

.form-error {
  min-height: 20px;
  margin: 2px 0 10px;
  color: var(--danger);
  font-size: 0.84rem;
  line-height: 1.4;
}

.auth-foot {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Aplicação ---------- */

.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 382px) minmax(0, 1fr);
  overflow: hidden;
  background: var(--chat-bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: var(--sidebar-text);
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 250, 246, 0.06);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--sidebar);
}

.me {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.me-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.me-copy strong {
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me-copy .muted {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 12px 10px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--sidebar-2);
  color: var(--sidebar-muted);
}

.search-icon {
  flex: none;
  opacity: 0.9;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.87rem;
}

.search-wrap input:focus {
  outline: none;
}

.search-wrap input::placeholder {
  color: #c98f79;
}

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 18px;
  scrollbar-width: thin;
  scrollbar-color: #5a2a1d transparent;
}

.list-scroll::-webkit-scrollbar {
  width: 6px;
}

.list-scroll::-webkit-scrollbar-thumb {
  background: #5a2a1d;
  border-radius: 99px;
}

.list-section {
  margin-bottom: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 6px;
}

.section-title h2 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--sidebar-2);
  color: #e3a993;
  font-size: 0.68rem;
  font-weight: 700;
}

.count-online {
  background: rgba(255, 183, 3, 0.12);
  color: #ffd166;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  transition: background 0.14s ease;
}

.item:hover {
  background: var(--sidebar-2);
}

.item.is-active {
  background: var(--sidebar-3);
}

.item-avatar {
  position: relative;
  flex: none;
}

.item-avatar .dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--sidebar);
  box-shadow: none;
}

.item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.item-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.item-name {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-time {
  flex: none;
  font-size: 0.68rem;
  color: var(--sidebar-muted);
}

.item-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.item-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-preview.is-empty {
  font-style: italic;
  opacity: 0.8;
}

.item-status {
  font-size: 0.76rem;
  color: var(--sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-status.is-online {
  color: #ffd166;
}

.item-action {
  flex: none;
  font-size: 0.67rem;
  font-weight: 700;
  color: #ffc2a1;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 90, 54, 0.12);
}

.unread {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--green);
  color: #5a1b06;
  font-size: 0.68rem;
  font-weight: 800;
  flex: none;
}

.empty-list {
  margin: 4px 10px 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 250, 246, 0.035);
  color: var(--sidebar-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 250, 246, 0.06);
  font-size: 0.72rem;
  color: var(--sidebar-muted);
}

.sidebar-footer-brand {
  margin-left: auto;
  opacity: 0.7;
}

.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background-color: var(--chat-bg);
  background-image:
    radial-gradient(rgba(42, 20, 16, 0.045) 1px, transparent 1.3px),
    radial-gradient(rgba(42, 20, 16, 0.028) 1px, transparent 1.3px);
  background-size: 26px 26px, 52px 52px;
  background-position: 0 0, 13px 13px;
}

.chat-empty {
  margin: auto;
  max-width: 480px;
  padding: 30px;
  text-align: center;
  color: var(--text-soft);
}

.chat-empty-art {
  display: inline-grid;
  place-items: center;
  margin-bottom: 18px;
}

.chat-empty h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  letter-spacing: -0.03em;
  color: var(--text);
}

.chat-empty p {
  margin: 0 auto 20px;
  max-width: 42ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.chat-empty-hint {
  list-style: none;
  margin: 24px 0 0;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 250, 246, 0.62);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  font-size: 0.76rem;
  color: var(--muted);
}

.chat-empty-hint li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.privacy-mini {
  font-size: 0.8rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 64px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid rgba(42, 20, 16, 0.08);
  z-index: 2;
}

.back {
  display: none;
  color: var(--text-soft);
}

.chat-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-title strong {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status.is-online {
  color: var(--green-dark);
}

.chat-status.is-typing {
  color: var(--green-dark);
  font-weight: 600;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 99px;
  background: #f3d8c9;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px clamp(12px, 4.6vw, 64px) 10px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 20, 16, 0.18) transparent;
}

.messages::-webkit-scrollbar {
  width: 7px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(42, 20, 16, 0.18);
  border-radius: 99px;
}

.messages-empty {
  margin: auto;
  max-width: 340px;
  padding: 18px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #8a5645;
  background: rgba(255, 250, 246, 0.66);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.date-divider {
  align-self: center;
  margin: 14px 0 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 250, 246, 0.82);
  box-shadow: var(--shadow-sm);
  color: #7a4634;
  font-size: 0.72rem;
  font-weight: 600;
}

.message-row {
  display: flex;
  justify-content: flex-start;
  margin: 1px 0;
}

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

.message-row.after-gap {
  margin-top: 8px;
}

.bubble {
  position: relative;
  max-width: min(78%, 560px);
  padding: 7px 10px 6px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}

.message-row.in .bubble {
  border-top-left-radius: 3px;
}

.message-row.out .bubble {
  border-top-right-radius: 3px;
  background: var(--green-soft);
}

.bubble-text {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.bubble.is-pending {
  opacity: 0.72;
}

.bubble.is-failed {
  background: #ffd9cf;
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 2px;
  font-size: 0.65rem;
  line-height: 1;
  color: #8a5645;
  user-select: none;
}

.ticks {
  font-size: 0.78rem;
  letter-spacing: -0.12em;
  color: #8a5645;
}

.ticks.is-read {
  color: #ff8a5b;
}

.ticks.is-failed {
  color: var(--danger);
  font-size: 0.66rem;
}

.typing {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0 clamp(18px, 4.6vw, 70px) 4px;
  color: #7a4634;
  font-size: 0.76rem;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b07a66;
  animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px clamp(12px, 3.4vw, 48px) max(14px, env(safe-area-inset-bottom));
  background: var(--panel);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  max-height: 132px;
  resize: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 15px;
  background: #fffaf6;
  color: var(--text);
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.composer textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.22);
}

.composer textarea::placeholder {
  color: #a9755f;
}

.send-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fffaf6;
  box-shadow: 0 6px 16px rgba(255, 90, 54, 0.28);
  transition: background 0.16s ease, transform 0.12s ease, opacity 0.16s ease;
}

.send-btn:hover {
  background: var(--green-dark);
}

.send-btn:active {
  transform: scale(0.97);
}

.send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: 10px;
  background: #2a1410;
  color: #fff6ee;
  font-size: 0.86rem;
  line-height: 1.4;
  box-shadow: 0 14px 40px rgba(42, 20, 16, 0.34);
  transform: translateX(-50%);
}

.toast.is-error {
  background: #a3131c;
}

/* ---------- Responsivo ---------- */

@media (max-width: 960px) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth-art {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 28px 16px 40px;
  }

  .auth-card {
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
  }

  .chat {
    display: none;
  }

  .app.chat-open .sidebar {
    display: none;
  }

  .app.chat-open .chat {
    display: flex;
  }

  .back {
    display: inline-grid;
  }

  .chat-header {
    height: 60px;
    padding: 8px 10px;
    gap: 8px;
  }

  .privacy-badge {
    display: none;
  }

  .messages {
    padding: 16px 10px 8px;
  }

  .bubble {
    max-width: 86%;
  }

  .composer {
    padding: 8px 10px max(10px, env(safe-area-inset-bottom));
  }

  .typing {
    padding: 0 16px 2px;
  }

  .chat-empty {
    padding: 22px 18px;
  }

  .chat-empty-hint {
    display: none;
  }
}

@media (max-width: 420px) {
  .auth-card {
    padding: 22px 18px;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(42, 20, 16, 0.12);
  }

  .chat-empty-art svg {
    width: 120px;
    height: auto;
  }

  .chat-empty h2 {
    font-size: 1.3rem;
  }

  .chat-empty p {
    font-size: 0.86rem;
  }

  .sidebar-footer-brand {
    display: none;
  }
}

@media (max-height: 740px) and (min-width: 961px) {
  .auth-preview {
    display: none;
  }

  .auth-copy {
    margin-top: 42px;
  }

  .auth-copy h1 {
    font-size: clamp(2rem, 3.4vw, 2.8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background:
    radial-gradient(circle at 6% -4%, #ffd9bf 0, transparent 36%),
    radial-gradient(circle at 96% 104%, #ffc9b0 0, transparent 42%),
    #fff2e7;
  background-attachment: fixed;
}

::selection {
  background: #ffb703;
  color: #3d1300;
}

.sidebar {
  background: linear-gradient(180deg, #3a1712 0%, #2a1410 52%, #1f0d08 100%);
}

.item.is-active {
  background: linear-gradient(135deg, #4a251b, #6b2c1c);
  box-shadow: inset 3px 0 0 #ffb703;
}

.btn-primary {
  background: linear-gradient(135deg, #ff7a3d, #e63946);
  color: #fffaf6;
  box-shadow: 0 10px 24px rgba(230, 57, 70, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff8a4d, #c81f2e);
  color: #fffaf6;
}

.auth-panel {
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 138, 61, 0.24), transparent 44%),
    radial-gradient(circle at 8% 96%, rgba(230, 57, 70, 0.14), transparent 42%),
    #fff2e7;
}

.auth-card {
  border: 1px solid #ffe0cc;
}

.auth-art::before {
  background: radial-gradient(circle, rgba(255, 138, 61, 0.46), transparent 68%);
}

.auth-art::after {
  background: radial-gradient(circle, rgba(230, 57, 70, 0.48), transparent 70%);
}

.chat {
  background-color: var(--chat-bg);
  background-image:
    radial-gradient(rgba(255, 138, 61, 0.14) 1px, transparent 1.4px),
    radial-gradient(rgba(230, 57, 70, 0.09) 1px, transparent 1.4px);
}

.message-row.out .bubble {
  background: linear-gradient(135deg, #ffdcc8, #ffc6a8);
  border: 1px solid #ffb894;
}

.send-btn {
  background: linear-gradient(135deg, #ff7a3d, #e63946);
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.34);
}

.send-btn:hover {
  background: linear-gradient(135deg, #ff8a4d, #c81f2e);
}

.dot-online {
  box-shadow: 0 0 0 3px rgba(255, 183, 3, 0.2);
}

.toast {
  background: linear-gradient(135deg, #4a251b, #2a1410);
  color: #fff3ea;
}

.toast.is-error {
  background: linear-gradient(135deg, #d61f2c, #8e0f18);
}

#me-avatar {
  cursor: pointer;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.avatar.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.record-btn {
  color: var(--green);
  background: #fffaf6;
  box-shadow: var(--shadow-sm);
}

.record-btn:hover {
  background: #ffe9db;
  color: var(--green-dark);
}

.recording {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px clamp(12px, 3.4vw, 48px);
  background: linear-gradient(135deg, #fff0e3, #ffe0cc);
  border-top: 1px solid #ffd3b8;
  color: var(--text);
  font-size: 0.88rem;
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e63946;
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.18);
  animation: pulse-record 1.2s ease-in-out infinite;
}

#recording-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--green-deep);
}

.recording-label {
  flex: 1;
  color: var(--muted);
}

.recording .btn {
  padding: 8px 14px;
}

@keyframes pulse-record {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.8); opacity: 0.6; }
}

.bubble-audio audio {
  display: block;
  width: min(270px, 64vw);
  height: 38px;
}

.bubble-audio {
  padding-top: 9px;
}

.profile-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid #ffd9bf;
  border-radius: 22px;
  padding: 0;
  background: #fffaf6;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(90, 20, 0, 0.3);
}

.profile-dialog::backdrop {
  background: rgba(42, 20, 16, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.profile-block {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 22px;
  border-top: 1px solid #ffe4d4;
}

.profile-copy {
  flex: 1;
  min-width: 0;
}

.profile-copy strong {
  display: block;
  font-size: 0.94rem;
}

.profile-copy p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-actions .btn {
  padding: 8px 14px;
  font-size: 0.84rem;
}

.background-swatch {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid #ffd9bf;
  background:
    linear-gradient(135deg, rgba(255, 122, 61, 0.35), rgba(230, 57, 70, 0.3)),
    repeating-linear-gradient(45deg, #fff2e7 0 6px, #ffe4d2 6px 12px);
  background-size: cover;
  background-position: center;
}

#profile-status {
  margin: 0;
  padding: 0 22px 20px;
  min-height: 18px;
}

.profile-dialog {
  max-height: min(90vh, 640px);
  overflow-y: auto;
}

@media (max-width: 520px) {
  .recording {
    padding: 8px 12px;
    gap: 8px;
  }

  .recording-label {
    display: none;
  }

  .recording .btn {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .profile-actions .btn {
    flex: 1;
  }
}

/* ---------- Tema visual inspirado no WhatsApp (claro) ---------- */
:root {
  --green: #00a884;
  --green-dark: #008069;
  --green-deep: #005c4b;
  --green-soft: #d9fdd3;
  --chat-bg: #efeae2;
  --sidebar: #ffffff;
  --sidebar-2: #f0f2f5;
  --sidebar-3: #e9edef;
  --sidebar-muted: #667781;
  --sidebar-text: #111b21;
  --panel: #f0f2f5;
  --text: #111b21;
  --text-soft: #3b4a54;
  --muted: #667781;
  --line: #e9edef;
  --danger: #ea0038;
  --white: #ffffff;
  --shadow-lg: 0 12px 40px rgba(11, 20, 26, 0.12);
  --shadow-sm: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  --radius: 8px;
}

body {
  background: #d1d7db;
  color: var(--text);
}

::selection {
  background: rgba(0, 168, 132, 0.24);
  color: #111b21;
}

.app {
  background: var(--chat-bg);
  grid-template-columns: minmax(300px, 30%) minmax(0, 1fr);
}

.sidebar {
  background: #ffffff;
  color: var(--sidebar-text);
  border-right: 1px solid #d1d7db;
}

.sidebar-header {
  background: #f0f2f5;
  padding: 10px 16px;
}

.me-copy strong {
  font-weight: 600;
}

.me-copy .muted {
  color: #667781;
}

.icon-btn-dark {
  color: #54656f;
}

.icon-btn-dark:hover {
  background: rgba(11, 20, 26, 0.06);
}

.sidebar-header-actions {
  gap: 2px;
}

.search-wrap {
  background: #f0f2f5;
  color: #54656f;
  margin: 7px 12px 8px;
  padding: 0 12px;
  border-radius: 8px;
}

.search-wrap input {
  color: #111b21;
  padding: 9px 0;
}

.search-wrap input::placeholder {
  color: #667781;
}

.list-scroll {
  padding: 0;
  scrollbar-color: #ced0d1 transparent;
}

.list-scroll::-webkit-scrollbar-thumb {
  background: #ced0d1;
}

.list-section {
  margin-bottom: 0;
}

.section-title {
  padding: 10px 16px 6px;
}

.section-title h2 {
  color: #667781;
  letter-spacing: 0.06em;
}

.count {
  background: #e9edef;
  color: #54656f;
}

.count-online {
  background: #e7fce3;
  color: #008069;
}

.list {
  gap: 0;
}

.item {
  min-height: 72px;
  padding: 0 12px;
  border-radius: 0;
  border-bottom: 1px solid #f0f2f5;
  color: #111b21;
}

.item:hover {
  background: #f5f6f6;
}

.item.is-active {
  background: #f0f2f5;
  box-shadow: none;
}

.item-avatar .dot {
  border-color: #ffffff;
  bottom: 2px;
}

.item-name {
  font-size: 1rem;
  font-weight: 400;
}

.item-time {
  font-size: 0.72rem;
  color: #667781;
}

.item-preview {
  font-size: 0.86rem;
  color: #667781;
}

.item-status {
  color: #667781;
}

.item-status.is-online {
  color: #008069;
}

.item-action {
  background: #e7fce3;
  color: #008069;
}

.unread {
  background: #25d366;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.empty-list {
  background: #f7f8fa;
  color: #667781;
}

.sidebar-footer {
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
  color: #667781;
}

.dot {
  background: #8696a0;
}

.dot-online {
  background: #25d366;
  box-shadow: none;
}

.avatar {
  color: #ffffff;
}

.av-0 { background: linear-gradient(135deg, #25d366, #128c7e); }
.av-1 { background: linear-gradient(135deg, #53bdeb, #007a99); }
.av-2 { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.av-3 { background: linear-gradient(135deg, #f472b6, #be185d); }
.av-4 { background: linear-gradient(135deg, #fb923c, #c2410c); }
.av-5 { background: linear-gradient(135deg, #facc15, #a16207); }
.av-6 { background: linear-gradient(135deg, #34d399, #047857); }
.av-7 { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }

.chat {
  background-color: #efeae2;
  background-image:
    radial-gradient(rgba(11, 20, 26, 0.035) 1px, transparent 1.3px),
    radial-gradient(rgba(11, 20, 26, 0.025) 1px, transparent 1.3px);
  background-size: 24px 24px, 48px 48px;
  background-position: 0 0, 12px 12px;
}

.chat-header {
  height: 59px;
  padding: 6px 16px;
  background: #f0f2f5;
  border-bottom: 1px solid #d1d7db;
  color: #111b21;
}

.back {
  color: #54656f;
}

.chat-title strong {
  font-size: 1rem;
  font-weight: 500;
}

.chat-status {
  color: #667781;
  font-size: 0.78rem;
}

.chat-status.is-online,
.chat-status.is-typing {
  color: #008069;
}

.privacy-badge {
  background: #ffffff;
  color: #54656f;
}

.messages {
  padding: 16px clamp(10px, 5vw, 68px) 8px;
  scrollbar-color: rgba(11, 20, 26, 0.2) transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(11, 20, 26, 0.2);
}

.messages-empty {
  background: rgba(255, 255, 255, 0.86);
  color: #54656f;
  border-radius: 8px;
}

.date-divider {
  background: #ffffff;
  color: #54656f;
  border-radius: 7px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 0.75rem;
}

.bubble {
  max-width: min(65%, 560px);
  padding: 6px 7px 8px;
  border-radius: 7.5px;
  background: #ffffff;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.message-row.in .bubble {
  border-top-left-radius: 0;
}

.message-row.out .bubble {
  border-top-right-radius: 0;
  background: #d9fdd3;
  border: 0;
}

.bubble-text {
  font-size: 0.89rem;
  line-height: 1.34;
  color: #111b21;
}

.bubble.is-failed {
  background: #fde2e0;
}

.bubble-meta {
  color: #667781;
  font-size: 0.68rem;
}

.ticks {
  color: #667781;
}

.ticks.is-read {
  color: #53bdeb;
}

.typing {
  color: #667781;
}

.typing-dots span {
  background: #8696a0;
}

.composer {
  background: #f0f2f5;
  padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  gap: 8px;
}

.composer textarea {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 12px;
  background: #ffffff;
  color: #111b21;
  box-shadow: none;
}

.composer textarea::placeholder {
  color: #667781;
}

.composer textarea:focus {
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}

.record-btn {
  color: #54656f;
  background: transparent;
  box-shadow: none;
}

.record-btn:hover {
  background: #e9edef;
  color: #111b21;
}

.record-btn.is-recording {
  color: #ea0038;
}

.send-btn {
  width: 42px;
  height: 42px;
  background: #00a884;
  color: #ffffff;
  box-shadow: none;
}

.send-btn:hover {
  background: #008069;
}

.recording {
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
  color: #111b21;
}

#recording-time {
  color: #008069;
}

.recording-label {
  color: #667781;
}

.profile-dialog {
  background: #ffffff;
  border: 0;
  border-radius: 12px;
  color: #111b21;
  box-shadow: 0 12px 40px rgba(11, 20, 26, 0.3);
}

.dialog-head h2 {
  font-weight: 500;
}

.profile-block {
  border-top-color: #e9edef;
}

.profile-copy p {
  color: #667781;
}

.background-swatch {
  border-color: #d1d7db;
  border-radius: 8px;
}

.btn-primary {
  background: #00a884;
  color: #ffffff;
  box-shadow: none;
}

.btn-primary:hover {
  background: #008069;
  color: #ffffff;
}

.btn-ghost {
  background: #ffffff;
  border-color: #d1d7db;
  color: #008069;
}

.btn-ghost:hover {
  border-color: #00a884;
  color: #008069;
}

.toast {
  background: #111b21;
  color: #ffffff;
}

.toast.is-error {
  background: #ea0038;
}

.auth {
  background: #f0f2f5;
}

.auth-art {
  background-color: #008069;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.4px),
    radial-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1.4px);
}

.auth-art::before {
  background: radial-gradient(circle, rgba(37, 211, 102, 0.34), transparent 68%);
}

.auth-art::after {
  background: radial-gradient(circle, rgba(0, 92, 75, 0.58), transparent 70%);
}

.eyebrow {
  color: #d9fdd3;
}

.auth-lead {
  color: rgba(255, 255, 255, 0.78);
}

.auth-points {
  color: rgba(255, 255, 255, 0.9);
}

.point-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.auth-preview {
  background: rgba(11, 20, 26, 0.74);
  border-color: rgba(255, 255, 255, 0.12);
}

.preview-online {
  color: #a7f3d0;
}

.preview-ticks {
  color: #53bdeb;
}

.auth-legal {
  color: rgba(255, 255, 255, 0.55);
}

.auth-panel {
  background: #f0f2f5;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #e9edef;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(11, 20, 26, 0.08);
}

.auth-tabs {
  background: #f0f2f5;
  border-radius: 8px;
}

.tab {
  border-radius: 7px;
  color: #54656f;
}

.tab.is-active {
  background: #ffffff;
  color: #008069;
  box-shadow: 0 1px 3px rgba(11, 20, 26, 0.12);
}

.field label {
  color: #3b4a54;
}

.field input {
  background: #ffffff;
  border-color: #d1d7db;
  border-radius: 8px;
  color: #111b21;
}

.field input::placeholder {
  color: #8696a0;
}

.field input:focus {
  border-color: #00a884;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.18);
}

.auth-foot {
  border-top-color: #e9edef;
  color: #667781;
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
  }

  .messages {
    padding: 16px 10px 8px;
  }

  .bubble {
    max-width: 86%;
  }

  .chat-header {
    height: 60px;
    padding: 8px 10px;
  }
}

:focus-visible {
  outline-color: rgba(0, 168, 132, 0.55);
}

.preview-in {
  background: #ffffff;
  color: #111b21;
}

.preview-out {
  color: #111b21;
}

.preview-send {
  color: #ffffff;
}

.preview-composer {
  background: rgba(255, 255, 255, 0.1);
  color: #d1d7db;
}

/* ---------- Mensagens avançadas ---------- */

.pinned-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e9edef;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.08);
}

.pinned-jump {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #111b21;
  text-align: left;
}

.pinned-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e7fce3;
  color: #008069;
  flex: none;
}

.pinned-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.pinned-copy strong {
  font-size: 0.76rem;
  color: #008069;
}

.pinned-copy #pinned-text {
  font-size: 0.8rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-banner .icon-btn {
  width: 30px;
  height: 30px;
  color: #667781;
}

.composer-context {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #f0f2f5;
  border-left: 4px solid #00a884;
  border-top: 1px solid #e9edef;
}

.composer-context-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  flex: 1;
}

.composer-context-body strong {
  font-size: 0.78rem;
  color: #008069;
}

.composer-context-body span {
  font-size: 0.8rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-context .icon-btn {
  width: 30px;
  height: 30px;
  color: #667781;
}

.bubble {
  padding-right: 22px;
}

.bubble-note {
  display: block;
  margin-bottom: 3px;
  font-size: 0.7rem;
  font-style: italic;
  color: #667781;
}

.bubble-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  margin: 0 0 5px;
  padding: 4px 7px;
  border: 0;
  border-left: 3px solid #00a884;
  border-radius: 4px;
  background: rgba(11, 20, 26, 0.05);
  color: #111b21;
  text-align: left;
  overflow: hidden;
}

.message-row.out .bubble-quote {
  background: rgba(0, 92, 75, 0.09);
}

.bubble-quote strong {
  font-size: 0.76rem;
  color: #008069;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bubble-quote span {
  font-size: 0.78rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bubble-deleted {
  font-style: italic;
  color: #667781;
}

.bubble-edited {
  margin-right: auto;
  font-size: 0.64rem;
  color: #667781;
}

.bubble-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 1px;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid #e9edef;
  border-radius: 99px;
  background: #ffffff;
  color: #111b21;
  font-size: 0.78rem;
  line-height: 1;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.1);
}

.reaction-chip.is-mine {
  border-color: #00a884;
  background: #e7fce3;
}

.bubble-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #667781;
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.bubble:hover .bubble-menu-btn,
.bubble-menu-btn:focus-visible {
  opacity: 1;
}

.bubble-menu-btn:hover {
  background: #e9edef;
  color: #111b21;
}

.message-row.is-highlight .bubble {
  animation: highlight-message 1.5s ease;
}

@keyframes highlight-message {
  0%, 100% { box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); }
  20%, 70% { box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.45); }
}

.message-menu {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 6px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(11, 20, 26, 0.28);
}

.menu-reactions {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 4px 2px 7px;
  border-bottom: 1px solid #e9edef;
  margin-bottom: 4px;
}

.menu-reaction {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.1rem;
}

.menu-reaction:hover {
  background: #f0f2f5;
}

.menu-action {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #111b21;
  font-size: 0.86rem;
  text-align: left;
}

.menu-action:hover {
  background: #f0f2f5;
}

.menu-action.is-danger {
  color: #ea0038;
}

.forward-list,
.starred-list {
  display: flex;
  flex-direction: column;
  max-height: min(55vh, 420px);
  overflow-y: auto;
  padding: 0 10px 10px;
}

.forward-item,
.starred-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid #f0f2f5;
  background: transparent;
  color: #111b21;
  text-align: left;
}

.forward-item:hover,
.starred-item:hover {
  background: #f5f6f6;
}

.forward-copy,
.starred-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  flex: 1;
}

.forward-copy strong,
.starred-copy strong {
  font-size: 0.9rem;
  font-weight: 500;
}

.forward-copy span,
.starred-text {
  font-size: 0.78rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.starred-time {
  flex: none;
  font-size: 0.68rem;
  color: #667781;
}

.forward-dialog .empty-list,
.starred-dialog .empty-list {
  margin: 0 16px 16px;
}

@media (hover: none) {
  .bubble-menu-btn {
    opacity: 1;
  }
}

/* ---------- Anexos ---------- */

.attach-btn {
  flex: none;
}

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
}

.attachment-thumb {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  overflow: hidden;
  border-radius: 7px;
  background: #d9fdd3;
  color: #008069;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.attachment-thumb.is-image {
  background: #e9edef;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
  flex: 1;
}

.attachment-copy strong {
  font-size: 0.84rem;
  font-weight: 500;
  color: #111b21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-copy span {
  font-size: 0.74rem;
  color: #667781;
}

.attachment-preview .icon-btn {
  width: 30px;
  height: 30px;
  color: #667781;
}

.bubble-image {
  display: block;
  max-width: 280px;
  margin: -3px -16px 4px -3px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(11, 20, 26, 0.06);
}

.bubble-image img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.bubble-caption {
  margin-top: 2px;
}

.bubble-document {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 290px;
  margin-bottom: 4px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(11, 20, 26, 0.05);
  color: #111b21;
  text-decoration: none;
}

.message-row.out .bubble-document {
  background: rgba(0, 92, 75, 0.09);
}

.document-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 42px;
  flex: none;
  border-radius: 5px;
  background: #ffffff;
  color: #00a884;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.12);
}

.document-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.document-copy strong {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-copy span {
  font-size: 0.7rem;
  color: #667781;
}

@media (max-width: 520px) {
  .bubble-image {
    max-width: min(260px, 68vw);
  }
  .bubble-document {
    max-width: min(270px, 72vw);
  }
}

.group-dialog {
  width: min(560px, calc(100vw - 24px));
}

.group-dialog .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 22px;
}

.group-dialog .field span {
  font-size: 0.82rem;
  color: #3b4a54;
}

.group-dialog .field input {
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
}

.group-dialog .field input:disabled {
  background: #f0f2f5;
  color: #667781;
}

.group-label {
  margin: 18px 22px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667781;
}

.group-people {
  display: flex;
  flex-direction: column;
  max-height: 210px;
  overflow-y: auto;
  padding: 0 14px;
}

.group-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.88rem;
}

.group-person:last-child {
  border-bottom: 0;
}

.group-person-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.group-person-copy strong {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-person-copy .muted {
  font-size: 0.76rem;
  color: #667781;
}

.group-check {
  width: 18px;
  height: 18px;
  margin: 0 2px;
  accent-color: #00a884;
}

.group-person .btn-small {
  flex: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px 20px;
}

.dialog-actions-start {
  justify-content: flex-start;
  padding: 10px 22px 0;
}

.group-dialog .dialog-actions .btn {
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-danger {
  background: #ffffff;
  border-color: #f1c7ce;
  color: #ea0038;
}

.btn-danger:hover {
  background: #fff2f4;
  border-color: #ea0038;
  color: #c5002f;
}

.chat-header-actions #group-info {
  color: #54656f;
}

.item-avatar {
  position: relative;
}

.group-badge {
  position: absolute;
  right: -7px;
  bottom: -4px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #00a884;
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px #ffffff;
}

.bubble-sender {
  display: block;
  margin-bottom: 2px;
  color: #008069;
  font-size: 0.72rem;
  font-weight: 600;
}

.call-dialog {
  border: 0;
  padding: 0;
  background: #0b141a;
  color: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.call-dialog::backdrop {
  background: rgba(11, 20, 26, 0.68);
  backdrop-filter: blur(4px);
}

.incoming-call-dialog {
  width: min(360px, calc(100vw - 28px));
  padding: 30px 26px 24px;
  border-radius: 18px;
  background: #ffffff;
  color: #111b21;
  text-align: center;
}

.incoming-call-dialog h2 {
  margin: 14px 0 2px;
  font-size: 1.25rem;
  font-weight: 500;
}

.call-type {
  margin: 0 0 4px;
  color: #667781;
  font-size: 0.86rem;
}

.incoming-call-dialog .call-controls {
  padding: 20px 0 0;
  background: transparent;
}

.active-call-dialog {
  width: min(900px, calc(100vw - 20px));
  height: min(640px, calc(100vh - 20px));
  border-radius: 16px;
  overflow: hidden;
}

.call-stage {
  position: relative;
  height: calc(100% - 86px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 168, 132, 0.26), transparent 55%),
    #0b141a;
}

.call-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 20px;
  text-align: center;
}

.call-peer-name {
  margin-top: 8px;
  font-size: 1.2rem;
  font-weight: 500;
}

.call-status {
  color: #8696a0;
  font-size: 0.86rem;
}

.call-timer {
  color: #d9fdd3;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.call-remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000000;
}

.call-local-video {
  position: absolute;
  top: 14px;
  right: 14px;
  width: min(170px, 27vw);
  height: min(120px, 20vw);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: #111b21;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.call-stage.has-video .call-avatar-wrap {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 2;
  align-items: flex-start;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(11, 20, 26, 0.55);
  text-align: left;
}

.call-stage.has-video .call-avatar {
  display: none;
}

.call-stage.has-video .call-peer-name {
  margin: 0;
  font-size: 0.95rem;
}

.call-hidden {
  display: none !important;
}

.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: #111b21;
}

.call-btn {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: #2a3942;
  color: #e9edef;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease;
}

.call-btn:hover {
  background: #3b4a54;
}

.call-btn:active {
  transform: scale(0.94);
}

.call-btn.is-off {
  background: #ffffff;
  color: #111b21;
}

.call-btn-danger {
  background: #ea0038;
  color: #ffffff;
}

.call-btn-danger:hover {
  background: #c5002f;
}

.call-btn-accept {
  background: #00a884;
  color: #ffffff;
}

.call-btn-accept:hover {
  background: #008069;
}

@media (max-width: 520px) {
  .active-call-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .call-stage {
    height: calc(100% - 82px);
  }

  .call-controls {
    gap: 12px;
  }
}

.status-btn {
  position: relative;
}

.status-btn.has-unseen::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--sidebar);
  border-radius: 50%;
  background: var(--green);
}

.status-dialog {
  width: min(430px, calc(100vw - 24px));
}

.status-dialog-actions {
  padding: 0 22px 12px;
}

.status-dialog-actions .btn {
  width: 100%;
}

.status-list {
  display: flex;
  flex-direction: column;
  max-height: min(58vh, 460px);
  overflow-y: auto;
  border-top: 1px solid #ffe4d4;
}

.status-list .item {
  padding: 12px 22px;
}

.status-ring {
  display: inline-grid;
  place-items: center;
  padding: 2px;
  border-radius: 50%;
  background: #ecd0c2;
}

.status-ring.has-unseen {
  background: linear-gradient(135deg, var(--green), #e63946);
}

.status-ring .avatar {
  border: 2px solid #fffaf6;
}

.status-own-plus {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid #fffaf6;
  border-radius: 50%;
  background: var(--green);
  color: #fffaf6;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.status-unseen-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.item-preview.is-unseen {
  color: var(--text);
  font-weight: 600;
}

.new-status-dialog {
  width: min(470px, calc(100vw - 24px));
}

.status-mode {
  display: flex;
  gap: 6px;
  margin: 0 22px 12px;
  padding: 4px;
  border: 1px solid #f0cdb9;
  border-radius: 12px;
  background: #fff2e7;
}

.status-mode .tab {
  flex: 1;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.status-mode .tab.is-active {
  background: #fffaf6;
  color: var(--green-deep);
  box-shadow: var(--shadow-sm);
}

.new-status-dialog textarea {
  display: block;
  width: calc(100% - 44px);
  margin: 0 22px 12px;
  padding: 14px;
  border: 1px solid #f0cdb9;
  border-radius: 14px;
  background: #fff2e7;
  color: var(--text);
  resize: vertical;
  min-height: 96px;
}

.new-status-dialog textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.18);
}

.status-backgrounds {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 22px 12px;
}

.status-color {
  width: 34px;
  height: 34px;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.status-color.is-active {
  border-color: var(--text);
  transform: scale(1.08);
}

.status-image-picker {
  margin: 0 22px 12px;
  padding: 14px;
  border: 1px dashed #e6bda6;
  border-radius: 14px;
  background: #fff2e7;
  text-align: center;
}

.status-image-picker img {
  display: block;
  width: 100%;
  max-height: 230px;
  margin-top: 10px;
  border-radius: 10px;
  object-fit: contain;
  background: #f7ddcf;
}

.status-image-picker .hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.new-status-dialog .form-error {
  min-height: 18px;
  margin: 0 22px 4px;
}

.new-status-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 22px 20px;
}

.status-viewer-dialog {
  width: min(430px, 100vw);
  height: min(760px, 100vh);
  max-width: 100vw;
  max-height: 100vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #0b141a;
  color: #e9edef;
}

.status-viewer-dialog::backdrop {
  background: rgba(5, 10, 14, 0.9);
}

.status-progress {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 6;
  display: flex;
  gap: 3px;
}

.status-segment {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.32);
}

.status-segment i {
  display: block;
  width: 0;
  height: 100%;
  background: #ffffff;
}

.status-segment i.is-current {
  animation: status-progress-fill 7s linear forwards;
}

@keyframes status-progress-fill {
  from { width: 0; }
  to { width: 100%; }
}

.status-viewer-head {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(rgba(11, 20, 26, 0.8), transparent);
}

.status-viewer-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.status-viewer-copy strong {
  overflow: hidden;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-viewer-copy span {
  color: #c5d1d8;
  font-size: 0.76rem;
}

.status-viewer-close {
  color: #e9edef;
}

.status-viewer-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.status-viewer-content {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
}

.status-text-card {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 44px 30px;
  color: #ffffff;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.status-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #000000;
}

.status-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.status-image-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 42px 18px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #ffffff;
  font-size: 0.94rem;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.status-nav {
  position: absolute;
  top: 72px;
  bottom: 58px;
  z-index: 4;
  width: 34%;
  border: 0;
  background: transparent;
}

.status-nav-prev {
  left: 0;
}

.status-nav-next {
  right: 0;
}

.status-viewer-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  background: linear-gradient(transparent, rgba(11, 20, 26, 0.82));
}

.status-view-count {
  color: #d9fdd3;
  font-size: 0.82rem;
}

.status-viewer-foot .btn-danger {
  border: 0;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(234, 0, 56, 0.9);
  color: #ffffff;
  font-size: 0.8rem;
}

@media (max-width: 520px) {
  .status-viewer-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .status-text-card {
    padding: 64px 24px;
  }
}

.notify-btn.is-on {
  color: var(--green);
}

.notify-btn.is-on::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--sidebar);
  border-radius: 50%;
  background: var(--green);
}

.notify-btn.is-unavailable {
  opacity: 0.45;
}

.conversation-row {
  position: relative;
}

.conversation-row .conversation-item {
  padding-right: 40px;
}

.conversation-menu-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 1rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.14s ease, background 0.14s ease;
}

.conversation-row:hover .conversation-menu-btn,
.conversation-menu-btn:focus-visible,
.conversation-row:focus-within .conversation-menu-btn {
  opacity: 1;
}

.conversation-menu-btn:hover {
  background: var(--sidebar-3);
  color: var(--sidebar-text);
}

.conversation-item.is-pinned {
  background: rgba(255, 90, 54, 0.05);
}

.item-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.item-title-wrap .item-name {
  min-width: 0;
}

.item-pin {
  flex: none;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(255, 194, 161, 0.13);
  color: #ffc2a1;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.item-muted {
  flex: none;
  color: var(--sidebar-muted);
  font-size: 0.62rem;
}

.conversation-item.is-muted .unread {
  background: #8696a0;
  color: #ffffff;
}

.archived-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.archived-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archived-toggle:hover {
  background: var(--sidebar-2);
  color: var(--sidebar-text);
}

.archived-toggle .count {
  text-transform: none;
  letter-spacing: 0;
}

.search-results {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
}

.search-result:hover {
  background: var(--sidebar-2);
}

.search-result-avatar {
  flex: none;
  display: inline-flex;
}

.search-result-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.search-result-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.search-result-snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sidebar-muted);
  font-size: 0.76rem;
}

.menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: #e9edef;
}

@media (hover: none) {
  .conversation-menu-btn {
    opacity: 0.85;
  }
}


.camera-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
  color: #ffffff;
  overflow: hidden;
}

.camera-dialog::backdrop {
  background: #000000;
}

.camera-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
}

.camera-shell video,
.camera-shell #camera-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000000;
}

.camera-shell video {
  object-fit: cover;
}

.camera-shell #camera-photo {
  object-fit: contain;
}

.camera-shell video.is-front {
  transform: scaleX(-1);
}

.camera-dialog [hidden] {
  display: none !important;
}

.camera-topbar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 34px;
  background: linear-gradient(rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.camera-topbar > * {
  pointer-events: auto;
}

.camera-topbar > .camera-round:first-child {
  justify-self: start;
}

.camera-topbar > .camera-round:last-child {
  justify-self: end;
}

.camera-round {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 22, 24, 0.55);
  color: #ffffff;
  backdrop-filter: blur(10px);
  transition: background 0.14s ease, transform 0.12s ease;
}

.camera-round:hover {
  background: rgba(42, 50, 54, 0.8);
}

.camera-round:active {
  transform: scale(0.94);
}

.camera-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.camera-heading strong {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.camera-heading span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
}

.camera-error {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: min(340px, calc(100vw - 40px));
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(11, 20, 26, 0.82);
  color: #ffffff;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.camera-bottom {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 20px calc(env(safe-area-inset-bottom, 0px) + 30px);
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.62));
}

.camera-shutter {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.32);
  transition: transform 0.12s ease;
}

.camera-shutter span {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.camera-shutter:hover span {
  background: #f1f3f4;
}

.camera-shutter:active {
  transform: scale(0.91);
}

.camera-preview-controls {
  display: block;
  padding: 30px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
}

.camera-preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.camera-text-btn {
  flex: none;
  padding: 12px 10px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.camera-text-btn:hover {
  color: #d8fdd2;
}

.camera-caption {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(22, 27, 30, 0.62);
  color: #ffffff;
  font: inherit;
  font-size: 0.88rem;
  backdrop-filter: blur(10px);
}

.camera-caption::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.camera-caption:focus {
  outline: 2px solid rgba(0, 168, 132, 0.8);
  outline-offset: 1px;
}

.camera-send-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, background 0.12s ease;
}

.camera-send-btn:hover {
  background: #06b890;
}

.camera-send-btn:active {
  transform: scale(0.94);
}

@media (max-width: 560px) {
  .camera-topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .camera-preview-actions {
    gap: 6px;
  }

  .camera-text-btn {
    padding: 10px 4px;
    font-size: 0.82rem;
  }

  .camera-caption {
    height: 44px;
    padding: 0 14px;
    font-size: 0.84rem;
  }

  .camera-send-btn {
    width: 48px;
    height: 48px;
  }
}

.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
  color: #ffffff;
  overflow: hidden;
}

.photo-viewer::backdrop {
  background: #000000;
}

.photo-viewer-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #000000;
}

.photo-viewer-bar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 30px;
  background: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.photo-viewer-bar > * {
  pointer-events: auto;
}

.photo-viewer-round {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 24, 26, 0.5);
  color: #ffffff;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: background 0.14s ease, transform 0.12s ease;
}

.photo-viewer-round:hover {
  background: rgba(48, 56, 60, 0.72);
}

.photo-viewer-round:active {
  transform: scale(0.94);
}

.photo-viewer-time {
  min-width: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.76rem;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.photo-viewer-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 62px) 0 calc(env(safe-area-inset-bottom, 0px) + 62px);
}

.photo-viewer-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-viewer-caption-wrap {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 32vh;
  padding: 40px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  overflow-y: auto;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.photo-viewer-caption {
  max-width: 720px;
  margin: 0 auto;
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

@media (max-width: 560px) {
  .photo-viewer-bar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .photo-viewer-round {
    width: 42px;
    height: 42px;
  }

  .photo-viewer-stage {
    padding-top: calc(env(safe-area-inset-top, 0px) + 58px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
  }

  .photo-viewer-caption-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .chat-header {
    height: 58px;
    padding: 6px 8px;
    gap: 6px;
  }

  .chat-header .avatar {
    width: 40px;
    height: 40px;
  }

  .chat-header-actions {
    gap: 2px;
  }

  .chat-header-actions .icon-btn,
  .chat-header .back {
    width: 36px;
    height: 36px;
  }

  .composer {
    gap: 4px;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  }

  .composer .icon-btn {
    width: 36px;
    height: 36px;
  }

  .composer textarea {
    min-height: 42px;
    max-height: 112px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .composer .send-btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }

  .sidebar,
  .chat {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    overflow-x: hidden;
  }

  .list-scroll {
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  .sidebar-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px 6px;
  }

  .sidebar-header .me {
    flex: 1 1 100%;
    gap: 10px;
  }

  .sidebar-header-actions {
    flex: 1 0 100%;
    justify-content: space-between;
    gap: 0;
  }

  .sidebar-header-actions .icon-btn {
    width: 40px;
    height: 40px;
  }
}

.status-viewer-head {
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 24px;
}

.status-viewer-close {
  flex: none;
  width: 44px;
  height: 44px;
  background: rgba(11, 20, 26, 0.58);
  color: #ffffff;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.status-viewer-close:hover {
  background: rgba(11, 20, 26, 0.82);
}

.status-progress {
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  z-index: 12;
}

/* ---------- Status estilo WhatsApp ---------- */

.status-dialog {
  width: min(440px, calc(100vw - 24px));
  height: min(720px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
}

.status-sheet-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
}

.status-sheet-head h2 {
  margin: 0;
  color: #111b21;
  font-size: 1.22rem;
  font-weight: 600;
}

.status-sheet-head .icon-btn {
  flex: none;
  color: #54656f;
}

.status-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 0 0 84px;
  overflow-y: auto;
  background: #ffffff;
  border-top: 0;
}

.status-section-title {
  margin: 0;
  padding: 16px 16px 7px;
  color: #008069;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-list .status-item {
  width: 100%;
  min-height: 66px;
  padding: 8px 16px;
  border-radius: 0;
  gap: 13px;
  color: #111b21;
  background: transparent;
  text-align: left;
}

.status-list .status-item:hover,
.status-list .status-item:focus-visible {
  background: #f5f6f6;
}

.status-list .status-item .item-name {
  color: #111b21;
  font-size: 0.94rem;
  font-weight: 500;
}

.status-list .status-item .item-time {
  color: #667781;
  font-size: 0.7rem;
}

.status-list .status-item .item-preview {
  color: #667781;
  font-size: 0.79rem;
}

.status-list .status-item .item-preview.is-unseen {
  color: #111b21;
  font-weight: 600;
}

.status-section-empty {
  margin: 0;
  padding: 8px 16px 18px;
  color: #667781;
  font-size: 0.84rem;
  line-height: 1.4;
}

.status-empty {
  margin: 18px;
  padding: 14px;
  border-radius: 10px;
  background: #f5f6f6;
  color: #667781;
  font-size: 0.84rem;
  text-align: center;
}

.status-ring {
  padding: 2px;
  background: #d1d7db;
}

.status-ring.has-unseen {
  background: conic-gradient(#25d366 0 78%, #25d366 78% 100%);
}

.status-ring.is-viewed,
.status-ring.is-own {
  background: #d1d7db;
}

.status-ring .avatar {
  border: 3px solid #ffffff;
}

.status-own-plus {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  font-size: 0.8rem;
}

.status-unseen-dot {
  width: 10px;
  height: 10px;
  background: #25d366;
}

.status-compose-fab {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 20, 26, 0.28);
  transition: background 0.14s ease, transform 0.12s ease;
}

.status-compose-fab:hover {
  background: #008f72;
}

.status-compose-fab:active {
  transform: scale(0.94);
}

.status-viewer-dialog {
  overflow: hidden;
  background: #000000;
}

.status-viewer-head {
  top: 0;
  z-index: 20;
  justify-content: flex-start;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 82px 28px 16px;
  text-align: left;
  background: linear-gradient(rgba(11, 20, 26, 0.86), rgba(11, 20, 26, 0.28) 72%, transparent);
}

.status-viewer-head .avatar {
  flex: none;
}

.status-viewer-copy {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  align-items: flex-start;
}

.status-viewer-copy strong {
  overflow: visible;
  max-width: 100%;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status-viewer-copy span {
  color: rgba(255, 255, 255, 0.72);
}

.status-viewer-close {
  position: absolute;
  z-index: 50;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: max(18px, calc(env(safe-area-inset-right, 0px) + 18px));
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: #ffffff;
  color: #111b21;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.42);
}

.status-viewer-close svg {
  display: block;
  margin: auto;
  stroke-width: 2.4;
}

.status-viewer-close:hover {
  background: #f0f2f5;
  transform: scale(1.04);
}

.status-viewer-close:active {
  transform: scale(0.94);
}

.status-viewer-content {
  position: relative;
  background: #000000;
}

.status-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
}

.status-image-backdrop {
  position: absolute;
  inset: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: blur(28px) brightness(0.42) saturate(1.15);
  transform: scale(1.06);
  opacity: 0.95;
}

.status-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.status-image-caption {
  z-index: 2;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

.status-viewer-foot {
  z-index: 20;
}

.status-progress {
  z-index: 30;
}

.status-viewer-dialog .status-nav {
  z-index: 15;
}

@media (max-width: 520px) {
  .status-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .status-sheet-head {
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  }

  .status-list {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .status-compose-fab {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

.status-nav {
  display: flex;
  align-items: center;
  padding: 0;
  color: #ffffff;
  cursor: pointer;
}

.status-nav-prev {
  justify-content: flex-start;
  padding-left: 10px;
}

.status-nav-next {
  justify-content: flex-end;
  padding-right: 10px;
}

.status-nav svg {
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(11, 20, 26, 0.42);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(7px);
  pointer-events: none;
  transition: background 0.14s ease, transform 0.12s ease;
}

.status-nav:hover svg {
  background: rgba(11, 20, 26, 0.7);
}

.status-nav:active svg {
  transform: scale(0.92);
}

.status-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Mobile: mantém cabeçalho e fechar sempre dentro da área visível do navegador. */
@media (max-width: 700px) {
  .status-viewer-dialog {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .status-viewer-head {
    position: fixed;
    top: max(env(safe-area-inset-top, 0px), 8px);
    left: 0;
    right: 0;
    padding: 8px 88px 22px 16px;
  }

  .status-viewer-close {
    position: fixed;
    top: max(calc(env(safe-area-inset-top, 0px) + 10px), 14px);
    right: max(14px, calc(env(safe-area-inset-right, 0px) + 14px));
  }

  .status-progress {
    position: fixed;
    top: max(calc(env(safe-area-inset-top, 0px) + 4px), 6px);
  }
}

/* Rodapé de interação do status (coração e comentário) */
.status-viewer-content {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.status-viewer-foot {
  display: block;
  padding: 38px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  min-height: 86px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88) 42%);
}

.status-own-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
}

.status-view-reactions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  margin-left: 2px;
  color: #ff5c8a;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.status-reply-form input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 23px;
  background: rgba(11, 20, 26, 0.62);
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  backdrop-filter: blur(8px);
}

.status-reply-form input::placeholder {
  color: rgba(255, 255, 255, 0.74);
}

.status-reply-form input:focus {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(11, 20, 26, 0.78);
}

.status-reaction,
.status-reply-send {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.14s ease;
}

.status-reaction {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(11, 20, 26, 0.62);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.status-reaction.is-reacted {
  color: #ff4d6d;
  background: rgba(255, 255, 255, 0.18);
}

.status-reaction.is-reacted svg {
  fill: currentColor;
  stroke: currentColor;
  animation: status-heart-pop 0.28s ease;
}

.status-reply-send {
  background: #25d366;
  color: #0b141a;
}

.status-reaction:active,
.status-reply-send:active {
  transform: scale(0.92);
}

.status-reaction:disabled,
.status-reply-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.status-image-caption {
  padding-bottom: 96px;
}

.status-viewer-dialog.is-paused .status-progress {
  opacity: 0.82;
}

@keyframes status-heart-pop {
  0% { transform: scale(0.7); }
  65% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Citação do status comentado no chat */
.bubble-status-quote {
  gap: 3px;
}

.bubble-status-quote.has-thumb {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
}

.bubble-status-thumb {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 5px;
  object-fit: cover;
  background: rgba(11, 20, 26, 0.08);
}

.bubble-status-quote.has-thumb .bubble-status-heading,
.bubble-status-quote.has-thumb .bubble-status-detail {
  grid-column: 2;
  min-width: 0;
}

.bubble-status-heading {
  color: #008069;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bubble-status-detail {
  color: #667781;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-row.out .bubble-status-heading {
  color: #005c4b;
}

/* ---------- Foto do grupo e visualizador de avatar ---------- */
.avatar-btn {
  border: 0;
  padding: 0;
  appearance: none;
  cursor: pointer;
}

.avatar-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent);
  outline-offset: 2px;
}

.avatar-clickable {
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.14s ease;
}

.avatar-clickable:hover {
  filter: brightness(1.06);
  transform: scale(1.03);
}

.avatar-xl {
  width: 150px;
  height: 150px;
  font-size: 2.8rem;
}

.group-photo-block {
  align-items: center;
}

.group-photo-block .avatar {
  width: 58px;
  height: 58px;
  font-size: 1.14rem;
}

.avatar-viewer-bar {
  justify-content: space-between;
}

.avatar-viewer-heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.avatar-viewer-heading strong {
  max-width: 100%;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-viewer-heading span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}

.avatar-viewer-stage {
  padding-top: calc(env(safe-area-inset-top, 0px) + 74px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 34px);
}

.avatar-viewer-stage #avatar-viewer-image {
  max-width: min(92vw, 860px);
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.avatar-viewer-fallback {
  width: min(52vw, 230px);
  height: min(52vw, 230px);
  font-size: clamp(2.8rem, 12vw, 4.2rem);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

@media (max-width: 480px) {
  .avatar-viewer-heading strong {
    font-size: 0.92rem;
  }

  .avatar-viewer-stage {
    padding-top: calc(env(safe-area-inset-top, 0px) + 66px);
  }
}

/* ============================================================
   Aparência: tema claro/escuro + cores de destaque
   ============================================================ */
html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-accent="green"] {
  --green: #00a884;
  --green-dark: #008069;
  --green-deep: #005c4b;
  --green-soft: #d9fdd3;
  --accent-bright: #25d366;
  --accent-on: #ffffff;
}

html[data-accent="blue"] {
  --green: #1976d2;
  --green-dark: #0d47a1;
  --green-deep: #07306f;
  --green-soft: #d6eaff;
  --accent-bright: #42a5f5;
  --accent-on: #ffffff;
}

html[data-accent="purple"] {
  --green: #6a1b9a;
  --green-dark: #4a148c;
  --green-deep: #310d5e;
  --green-soft: #eadcff;
  --accent-bright: #ab47bc;
  --accent-on: #ffffff;
}

html[data-accent="pink"] {
  --green: #c2185b;
  --green-dark: #880e4f;
  --green-deep: #560027;
  --green-soft: #ffd9e6;
  --accent-bright: #ec407a;
  --accent-on: #ffffff;
}

html[data-accent="orange"] {
  --green: #e65100;
  --green-dark: #bf360c;
  --green-deep: #7a2306;
  --green-soft: #ffe3cc;
  --accent-bright: #fb8c00;
  --accent-on: #ffffff;
}

html[data-theme="light"] {
  --page-bg: #eef1f3;
  --out-bg: var(--green-soft);
  --out-text: #111b21;
  --out-meta: #667781;
  --out-link: var(--green-deep);
  --out-border: color-mix(in srgb, var(--green) 26%, transparent);
  --accent-tint: color-mix(in srgb, var(--green) 11%, transparent);
  --accent-tint-strong: color-mix(in srgb, var(--green) 18%, transparent);
}

html[data-theme="dark"] {
  --page-bg: #0b141a;
  --sidebar: #111b21;
  --sidebar-2: #202c33;
  --sidebar-3: #2a3942;
  --sidebar-muted: #8696a0;
  --sidebar-text: #e9edef;
  --panel: #202c33;
  --text: #e9edef;
  --text-soft: #d1d7db;
  --muted: #8696a0;
  --line: #222d34;
  --white: #111b21;
  --danger: #ff6b7d;
  --chat-bg: #0b141a;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.48);
  --shadow-sm: 0 1px 0.5px rgba(0, 0, 0, 0.4);
  --out-bg: color-mix(in srgb, var(--green) 28%, #111b21);
  --out-text: #e9edef;
  --out-meta: rgba(233, 237, 239, 0.62);
  --out-link: color-mix(in srgb, var(--green) 42%, #ffffff);
  --out-border: color-mix(in srgb, var(--green) 22%, transparent);
  --accent-tint: color-mix(in srgb, var(--green) 18%, transparent);
  --accent-tint-strong: color-mix(in srgb, var(--green) 28%, transparent);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 4% -6%, color-mix(in srgb, var(--green) 16%, transparent), transparent 35%),
    radial-gradient(circle at 98% 106%, color-mix(in srgb, var(--green) 11%, transparent), transparent 40%),
    #e9edef;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 4% -6%, color-mix(in srgb, var(--green) 12%, transparent), transparent 36%),
    radial-gradient(circle at 98% 106%, color-mix(in srgb, var(--green) 9%, transparent), transparent 42%),
    #0b141a;
  color: var(--text);
}

html .auth-art {
  background-color: var(--green-deep);
  background-image:
    radial-gradient(color-mix(in srgb, var(--green) 30%, transparent) 1px, transparent 1.4px),
    radial-gradient(rgba(0, 0, 0, 0.12) 1px, transparent 1.4px);
}

html .auth-art::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--green) 52%, transparent),
    transparent 68%
  );
}

html .auth-art::after {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--green-deep) 82%, transparent),
    transparent 70%
  );
}

html .eyebrow,
html .preview-online,
html .point-icon {
  color: color-mix(in srgb, var(--green-soft) 88%, #ffffff);
}

html .point-icon {
  background: color-mix(in srgb, var(--green) 26%, transparent);
}

html[data-theme="light"] .auth {
  background: #eef1f3;
}

html[data-theme="light"] .auth-panel {
  background:
    radial-gradient(circle at 82% 8%, var(--accent-tint-strong), transparent 44%),
    radial-gradient(circle at 8% 96%, var(--accent-tint), transparent 42%),
    #eef1f3;
}

html[data-theme="light"] .auth-card {
  background: #ffffff;
  border: 1px solid #e3e7ea;
  box-shadow: 0 18px 54px rgba(11, 20, 26, 0.13);
}

html[data-theme="light"] .auth-tabs {
  background: #f0f2f5;
}

html[data-theme="light"] .tab.is-active {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .field input {
  background: #f7f8fa;
  border-color: #d8dee2;
}

html[data-theme="light"] .field input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-tint);
}

html[data-theme="dark"] .auth-panel {
  background:
    radial-gradient(circle at 82% 8%, var(--accent-tint-strong), transparent 44%),
    radial-gradient(circle at 8% 96%, var(--accent-tint), transparent 42%),
    #0b141a;
}

html[data-theme="dark"] .auth-card {
  background: #111b21;
  border: 1px solid #222d34;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .brand-dark {
  color: #e9edef;
}

html[data-theme="dark"] .auth-tabs {
  background: #202c33;
}

html[data-theme="dark"] .tab {
  color: #8696a0;
}

html[data-theme="dark"] .tab:hover {
  color: #e9edef;
}

html[data-theme="dark"] .tab.is-active {
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .field label {
  color: #d1d7db;
}

html[data-theme="dark"] .field input {
  background: #2a3942;
  border-color: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .field input:focus {
  background: #2a3942;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--accent-tint);
}

html[data-theme="dark"] .password-toggle {
  background: #2a3942;
  color: #e9edef;
}

html .btn-primary,
html .send-btn,
html .camera-send-btn,
html .status-compose-fab,
html .group-badge,
html .call-btn-accept {
  background: var(--green);
  color: var(--accent-on);
}

html .btn-primary:hover,
html .send-btn:hover,
html .status-compose-fab:hover,
html .call-btn-accept:hover {
  background: var(--green-dark);
  color: var(--accent-on);
}

html .record-btn {
  color: var(--green);
}

html[data-theme="light"] .record-btn {
  background: #ffffff;
}

html[data-theme="light"] .record-btn:hover {
  background: var(--accent-tint);
  color: var(--green-dark);
}

html .status-reply-send {
  background: var(--accent-bright);
  color: #0b141a;
}

html .unread,
html .dot-online,
html .status-unseen-dot {
  background: var(--accent-bright);
}

html .unread {
  color: #ffffff;
}

html .item-action {
  background: var(--accent-tint-strong);
  color: var(--green-dark);
}

html .count-online {
  background: var(--accent-tint);
  color: var(--green-dark);
}

html .notify-btn.is-on {
  color: var(--green);
}

html .notify-btn.is-on::after,
html .status-btn.has-unseen::after {
  background: var(--green);
}

html .status-own-plus {
  background: var(--accent-bright);
}

html .status-ring.has-unseen {
  background: conic-gradient(
    var(--accent-bright) 0 78%,
    var(--accent-bright) 78% 100%
  );
}

html .status-section-title,
html .bubble-sender,
html .bubble-quote strong,
html .bubble-status-heading,
html .pinned-copy strong,
html .composer-context-body strong,
html .document-icon,
html .item-status.is-online,
html .chat-status.is-online,
html .chat-status.is-typing {
  color: var(--green-dark);
}

html .pinned-icon,
html .attachment-thumb {
  background: var(--accent-tint-strong);
  color: var(--green-dark);
}

html .composer-context {
  border-left-color: var(--green);
}

html .bubble-quote,
html .bubble-status-quote {
  border-left-color: var(--green);
}

html .status-reaction.is-reacted {
  color: #ff4d6d;
}

html .message-row.out .bubble {
  background: var(--out-bg);
  color: var(--out-text);
  border: 1px solid var(--out-border);
}

html .message-row.out .bubble-text {
  color: var(--out-text);
}

html .message-row.out .bubble-meta,
html .message-row.out .ticks,
html .message-row.out .bubble-note,
html .message-row.out .bubble-edited,
html .message-row.out .bubble-status-detail,
html .message-row.out .bubble-status-quote span,
html .message-row.out .document-copy span {
  color: var(--out-meta);
}

html .message-row.out .ticks.is-read {
  color: #53bdeb;
}

html .message-row.out .bubble-quote strong,
html .message-row.out .bubble-status-heading {
  color: var(--out-link);
}

html .message-row.out .bubble-quote {
  background: color-mix(in srgb, var(--out-text) 7%, transparent);
}

html .message-row.out .bubble-document {
  background: color-mix(in srgb, var(--out-text) 7%, transparent);
  color: var(--out-text);
}

html .message-row.out .bubble-image {
  background: color-mix(in srgb, var(--out-text) 8%, transparent);
}

html .recording {
  background: linear-gradient(135deg, var(--accent-tint), var(--accent-tint-strong));
  border-top-color: var(--out-border);
  color: var(--text);
}

html #recording-time {
  color: var(--green-dark);
}

html .new-status-dialog textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-tint);
}

html .status-mode {
  border-color: var(--line);
  background: var(--panel);
}

html[data-theme="light"] .status-mode {
  background: #f0f2f5;
}

html .status-mode .tab.is-active {
  background: var(--white);
  color: var(--green-dark);
}

html .new-status-dialog textarea,
html .status-image-picker {
  background: var(--panel);
  border-color: var(--line);
}

html[data-theme="light"] .new-status-dialog textarea,
html[data-theme="light"] .status-image-picker {
  background: #f7f8fa;
}

html .avatar-btn:focus-visible {
  outline-color: var(--green);
}

html .appearance-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent-tint-strong);
  color: var(--green-dark);
}

.theme-mode {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--panel);
}

.theme-mode button {
  min-height: 36px;
  padding: 7px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.theme-mode button:hover {
  color: var(--text);
}

.theme-mode button[aria-pressed="true"] {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(11, 20, 26, 0.16);
}

.accent-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 13px;
}

.accent-choice {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.accent-choice span {
  display: block;
  width: 30px;
  height: 30px;
  border: 3px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(11, 20, 26, 0.12);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.accent-choice small {
  font-size: 0.65rem;
  font-weight: 600;
}

.accent-choice:hover span {
  transform: scale(1.08);
}

.accent-choice[aria-pressed="true"] span {
  border-color: var(--white);
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.accent-choice-green span { background: #00a884; }
.accent-choice-blue span { background: #1976d2; }
.accent-choice-purple span { background: #6a1b9a; }
.accent-choice-pink span { background: #c2185b; }
.accent-choice-orange span { background: #e65100; }

/* ---------- Tema escuro ---------- */
html[data-theme="dark"] .app {
  background: #0b141a;
}

html[data-theme="dark"] .sidebar {
  background: #111b21;
  border-right-color: #222d34;
  color: #e9edef;
}

html[data-theme="dark"] .sidebar-header,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .chat-header,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .recording,
html[data-theme="dark"] .pinned-banner {
  background: #202c33;
  border-color: #222d34;
  color: #e9edef;
}

html[data-theme="dark"] .me-copy .muted,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .search-wrap {
  color: #8696a0;
}

html[data-theme="dark"] .icon-btn-dark,
html[data-theme="dark"] .back,
html[data-theme="dark"] .chat-header-actions #group-info {
  color: #aebac1;
}

html[data-theme="dark"] .icon-btn-dark:hover,
html[data-theme="dark"] .back:hover {
  background: rgba(233, 237, 239, 0.08);
}

html[data-theme="dark"] .search-wrap {
  background: #202c33;
}

html[data-theme="dark"] .search-wrap input,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .group-dialog .field input {
  color: #e9edef;
}

html[data-theme="dark"] .search-wrap input::placeholder,
html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .composer textarea::placeholder {
  color: #8696a0;
}

html[data-theme="dark"] .list-scroll {
  scrollbar-color: #374248 transparent;
}

html[data-theme="dark"] .list-scroll::-webkit-scrollbar-thumb {
  background: #374248;
}

html[data-theme="dark"] .section-title h2,
html[data-theme="dark"] .item-time,
html[data-theme="dark"] .item-preview,
html[data-theme="dark"] .item-status,
html[data-theme="dark"] .chat-status,
html[data-theme="dark"] .privacy-badge,
html[data-theme="dark"] .bubble-meta,
html[data-theme="dark"] .typing,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .profile-copy p,
html[data-theme="dark"] .group-label,
html[data-theme="dark"] .group-person-copy .muted,
html[data-theme="dark"] .group-dialog .field span {
  color: #8696a0;
}

html[data-theme="dark"] .count {
  background: #202c33;
  color: #8696a0;
}

html[data-theme="dark"] .count-online {
  background: var(--accent-tint-strong);
  color: var(--green-soft);
}

html[data-theme="dark"] .list .item,
html[data-theme="dark"] .item {
  color: #e9edef;
  border-bottom-color: #222d34;
}

html[data-theme="dark"] .item:hover,
html[data-theme="dark"] .forward-item:hover,
html[data-theme="dark"] .starred-item:hover {
  background: #202c33;
}

html[data-theme="dark"] .item.is-active {
  background: #2a3942;
  box-shadow: none;
}

html[data-theme="dark"] .item-avatar .dot {
  border-color: #111b21;
}

html[data-theme="dark"] .empty-list {
  background: #182229;
  color: #8696a0;
}

html[data-theme="dark"] .sidebar-footer {
  border-top-color: #222d34;
}

html[data-theme="dark"] .dot {
  background: #8696a0;
}

html[data-theme="dark"] .dot-online {
  background: var(--accent-bright);
}

html[data-theme="dark"] .conversation-menu-btn {
  color: #8696a0;
}

html[data-theme="dark"] .conversation-menu-btn:hover {
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .conversation-item.is-pinned {
  background: rgba(233, 237, 239, 0.035);
}

html[data-theme="dark"] .item-pin,
html[data-theme="dark"] .item-muted {
  background: var(--accent-tint-strong);
  color: var(--green-soft);
}

html[data-theme="dark"] .archived-section,
html[data-theme="dark"] .search-results {
  border-color: #222d34;
}

html[data-theme="dark"] .archived-toggle:hover,
html[data-theme="dark"] .search-result:hover {
  background: #202c33;
}

html[data-theme="dark"] .search-result {
  color: #e9edef;
}

html[data-theme="dark"] .menu-separator {
  background: #2a3942;
}

html[data-theme="dark"] .chat {
  background-color: #0b141a;
  background-image:
    radial-gradient(rgba(233, 237, 239, 0.035) 1px, transparent 1.3px),
    radial-gradient(rgba(233, 237, 239, 0.022) 1px, transparent 1.3px);
}

html[data-theme="dark"] .chat-empty h2 {
  color: #e9edef;
}

html[data-theme="dark"] .chat-empty p,
html[data-theme="dark"] .chat-empty-hint,
html[data-theme="dark"] .messages-empty {
  color: #8696a0;
}

html[data-theme="dark"] .chat-empty-art svg {
  filter: saturate(0.85) brightness(0.82);
}

html[data-theme="dark"] .chat-header {
  border-bottom-color: #222d34;
}

html[data-theme="dark"] .privacy-badge {
  background: #111b21;
}

html[data-theme="dark"] .messages {
  scrollbar-color: rgba(233, 237, 239, 0.18) transparent;
}

html[data-theme="dark"] .messages::-webkit-scrollbar-thumb {
  background: rgba(233, 237, 239, 0.18);
}

html[data-theme="dark"] .messages-empty {
  background: rgba(17, 27, 33, 0.88);
}

html[data-theme="dark"] .date-divider {
  background: #182229;
  color: #8696a0;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .message-row.in .bubble {
  background: #202c33;
  color: #e9edef;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .message-row.in .bubble-text {
  color: #e9edef;
}

html[data-theme="dark"] .bubble.is-failed {
  background: #4a2028;
}

html[data-theme="dark"] .bubble-note,
html[data-theme="dark"] .bubble-deleted,
html[data-theme="dark"] .bubble-edited {
  color: #8696a0;
}

html[data-theme="dark"] .typing-dots span {
  background: #8696a0;
}

html[data-theme="dark"] .composer textarea {
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .composer textarea:focus {
  box-shadow: 0 0 0 2px var(--accent-tint-strong);
}

html[data-theme="dark"] .record-btn {
  background: transparent;
  color: #aebac1;
}

html[data-theme="dark"] .record-btn:hover {
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .recording {
  background: #202c33;
  border-top-color: #222d34;
  color: #e9edef;
}

html[data-theme="dark"] #recording-time {
  color: var(--green-soft);
}

html[data-theme="dark"] .recording-label {
  color: #8696a0;
}

html[data-theme="dark"] .pinned-banner {
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .pinned-jump {
  color: #e9edef;
}

html[data-theme="dark"] .pinned-copy #pinned-text {
  color: #8696a0;
}

html[data-theme="dark"] .pinned-banner .icon-btn {
  color: #8696a0;
}

html[data-theme="dark"] .composer-context {
  background: #202c33;
  border-top-color: #222d34;
}

html[data-theme="dark"] .composer-context-body span,
html[data-theme="dark"] .composer-context .icon-btn {
  color: #8696a0;
}

html[data-theme="dark"] .bubble-quote {
  background: rgba(233, 237, 239, 0.06);
  color: #e9edef;
}

html[data-theme="dark"] .bubble-quote span {
  color: #8696a0;
}

html[data-theme="dark"] .reaction-chip {
  background: #202c33;
  border-color: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .reaction-chip.is-mine {
  background: var(--accent-tint-strong);
  border-color: var(--green);
}

html[data-theme="dark"] .bubble-menu-btn {
  background: rgba(32, 44, 51, 0.86);
  color: #8696a0;
}

html[data-theme="dark"] .bubble-menu-btn:hover {
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .message-menu {
  background: #233138;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .menu-reactions {
  border-bottom-color: #2a3942;
}

html[data-theme="dark"] .menu-reaction:hover,
html[data-theme="dark"] .menu-action:hover {
  background: #2a3942;
}

html[data-theme="dark"] .menu-action {
  color: #e9edef;
}

html[data-theme="dark"] .forward-item,
html[data-theme="dark"] .starred-item {
  color: #e9edef;
  border-bottom-color: #222d34;
}

html[data-theme="dark"] .forward-copy span,
html[data-theme="dark"] .starred-text,
html[data-theme="dark"] .starred-time {
  color: #8696a0;
}

html[data-theme="dark"] .attachment-preview {
  background: #202c33;
  border-top-color: #222d34;
}

html[data-theme="dark"] .attachment-thumb {
  background: var(--accent-tint-strong);
  color: var(--green-soft);
}

html[data-theme="dark"] .attachment-thumb.is-image {
  background: #2a3942;
}

html[data-theme="dark"] .attachment-copy strong {
  color: #e9edef;
}

html[data-theme="dark"] .attachment-copy span,
html[data-theme="dark"] .attachment-preview .icon-btn {
  color: #8696a0;
}

html[data-theme="dark"] .bubble-image {
  background: rgba(233, 237, 239, 0.07);
}

html[data-theme="dark"] .bubble-document {
  background: rgba(233, 237, 239, 0.07);
  color: #e9edef;
}

html[data-theme="dark"] .document-icon {
  background: #202c33;
  color: var(--green-soft);
}

html[data-theme="dark"] .document-copy span {
  color: #8696a0;
}

html[data-theme="dark"] .profile-dialog {
  background: #111b21;
  border-color: #222d34;
  color: #e9edef;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .profile-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .profile-block {
  border-top-color: #222d34;
}

html[data-theme="dark"] .background-swatch {
  border-color: #2a3942;
  background:
    linear-gradient(135deg, var(--accent-tint-strong), var(--accent-tint)),
    repeating-linear-gradient(45deg, #111b21 0 6px, #182229 6px 12px);
}

html[data-theme="dark"] .btn-ghost {
  background: #202c33;
  border-color: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .btn-ghost:hover {
  border-color: var(--green);
  color: var(--green-soft);
}

html[data-theme="dark"] .btn-danger {
  background: #202c33;
  border-color: #5a2a30;
  color: #ff8a95;
}

html[data-theme="dark"] .btn-danger:hover {
  background: #3a2026;
  border-color: #ff8a95;
  color: #ffd6db;
}

html[data-theme="dark"] .toast {
  background: #e9edef;
  color: #111b21;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .toast.is-error {
  background: #8e2632;
  color: #ffffff;
}

html[data-theme="dark"] .theme-mode {
  background: #202c33;
}

html[data-theme="dark"] .theme-mode button[aria-pressed="true"] {
  background: #2a3942;
  color: #e9edef;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .accent-choice span {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .accent-choice[aria-pressed="true"] span {
  border-color: #111b21;
  outline-color: #e9edef;
}

html[data-theme="dark"] .appearance-icon {
  background: var(--accent-tint-strong);
  color: var(--green-soft);
}

html[data-theme="dark"] .group-dialog .field input {
  background: #2a3942;
  border-color: #2a3942;
}

html[data-theme="dark"] .group-dialog .field input:disabled {
  background: #182229;
  color: #8696a0;
}

html[data-theme="dark"] .group-person {
  border-bottom-color: #222d34;
}

html[data-theme="dark"] .group-check {
  accent-color: var(--green);
}

html[data-theme="dark"] .incoming-call-dialog {
  background: #111b21;
  color: #e9edef;
}

html[data-theme="dark"] .call-type {
  color: #8696a0;
}

html[data-theme="dark"] .status-dialog {
  background: #111b21;
}

html[data-theme="dark"] .status-sheet-head {
  background: #202c33;
  border-bottom-color: #222d34;
}

html[data-theme="dark"] .status-sheet-head h2,
html[data-theme="dark"] .status-list .status-item .item-name,
html[data-theme="dark"] .status-list .status-item .item-preview.is-unseen {
  color: #e9edef;
}

html[data-theme="dark"] .status-sheet-head .icon-btn {
  color: #aebac1;
}

html[data-theme="dark"] .status-list {
  background: #111b21;
}

html[data-theme="dark"] .status-list .status-item {
  color: #e9edef;
}

html[data-theme="dark"] .status-list .status-item:hover,
html[data-theme="dark"] .status-list .status-item:focus-visible {
  background: #202c33;
}

html[data-theme="dark"] .status-list .status-item .item-time,
html[data-theme="dark"] .status-list .status-item .item-preview,
html[data-theme="dark"] .status-section-empty {
  color: #8696a0;
}

html[data-theme="dark"] .status-section-title {
  color: var(--green-soft);
}

html[data-theme="dark"] .status-empty {
  background: #202c33;
  color: #8696a0;
}

html[data-theme="dark"] .status-ring,
html[data-theme="dark"] .status-ring.is-viewed,
html[data-theme="dark"] .status-ring.is-own {
  background: #2a3942;
}

html[data-theme="dark"] .status-ring .avatar {
  border-color: #111b21;
}

html[data-theme="dark"] .status-own-plus {
  border-color: #111b21;
}

html[data-theme="dark"] .status-mode {
  border-color: #2a3942;
  background: #202c33;
}

html[data-theme="dark"] .status-mode .tab {
  color: #8696a0;
}

html[data-theme="dark"] .status-mode .tab.is-active {
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .new-status-dialog textarea,
html[data-theme="dark"] .status-image-picker {
  background: #202c33;
  border-color: #2a3942;
  color: #e9edef;
}

html[data-theme="dark"] .status-image-picker img {
  background: #111b21;
}

html[data-theme="dark"] .status-image-picker .hint {
  color: #8696a0;
}

html[data-theme="light"] .profile-dialog {
  background: #ffffff;
  border-color: #e9edef;
}

html[data-theme="light"] .profile-block {
  border-top-color: #e9edef;
}

html[data-theme="light"] .status-mode {
  background: #f0f2f5;
  border-color: #e9edef;
}

html[data-theme="light"] .new-status-dialog textarea,
html[data-theme="light"] .status-image-picker {
  background: #f7f8fa;
  border-color: #d8dee2;
}

@media (max-width: 520px) {
  .appearance-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .accent-picker {
    gap: 9px;
  }

  .accent-choice span {
    width: 28px;
    height: 28px;
  }
}

.profile-dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.profile-dialog::-webkit-scrollbar {
  width: 8px;
}

.profile-dialog::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(11, 20, 26, 0.22);
}

html[data-theme="dark"] .profile-dialog {
  scrollbar-color: #374248 transparent;
}

html[data-theme="dark"] .profile-dialog::-webkit-scrollbar-thumb {
  background: #374248;
}

/* ---------- Verificação anti-bot ---------- */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0 10px;
  padding: 11px 12px;
  border: 1px solid #d8dee2;
  border-radius: 11px;
  background: #f7f8fa;
}

.captcha-box[hidden] {
  display: none;
}

.captcha-shield {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-tint-strong);
  color: var(--green-dark);
}

.captcha-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.captcha-copy strong {
  color: var(--text);
  font-size: 0.82rem;
}

.captcha-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.captcha-copy span.is-error {
  color: var(--danger);
}

.turnstile-slot {
  margin-left: auto;
  min-height: 1px;
}

html[data-theme="dark"] .captcha-box {
  border-color: #2a3942;
  background: #182229;
}

html[data-theme="dark"] .captcha-shield {
  background: var(--accent-tint-strong);
  color: var(--green-soft);
}

@media (max-width: 420px) {
  .captcha-box {
    align-items: flex-start;
  }

  .turnstile-slot {
    margin-left: 0;
  }
}
