.remote-web-chat {
  position: absolute;
  inset-inline-end: var(--ui-space-3);
  inset-block-end: calc(var(--safe-bottom) + var(--ui-space-3));
  z-index: var(--ui-z-overlay);
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-2);
  inline-size: min(var(--dt-dimension-layout-400), calc(100% - var(--ui-space-6)));
  block-size: var(--dt-dimension-layout-440);
  max-block-size: calc(100% - var(--ui-control-h-standard) - var(--ui-space-6));
  min-inline-size: 0;
  overflow: hidden;
  padding: var(--ui-space-3);
  border: var(--ui-stroke-thin) solid var(--ux-divider, var(--border));
  border-radius: var(--ui-radius-panel, var(--radius));
  background: var(--ux-overlay, var(--surface));
  color: var(--ui-text-primary);
  box-shadow: var(--ui-shadow-lg);
}
.remote-web-chat-head,
.remote-web-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-2);
  min-inline-size: 0;
}
.remote-web-chat-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-web-chat-head button,
.remote-web-chat-actions button { flex: 0 0 auto; }
.remote-web-chat-messages {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: var(--ui-space-2);
  min-block-size: 0;
  min-inline-size: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: var(--ui-space-1);
}
.remote-web-chat-messages [data-chat-empty] {
  color: var(--ui-text-muted, var(--muted));
  padding: var(--ui-space-2);
}
.remote-web-chat-message {
  flex: 0 0 auto;
  min-inline-size: 0;
  padding: var(--ui-space-2);
  border-radius: var(--ui-radius-control, var(--radius));
  background: var(--ux-raised, var(--surface-2));
}
.remote-web-chat-message.is-me { border-inline-start: var(--ui-stroke-thick) solid var(--ui-accent, var(--accent)); }
.remote-web-chat-message p { margin: var(--ui-space-1) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.remote-web-chat-message strong,
.remote-web-chat-status { font-size: var(--fs-caption); }
.remote-web-chat-status { color: var(--ui-text-muted, var(--muted)); }
.remote-web-chat-message[data-status="failed"] .remote-web-chat-status { color: var(--ui-danger, var(--danger)); }
.remote-web-chat-form { display: flex; flex-direction: column; flex: 0 0 auto; gap: var(--ui-space-2); min-inline-size: 0; }
.remote-web-chat-form .web-field { margin: 0; min-inline-size: 0; }
.remote-web-chat-form textarea { resize: vertical; max-block-size: var(--dt-dimension-layout-240); }
.remote-web-chat .form-note { margin: 0; }
