/* Approved loader 01. Only real pending states; ambient media has no loader. */
:root{--crm-loader-color:#176b55;--crm-loader-image:url('../shared/loader-01-normal.svg')}
html:is([data-ui-mode="atmosphere"],[data-ui-mode="watersphere"]),[data-ui-mode="atmosphere"],[data-ui-mode="watersphere"]{--crm-loader-color:#c2dfb8;--crm-loader-image:url('../shared/loader-01-atmosphere.svg')}
.crm-loading-state{box-sizing:border-box;min-height:132px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;width:100%;margin:0;padding:16px;color:var(--text-primary,var(--text,#17212b));background:transparent;border:0;box-shadow:none}
.crm-loading-state__text{color:inherit;font-size:12px;font-weight:400;line-height:1.4;text-align:center}
.crm-loader01{box-sizing:border-box;position:relative;display:inline-block;width:64px;height:64px;flex:0 0 64px;isolation:isolate;color:var(--crm-loader-color);pointer-events:none}
.crm-loader01::before{content:'';position:absolute;inset:2px;border:1px solid currentColor;border-radius:50%;opacity:.13}
.crm-loader01__arc{position:absolute;inset:0;width:64px;height:64px;fill:none;stroke:currentColor;stroke-width:1.6;animation:crm-loader01-spin 1.7s linear infinite}
.crm-loader01__arc circle{transition:stroke-dasharray 140ms linear}
.crm-loader01__core,.crm-loader01__wave{position:absolute;display:block;border-radius:50%;box-sizing:border-box}
.crm-loader01__core{width:10px;height:10px;left:27px;top:27px;background:currentColor;transform:scale(.3);animation:crm-loader01-core 2.4s ease-in-out infinite}
.crm-loader01__wave{inset:2px;border:1.5px solid currentColor;opacity:0;transform:scale(.166667);animation:crm-loader01-wave 2.4s linear infinite}
@keyframes crm-loader01-spin{to{transform:rotate(360deg)}}
@keyframes crm-loader01-core{0%,12%,68%,100%{transform:scale(.3);opacity:.65}38%{transform:scale(1);opacity:1}}
@keyframes crm-loader01-wave{0%,37%{transform:scale(.166667);opacity:0}38%{transform:scale(.166667);opacity:.65}92%,100%{transform:scale(1);opacity:0}}
html :is(.bichmi-v2__boot:not(.is-error), .bichmi-v2__state:not(.is-error), .bichmi-v2__empty.is-loading, .workspace-loading.is-loading, .workspace-task-chat-loading, .co-query-state:not(.co-query-error), .fleet-message.is-loading, .journal-empty.is-loading, .dm-empty.is-loading, .request-progress-empty.is-loading, .dispatcher-route-sheet-panel.is-loading, .dispatcher-trip-panel.is-loading, [aria-busy="true"] .co-empty--compact, .dispatcher-v2__async.is-loading, .mtk-daily__message.is-loading){box-sizing:border-box;position:relative;min-height:112px;padding:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center}
html :is(.bichmi-v2__boot:not(.is-error), .bichmi-v2__state:not(.is-error), .bichmi-v2__empty.is-loading, .workspace-loading.is-loading, .workspace-task-chat-loading, .co-query-state:not(.co-query-error), .fleet-message.is-loading, .journal-empty.is-loading, .dm-empty.is-loading, .request-progress-empty.is-loading, .dispatcher-route-sheet-panel.is-loading, .dispatcher-trip-panel.is-loading, [aria-busy="true"] .co-empty--compact, .dispatcher-v2__async.is-loading, .mtk-daily__message.is-loading)::before{content:'';display:block;position:static;flex:0 0 64px;width:64px;height:64px;margin:0 auto;background:var(--crm-loader-image) center/64px 64px no-repeat;border:0;box-shadow:none;animation:none;pointer-events:none}
html :is(.bichmi-v2__boot:not(.is-error), .bichmi-v2__state:not(.is-error), .bichmi-v2__empty.is-loading, .workspace-loading.is-loading, .workspace-task-chat-loading, .co-query-state:not(.co-query-error), .fleet-message.is-loading, .journal-empty.is-loading, .dm-empty.is-loading, .request-progress-empty.is-loading, .dispatcher-route-sheet-panel.is-loading, .dispatcher-trip-panel.is-loading, [aria-busy="true"] .co-empty--compact, .dispatcher-v2__async.is-loading, .mtk-daily__message.is-loading)::after{content:none}
.bichmi-react-shell>.crm-loading-state{position:absolute;inset:0;z-index:1;min-height:0;margin:0}
html .bichmi-v2__boot:not(.is-error){flex:1 1 auto;width:100%;height:100%;min-height:0}
html .bichmi-v2__chat>.bichmi-v2__state:not(.is-error){flex:1 1 0;min-height:0;width:100%}
html .workspace-task-chat-loading{width:100%;height:100%;margin:0}
.crm-loader01--compact{width:32px;height:32px;flex-basis:32px}
.crm-loader01--compact .crm-loader01__arc{width:32px;height:32px}
.crm-loader01--compact .crm-loader01__core{width:5px;height:5px;left:13.5px;top:13.5px}
.crm-loader01--compact .crm-loader01__wave,.crm-loader01--compact::before{inset:1px}
.bichmi-v2__upload .crm-loader01{position:relative!important;inset:auto!important;display:block;flex:0 0 32px;min-width:32px;align-self:center;margin-right:8px;background:none!important;box-shadow:none!important;border:0!important}
@media(prefers-reduced-motion:reduce){.crm-loader01 *{animation:none!important;transition:none!important}.crm-loader01__wave{display:none}.crm-loader01__core{transform:scale(.5);opacity:.8}}

/* Existing ambient background rules retained verbatim. */
.farm-game-virtual-stage__image { transition: opacity .28s ease; }
.farm-game-virtual-stage__image:not([data-image-ready="true"]) { opacity: 0 !important; }
.farm-game-virtual-stage__preview {
  position: absolute;
  inset: 0;
  display: block;
  width: 2560px;
  height: 1440px;
  max-width: none;
  opacity: 0;
  user-select: none;
  pointer-events: none;
  transition: opacity .28s ease;
}
.farm-game-virtual-stage__preview[data-preview-ready="true"] { opacity: 1; }
.kingdom-background__poster { transition: opacity .28s ease; }
.kingdom-background__poster:not([data-poster-ready="true"]) { opacity: 0 !important; }

/* A completed video poster remains visible while the optional motion stream waits. */
.atmosphere-background__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 320ms ease;
}
.atmosphere-background[data-poster-ready="true"] .atmosphere-background__poster { opacity: 1; }
@media (max-aspect-ratio: 4 / 3) { .atmosphere-background__poster { object-position: 52% center; } }
@media (max-width: 900px) { .atmosphere-background__poster { object-position: 57% center; } }
@media (max-width: 640px) { .atmosphere-background__poster { object-position: 61% center; } }

/* Stable initial frame across module, conversation and message phases. */
.bichmi-initial-frame{position:relative;display:flex;flex:1 1 auto;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden}
.bichmi-initial-frame>.bichmi-v2{flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}
.bichmi-initial-frame>.crm-chat-initial-loading{position:absolute;inset:0;z-index:4;width:100%;height:100%;min-height:0;pointer-events:none}
.bichmi-initial-frame[data-initial-loading=true] .bichmi-v2__boot:not(.is-error),.bichmi-initial-frame[data-initial-loading=true] .bichmi-v2__state:not(.is-error){visibility:hidden}
.crm-loading-state__text{min-height:34px;max-width:28em}
.bichmi-live-page>.crm-loading-state{height:100%;min-height:0;flex:1 1 auto}
#crm-root>.crm-loading-state{height:100dvh;min-height:0}
