.dai-widget {
  background: var(--ph-surface, #fff);
  border: 1px solid var(--ph-border, rgba(0, 0, 0, .08));
  border-radius: var(--ph-radius, 14px);
  overflow: hidden;
  margin-bottom: 28px;
}
.dai-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ph-border, rgba(0, 0, 0, .08));
}
.dai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #27b589, #1D9E75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dai-title { font-size: 14px; font-weight: 700; color: var(--ph-text, #1a1a2e); }
.dai-status { font-size: 12px; color: #1D9E75; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.dai-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #1D9E75; }
.dai-status.offline { color: var(--ph-muted, #6c757d); }
.dai-status.offline::before { background: var(--ph-muted, #6c757d); }

.dai-body {
  padding: 16px 20px;
  min-height: 160px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ph-bg, #f4f6f9);
}
.dai-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
}
.dai-msg.bot {
  background: var(--ph-surface, #fff);
  border: 1px solid var(--ph-border, rgba(0, 0, 0, .08));
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  color: var(--ph-text, #1a1a2e);
}
.dai-msg.user {
  background: #1D9E75;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.dai-msg.error {
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .3);
  color: #b91c1c;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.dai-msg.error .dai-ticket-ref {
  display: block;
  margin-top: 6px;
  font-weight: 700;
  font-size: 12px;
}

.dai-typing {
  display: flex;
  gap: 4px;
  padding: 9px 13px;
  background: var(--ph-surface, #fff);
  border: 1px solid var(--ph-border, rgba(0, 0, 0, .08));
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
  width: fit-content;
}
.dai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ph-muted, #6c757d);
  animation: daiBounce 1.1s infinite ease-in-out;
}
.dai-typing span:nth-child(2) { animation-delay: .15s; }
.dai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes daiBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.dai-form {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--ph-border, rgba(0, 0, 0, .08));
  background: var(--ph-surface, #fff);
}
.dai-input {
  flex: 1;
  background: var(--ph-surface2, #e8f7f2);
  border: 1px solid var(--ph-border, rgba(0, 0, 0, .08));
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ph-text, #1a1a2e);
}
.dai-input:focus { outline: none; border-color: #1D9E75; }
.dai-input:disabled { opacity: .6; }
.dai-send {
  background: #1D9E75;
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.dai-send:hover { background: #27b589; }
.dai-send:disabled { opacity: .5; cursor: not-allowed; }

.dai-login-nudge {
  padding: 18px 20px;
  font-size: 13.5px;
  color: var(--ph-muted, #6c757d);
  text-align: center;
}
.dai-login-nudge a { color: #1D9E75; font-weight: 600; text-decoration: none; }
.dai-login-nudge a:hover { text-decoration: underline; }
