/* Atendimentos — inbox WhatsApp */

.att-page-header {
  margin-bottom: 12px;
}

.att-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.att-config-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.att-config-badge.att-config-ok {
  background: #DCFCE7;
  color: #166534;
  border-color: #BBF7D0;
}

.att-unread-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
}

.att-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 160px);
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel, #fff);
}

.att-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.att-col-list {
  border-right: 1px solid var(--border);
  background: #fafafa;
}

.att-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.att-line-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.att-line-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: #374151;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
}

.att-line-pill:hover {
  border-color: #9CA3AF;
}

.att-line-pill.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.att-line-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.att-line-pill-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.att-line-pill.active .att-line-pill-unread {
  background: #fff;
  color: #166534;
}

.att-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.att-select {
  appearance: auto;
}

.att-conversation-list {
  overflow-y: auto;
  flex: 1;
}

.att-conv-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.att-conv-item:hover {
  background: #f3f4f6;
}

.att-conv-item.active {
  background: #ecfdf5;
  border-left: 3px solid #25D366;
}

.att-conv-item.att-conv-bump {
  animation: att-bump-in 0.35s ease;
}

@keyframes att-bump-in {
  from {
    background: #dcfce7;
    transform: translateY(-4px);
  }
  to {
    background: transparent;
    transform: translateY(0);
  }
}

.att-conv-item.active.att-conv-bump {
  background: #ecfdf5;
}

.att-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d1fae5 center/cover no-repeat;
  color: #065f46;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.att-avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.att-conv-body {
  flex: 1;
  min-width: 0;
}

.att-conv-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.att-conv-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-conv-company {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.att-conv-time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.att-conv-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.att-typing-preview {
  color: #059669;
  font-style: italic;
}

.att-conv-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.att-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e5e7eb;
  color: #374151;
}

.att-status-badge.status-novo_lead { background: #DBEAFE; color: #1D4ED8; }
.att-status-badge.status-em_atendimento { background: #FEF3C7; color: #B45309; }
.att-status-badge.status-finalizado { background: #E5E7EB; color: #4B5563; }

.att-tag-pill {
  display: inline-flex;
  align-items: center;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F3F4F6;
  color: #374151;
}

.att-unread-dot {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.att-sector-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 10px;
  font-weight: 600;
}

.att-list-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.att-list-empty code {
  font-size: 11px;
  word-break: break-all;
}

.att-col-chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 0;
}

/* Guarda: lista do inbox nunca deve aparecer dentro do painel do chat */
#att-chat-root > #att-conversation-list,
#att-chat-root > .att-conversation-list {
  display: none !important;
}

.att-col-chat:has(.att-empty-state) {
  grid-template-columns: 1fr;
}

.att-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: #ece5dd;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.35) 0, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0,0,0,0.03) 0, transparent 35%);
}

.att-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f0f2f5;
  border-bottom: 1px solid var(--border);
}

.att-chat-title {
  font-weight: 600;
  font-size: 15px;
}

.att-chat-company {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
  margin-top: 1px;
}

.att-chat-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.att-typing-indicator {
  color: #059669;
  font-style: italic;
}

.att-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-messages-empty {
  text-align: center;
  color: var(--muted);
  margin: auto;
  font-size: 13px;
}

.att-bubble {
  max-width: min(72%, 420px);
  padding: 8px 10px 4px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
  word-break: break-word;
}

.att-bubble.in {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 2px;
}

.att-bubble.out {
  align-self: flex-end;
  background: #d9fdd3;
  border-top-right-radius: 2px;
}

.att-bubble.sender-ai.out {
  background: #e0e7ff;
}

.att-bubble-meta {
  font-size: 10px;
  color: #667781;
  text-align: right;
  margin-top: 2px;
}

.att-day-sep {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 10px 0 6px;
  align-self: stretch;
}

.att-day-sep span {
  background: #e1f2fa;
  color: #54656f;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  text-transform: none;
}

.att-media-link {
  display: inline-block;
  color: #0369a1;
  text-decoration: underline;
  margin-bottom: 4px;
}

.att-audio {
  max-width: 240px;
  height: 32px;
}

.att-audio-fallback {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.att-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #f0f2f5;
  border-top: 1px solid var(--border);
}

.att-composer-main {
  flex: 1;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.att-slash-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
}

.att-slash-menu[hidden] {
  display: none !important;
}

.att-slash-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.att-slash-item:hover,
.att-slash-item.is-active {
  background: #f3f4f6;
}

.att-slash-cmd {
  font-weight: 700;
  color: #111827;
  font-size: 13px;
}

.att-slash-meta {
  font-size: 12px;
  color: #6b7280;
}

.att-composer-input {
  flex: 1;
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  resize: none;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* evita zoom e teclado quebrado no iOS */
  line-height: 1.35;
  background: #fff;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  caret-color: #111;
  color: #111;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.att-composer-input:focus {
  box-shadow: inset 0 0 0 2px rgba(236, 72, 153, 0.25);
}

.att-composer-input:disabled {
  opacity: 0.55;
}

.att-attach-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #e5e7eb;
  color: #374151;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.att-mic-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #54656f;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.att-mic-btn:hover:not(:disabled) {
  background: #3b4a54;
}

.att-mic-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.att-mic-btn.is-hidden,
.att-send-btn.is-hidden {
  display: none;
}

.att-composer.is-recording .att-attach-btn,
.att-composer.is-recording .att-composer-input,
.att-composer.is-recording .att-composer-main > .att-composer-input,
.att-composer.is-recording .att-mic-btn,
.att-composer.is-recording .att-send-btn,
.att-composer.is-recording .att-slash-menu {
  display: none;
}

.att-voice-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 4px;
}

.att-voice-bar[hidden] {
  display: none !important;
}

.att-voice-cancel {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.att-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: att-voice-pulse 1s ease-in-out infinite;
}

@keyframes att-voice-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.att-voice-timer {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  min-width: 3.2em;
}

.att-voice-send {
  margin-left: auto;
  flex-shrink: 0;
}

.att-send-btn {
  flex-shrink: 0;
  min-width: 88px;
}

/* Rótulo imune ao corretor do Windows (Enviar → estampar) */
.att-send-btn::before {
  content: "Enviar";
}

.att-crm {
  background: #fff;
  overflow-y: auto;
  padding: 14px;
}

.att-crm-sheet-head {
  display: none;
}

.att-crm-toggle {
  display: none;
}

.att-crm-backdrop {
  display: none;
}

.att-crm-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.att-crm-name-row {
  margin: 0 0 14px;
}

.att-crm-name-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.att-crm-name-view {
  display: flex;
  align-items: center;
  gap: 8px;
}

.att-crm-name-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.att-crm-company-text {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 2px 0 0;
}

.att-crm-name-edit-btn {
  border: 1px solid var(--border, #E5E7EB);
  background: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #4B5563;
}

.att-crm-name-edit-btn:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
}

.att-crm-name-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.att-crm-open-link {
  display: inline-block;
  margin-bottom: 4px;
}

.att-crm-dl {
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.att-crm-dl dt {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.att-crm-dl dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
}

.att-crm-dl a {
  color: var(--violet, #7c3aed);
}

.att-crm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.att-crm-actions .btn {
  width: 100%;
}

.att-crm-actions .att-btn-danger,
.btn.att-btn-danger {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
}

.att-crm-actions .att-btn-danger:hover,
.btn.att-btn-danger:hover {
  background: #991B1B;
  border-color: #991B1B;
}

.att-delete-form {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: auto;
}

.att-delete-form--crm {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.att-delete-form--crm .att-delete-conv-btn {
  width: 100%;
  height: 40px;
}

.att-delete-conv-btn {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.att-notes-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.att-label {
  font-size: 12px;
  font-weight: 600;
}

.att-hint {
  font-weight: 400;
  color: var(--muted);
}

.att-notes-save {
  margin-top: 4px;
  align-self: flex-start;
}

.att-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 32px;
  color: var(--muted);
  grid-column: 1 / -1;
  background: #f8fafc;
}

.att-empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.att-empty-state h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 18px;
}

.att-empty-state p {
  margin: 0;
  max-width: 360px;
  font-size: 13px;
}

.att-flash {
  background: #DCFCE7;
  color: #166534;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #BBF7D0;
}

.att-flash.warn {
  background: #FEF3C7;
  color: #92400E;
  border-bottom-color: #FCD34D;
  font-weight: 600;
}

.att-flash.sm {
  border: 1px solid #BBF7D0;
  border-radius: 6px;
  margin-bottom: 10px;
}

.att-error {
  background: #FEE2E2;
  color: #991B1B;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #FECACA;
}

.att-sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

@media (max-width: 1100px) {
  .att-col-chat {
    grid-template-columns: 1fr;
  }
  .att-crm {
    border-top: 1px solid var(--border);
    max-height: 40%;
  }
  .att-thread {
    border-right: none;
    min-height: 55%;
  }
}

.att-filter-hint {
  font-size: 11px;
  color: var(--muted, #6b7280);
}

.att-back-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  color: var(--text);
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.att-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.att-tag-chip {
  --att-tag-bg: #F3F4F6;
  --att-tag-fg: #374151;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--att-tag-fg) 18%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: var(--att-tag-fg);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.att-tag-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.att-tag-chip span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: inherit;
}

.att-tag-chip:hover {
  border-color: color-mix(in srgb, var(--att-tag-fg) 35%, transparent);
}

.att-tag-chip:has(input:checked),
.att-tag-chip.is-on {
  background: var(--att-tag-bg);
  border-color: color-mix(in srgb, var(--att-tag-fg) 28%, transparent);
  color: var(--att-tag-fg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--att-tag-fg) 8%, transparent);
}

@media (max-width: 800px) {
  /* Lista: header no modelo mobile */
  .att-page-header {
    margin-bottom: 12px;
    gap: 10px;
  }

  .att-page-header .page-subtitle {
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .att-page-actions {
    align-items: center;
    gap: 8px;
  }

  .att-page-actions .att-config-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
  }

  .att-page-actions #att-new-call-toggle {
    flex: 1 1 auto;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    color: #fff;
    font-weight: 700;
  }

  .att-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - 220px);
    min-height: 360px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .att-col-list {
    max-height: none;
    height: 100%;
    border-right: none;
    border-bottom: none;
  }

  .att-col-chat {
    display: none;
    grid-template-columns: 1fr;
    min-height: 0;
    height: 100%;
    position: relative;
  }

  .att-shell--chat-open .att-col-list {
    display: none;
  }

  .att-shell--chat-open .att-col-chat {
    display: flex;
    flex-direction: column;
  }

  /* Conversa aberta: chat tela cheia (some chrome global) */
  body:has(.att-shell--chat-open) .att-page-header,
  body:has(.att-shell--chat-open) .att-new-call-panel,
  body:has(.att-shell--chat-open) .att-page-flash,
  body:has(.att-shell--chat-open) .page-back-bar,
  body:has(.att-shell--chat-open) .mobile-topbar,
  body:has(.att-shell--chat-open) .mobile-bottom-nav {
    display: none !important;
  }

  body:has(.att-shell--chat-open) .whatsapp-fab {
    display: none !important;
  }

  body:has(.att-shell--chat-open) .main-content {
    padding: 0 !important;
  }

  body:has(.att-shell--chat-open) .att-shell {
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    border: none;
    margin: 0;
    width: 100%;
    box-shadow: none;
  }

  .att-thread {
    border-right: none;
    flex: 1;
    min-height: 0;
    height: 100%;
  }

  .att-back-btn {
    display: inline-flex;
  }

  .att-chat-header {
    gap: 8px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
  }

  .att-chat-header-text {
    flex: 1;
    min-width: 0;
  }

  .att-chat-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .att-chat-sub {
    font-size: 11px;
  }

  .att-crm-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
  }

  .att-messages {
    padding: 12px;
  }

  .att-filters {
    padding: 12px;
    gap: 8px;
    background: #fff;
    border-bottom: 1px solid var(--border);
  }

  .att-input,
  .att-select,
  .att-composer-input {
    min-height: 42px;
    font-size: 16px; /* evita zoom no iOS */
    border-radius: 12px;
  }

  .att-composer {
    padding: 8px 10px;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--border);
  }

  .att-attach-btn {
    width: 42px;
    height: 42px;
  }

  .att-mic-btn {
    width: 44px;
    height: 44px;
  }

  .att-send-btn {
    width: auto;
    min-width: 72px;
    height: 42px;
    padding: 0 14px;
  }

  /* CRM vira bottom sheet no mobile */
  .att-crm {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 140;
    max-height: min(78dvh, 640px);
    padding: 0 14px 16px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.18);
    -webkit-overflow-scrolling: touch;
  }

  .att-crm.is-open {
    display: block;
  }

  .att-crm-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    padding: 12px 0 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }

  .att-crm-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  .att-crm .att-crm-title {
    display: none;
  }

  .att-crm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 135;
    background: rgba(15, 23, 42, 0.45);
  }

  .att-crm-backdrop.is-open {
    display: block;
  }

  .att-crm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .att-crm-actions .btn {
    width: 100%;
    min-height: 42px;
  }

  .att-crm-actions .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.att-page-actions {
  flex-wrap: wrap;
}

.att-new-call-panel {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
}

.att-new-call-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.att-new-call-hint {
  margin: 0 0 12px;
  color: var(--muted, #64748b);
  font-size: 0.85rem;
}

.att-new-call-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.att-new-call-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted, #64748b);
}

.att-new-call-field-wide {
  grid-column: 1 / -1;
}

.att-new-call-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.att-page-flash {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.att-page-flash.ok {
  background: #dcfce7;
  color: #166534;
}

.att-page-flash.err {
  background: #fde8e8;
  color: #9b1c1c;
}

@media (max-width: 720px) {
  .att-new-call-grid {
    grid-template-columns: 1fr;
  }
}
