.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.presenceBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.presenceEmpty {
  font-size: 12px;
  color: rgb(var(--color-text-500));
}

.userChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgb(var(--color-border-200));
  background: rgb(var(--color-card));
  color: rgb(var(--color-text-700));
  font-size: 12px;
  font-weight: 500;
}

.statusBar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.connectionStatus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgb(var(--color-text-600));
}

.statusDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgb(var(--color-border-300));
}

.connectionStatus[data-status='connected'] .statusDot {
  background: rgb(var(--color-success-500));
}

.connectionStatus[data-status='connecting'] .statusDot {
  background: rgb(var(--color-warning-500));
}

.connectionStatus[data-status='disconnected'] .statusDot {
  background: rgb(var(--color-danger-500));
}

.saveStatus {
  font-size: 12px;
  color: rgb(var(--color-text-500));
}

.editorContainer :global(.ProseMirror) p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: rgb(var(--color-text-400));
  pointer-events: none;
  height: 0;
}

.editorContainer :global(.ProseMirror) a {
  color: rgb(var(--badge-info-text));
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgb(var(--badge-info-text) / 0.4);
  text-underline-offset: 2px;
  cursor: pointer;
}

.editorContainer :global(.ProseMirror) a:hover {
  text-decoration-color: rgb(var(--badge-info-text));
}

/* ── AI Response Block (streaming container) ─────────────────── */

.editorContainer :global(.ai-response-block) {
  position: relative;
  margin: 12px 0;
  padding: 12px 16px 12px 16px;
  border-left: 3px solid rgb(var(--color-primary-400, 139 92 246));
  border-radius: 6px;
  background: rgb(var(--color-primary-50, 245 243 255) / 0.4);
}

.editorContainer :global(.ai-response-block__header) {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgb(var(--color-border-200, 226 232 240) / 0.6);
}

.editorContainer :global(.ai-response-block__label) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgb(var(--color-primary-600, 124 58 237));
  user-select: none;
}

.editorContainer :global(.ai-response-block__icon) {
  width: 14px;
  height: 14px;
}

.editorContainer :global(.ai-response-block__streaming-dot) {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--color-primary-500, 139 92 246));
  animation: ai-pulse 1.4s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.editorContainer :global(.ai-response-block__content) {
  /* Content inherits document styles naturally */
}

.editorContainer :global(.collaboration-caret) {
  position: relative;
  border-left: 2px solid;
  margin-left: -1px;
  margin-right: -1px;
}

.editorContainer :global(.collaboration-caret__label) {
  position: absolute;
  bottom: 100%;
  left: -1px;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
