.att-list {
  display: grid;
}
.att-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 20px;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--borda, #ddd);
  padding: 20px;
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.att-row:hover {
  background: rgba(255, 128, 0, 0.07);
}
.att-row small,
.att-bubble small {
  display: block;
  margin-top: 5px;
}
.att-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-warning {
  color: #d97706;
}
.att-dialog {
  width: min(760px, 95vw);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--borda, #777);
  border-radius: 18px;
  color: var(--texto, #222);
  background: var(--superficie, #fff);
}
.att-dialog[open] {
  display: flex;
  flex-direction: column;
}
.att-dialog h2 {
  font-size: 20px;
}
.att-messages {
  flex: 1;
  overflow: auto;
  padding: 20px;
  min-height: 150px;
  overscroll-behavior: contain;
}
.att-turn {
  margin-bottom: 24px;
}
.att-turn > small {
  display: block;
  text-align: center;
  margin: 10px;
}
.att-bubble {
  border-radius: 14px;
  padding: 14px;
  margin: 10px 0;
  max-width: 90%;
  border: 1px solid var(--borda, #888);
}
.att-bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.att-agent {
  margin-left: auto;
  background: rgba(255, 128, 0, 0.12);
}
.att-dialog footer {
  flex-shrink: 0;
  justify-content: space-between;
}
.att-dialog [role="alert"],
#att-error {
  padding: 0 20px;
}
.att-phone {
  margin: 4px 0;
}
@media (max-width: 600px) {
  .att-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .att-preview {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .att-dialog {
    max-height: 94vh;
    width: 96vw;
  }
  .att-bubble {
    max-width: 96%;
  }
}
.att-list {
  margin: 0 24px 24px;
  border: 1px solid var(--borda, #ddd);
  border-radius: 12px;
  overflow: hidden;
}
.att-row:last-child {
  border-bottom: 0;
}
#att-error {
  color: var(--erro, #bb3535);
  padding: 0 24px;
}
#att-error:empty {
  display: none;
}
@media (max-width: 760px) {
  .att-list {
    margin: 0 16px 16px;
  }
}
.att-compose {
  padding: 16px 20px;
  border-top: 1px solid var(--borda);
  flex-shrink: 0;
}
.att-compose label {
  display: block;
}
.att-compose textarea {
  display: block;
  width: 100%;
  margin: 8px 0;
}
.att-compose > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.att-compose small {
  display: block;
  margin-top: 8px;
  color: var(--texto-secundario);
}
.att-assume {
  margin: 12px 20px;
  flex-shrink: 0;
}
.att-compose[hidden],
.att-assume[hidden] {
  display: none;
}
.att-dialog .att-compose {
  height: auto;
  display: block;
}
.att-dialog .att-compose[hidden] {
  display: none;
}
.att-dialog .drawer-header {
  flex-shrink: 0;
}
@keyframes att-handoff-border { 0%,100% { border-color: #ef8a13; box-shadow: 0 0 0 3px #ef8a1340; } 50% { border-color: transparent; box-shadow: none; } }
.att-row.att-handoff-flash { animation: att-handoff-border 1s ease-in-out 6; }
.att-assisted { padding: 16px; border: 1px solid var(--borda); border-radius: 12px; }
.att-assisted-reply { white-space: pre-wrap; }
.att-assisted-choices { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.att-assisted[hidden], .att-assisted-form[hidden] { display:none; }
@media(prefers-reduced-motion: reduce) { .att-row.att-handoff-flash { animation:none; border-color:#ef8a13; } }

.att-row.att-human-waiting { border: 2px solid #c46a00; background: #fff4de; box-shadow: inset 5px 0 #c46a00; }
.att-human-waiting .att-warning { font-weight: 800; color: #8a4300; }
@keyframes att-menu-pulse { 50% { background-color: #f6a623; color: #241400; } }
#portal-atendimentos.att-human-pending { animation: att-menu-pulse 1.4s ease-in-out infinite; outline: 2px solid #d87c00; }
.human-count { font-size: 11px; font-weight: 800; background: #9b4300; color: white; padding: 3px 6px; border-radius: 8px; }
.human-count[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { #portal-atendimentos.att-human-pending { animation: none; background: #f6a623; color: #241400; } }
