/* Editor motion: local feedback only; text, selection and layout stay still. */
.bc-root {
  --bc-motion-control: 120ms;
  --bc-motion-reveal: 180ms;
  --bc-motion-panel: 220ms;
  --bc-motion-enter: cubic-bezier(.2, .7, .2, 1);
}

.bc-open .bc-composer :is(button, input[type="submit"], select, .bc-generate-prompt),
.bc-open .bc-wysiwyg {
  transition: background-color var(--bc-motion-control) ease-out,
              border-color var(--bc-motion-control) ease-out,
              color var(--bc-motion-control) ease-out;
}

/* No grid cascades: searching and inserting an emoji are immediate. */
.bc-open :is(.bc-emoji-menu, .bc-emoji-tone-options):not([hidden]) {
  animation: bc-editor-panel-in var(--bc-motion-reveal) var(--bc-motion-enter);
}
.bc-open .bc-image-panel:not([hidden]) {
  animation: bc-editor-panel-in var(--bc-motion-panel) var(--bc-motion-enter);
}
.bc-open :is(.bc-publish-preview, .bc-writing-suggestion, .bc-reply-context, .bc-generated-actions):not([hidden]),
.bc-open .bc-writing-tools[open] > :not(summary),
.bc-open .bc-composer .bc-inline-error:not([hidden]),
.bc-open [data-controller~="community-draft"] > .bc-inline-error:not([hidden]),
.bc-open .bc-editor-image-ready {
  animation: bc-editor-reveal var(--bc-motion-reveal) ease-out;
}

.bc-open .bc-draft-status { min-block-size: 24px; }
.bc-open .bc-draft-status::before {
  flex: 0 0 8px;
  inline-size: 8px;
  block-size: 8px;
  transition: background-color var(--bc-motion-control) ease-out;
}
.bc-open .bc-draft-status[data-state="pending"]::before { background: #827b46; }
.bc-open .bc-draft-status[data-state="error"]::before { background: #a4452c; }
.bc-open .bc-draft-status[data-state="saving"]::before,
.bc-open :is(.bc-generation-status, .bc-writing-status)[data-busy="true"]:not([hidden])::before {
  box-sizing: border-box;
  border: 1.5px solid var(--bc-line);
  border-block-start-color: #728331;
  border-radius: 50%;
  background: transparent;
  animation: bc-editor-wait 900ms linear 250ms infinite;
}
.bc-open :is(.bc-generation-status, .bc-writing-status)[data-busy="true"]:not([hidden])::before {
  content: "";
  display: inline-block;
  inline-size: 12px;
  block-size: 12px;
  margin-inline-end: 8px;
  vertical-align: -1px;
}
.bc-open .bc-writing-status { color: var(--bc-muted); font-size: 13px; }

@keyframes bc-editor-panel-in {
  from { opacity: .4; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bc-editor-reveal {
  from { opacity: .6; }
  to { opacity: 1; }
}
@keyframes bc-editor-wait { to { transform: rotate(360deg); } }

/* Local translation feedback. The readable original never fades out. */
.bc-translation-status.is-loading::before {
  content: "";
  display: inline-block;
  inline-size: 10px;
  block-size: 10px;
  margin-inline-end: 7px;
  border: 1.5px solid var(--bc-line);
  border-block-start-color: #728331;
  border-radius: 50%;
  vertical-align: -1px;
  animation: bc-translation-wait 900ms linear infinite;
}
.bc-translation-arriving { animation: bc-translation-arrive 180ms ease-out; }
@keyframes bc-translation-wait { to { transform: rotate(360deg); } }
@keyframes bc-translation-arrive { from { opacity: .65; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .bc-open .bc-composer *, .bc-open .bc-composer *::before,
  .bc-open .bc-draft-status, .bc-open .bc-draft-status::before,
  .bc-open .bc-reply-context {
    animation: none !important;
    transition: none !important;
  }
  .bc-translation-status.is-loading::before, .bc-translation-arriving { animation: none; }
}
