/* Short composited transitions; no artificial minimum loading time. */
.task-mail #layout-content { position: relative; }
.xb-flow-message-area { position: relative; }
.xb-compose-stage { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.xb-flow-pending { visibility: hidden !important; }
.xb-flow-loading, .xb-flow-empty {
  position: absolute; inset: 0; z-index: 12; padding: clamp(18px, 3vw, 32px);
  color: var(--xb-text, #19324d); background: var(--xb-surface, #f8fafc); border-radius: inherit;
}
.xb-flow-loading { overflow: hidden; }
.xb-flow-loading:before {
  content: ''; position: absolute; top: 0; left: 0; width: 35%; height: 2px;
  background: var(--xb-blue-edge, #5798ed); animation: xb-flow-progress 1.25s ease-in-out infinite;
}
.xb-flow-loading-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 32px; }
.xb-flow-label { color: var(--xb-text-2, #536984); font-size: 14px; line-height: 1.6; }
.xb-flow-loading-actions { display: flex; flex: none; gap: 8px; }
.xb-flow-loading button {
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--xb-border, #c8d7e8); border-radius: 8px;
  background: var(--xb-surface, #f8fafc); color: var(--xb-accent-strong, #076bbc); font: 500 13px/1.3 var(--xb-font, sans-serif); cursor: pointer;
}
.xb-flow-loading button:hover { background: var(--xb-soft, #edf3f8); }
.xb-flow-loading button:focus-visible { outline: 2px solid var(--xb-accent-strong, #076bbc); outline-offset: 2px; }
.xb-flow-loading [hidden] { display: none !important; }
.xb-flow-graphic { display: flex; align-items: center; gap: 16px; margin-bottom: 36px; }
.xb-flow-avatar { display: block; width: 44px; height: 44px; border-radius: 14px; flex: none; }
.xb-flow-graphic > div { flex: 1; }
.xb-flow-loading i { display: block; height: 12px; border-radius: 6px; margin: 12px 0; }
.xb-flow-loading i, .xb-flow-avatar { background: var(--xb-soft, #e6edf5); animation: xb-flow-pulse 1.4s ease-in-out infinite; }
.xb-flow-graphic i:first-child { width: 42%; height: 16px; }
.xb-flow-graphic i:last-child { width: 60%; }
.xb-flow-lines { max-width: 740px; }
.xb-flow-lines i { margin: 19px 0; }
.xb-flow-lines i:nth-child(2) { width: 90%; }
.xb-flow-lines i:nth-child(3) { width: 95%; }
.xb-flow-lines i:last-child { width: 65%; }
.xb-flow-compose .xb-flow-avatar { display: none; }
.xb-flow-compose .xb-flow-graphic i { width: 100%; height: 29px; }
.xb-flow-compose .xb-flow-lines { max-width: none; border: 1px solid var(--xb-border, #c8d7e8); border-radius: 10px; padding: 18px; min-height: 160px; }
.xb-flow-slow:before, .xb-flow-slow i, .xb-flow-slow .xb-flow-avatar { animation: none; }
.xb-flow-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 4; }
.xb-flow-empty > span { font-size: 38px; color: var(--xb-text-2, #536984); }
.xb-flow-empty p { margin: 12px 0; color: var(--xb-text-2, #536984); font-size: 14px; }
.xb-flow-busy .xb-topbar { box-shadow: inset 0 3px 0 var(--xb-blue-edge, #5798ed), 0 2px 12px #133a520a !important; }
/* This request already has a visible, announced loading state. Keep errors and confirmations. */
.task-mail:has(.xb-flow-loading) #messagestack .loading { display: none !important; }
.xb-compose-dock { animation: xb-flow-enter 160ms ease-out; }
.xbw-quick-reply { position: relative; }
.xb-reply-stage { position: relative; min-height: 320px; }
.xb-compose-dock-header button:disabled, .xb-reply-controls button:disabled { opacity: .4; cursor: wait; }
@keyframes xb-flow-enter { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes xb-flow-pulse { 50% { opacity: .45; } }
@keyframes xb-flow-progress { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
@media (max-width: 480px) {
  .xb-flow-loading-head { gap: 8px; margin-bottom: 23px; }
  .xb-flow-loading button { min-height: 44px; padding: 8px 11px; }
  .xb-flow-loading-actions { flex-wrap: wrap; max-width: 120px; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .xb-compose-dock, .xb-flow-loading:before, .xb-flow-loading i, .xb-flow-avatar { animation: none !important; }
}
