/* Loading layers are portalled to body so a panel can redraw without losing its status. */
/* Menu changes use a stable outgoing snapshot and switch directly to the ready page. */
@view-transition { navigation:auto; }
::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation:none; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode:normal; }
html[data-ch-silent-menu]:not([data-ch-menu-ready])::view-transition-old(root) { animation:ch-menu-hold 2.5s step-end both; }
html[data-ch-silent-menu]:not([data-ch-menu-ready])::view-transition-new(root) { animation:ch-menu-wait 2.5s step-end both; }
@keyframes ch-menu-hold { from,to { opacity:1; } }
@keyframes ch-menu-wait { from,to { opacity:0; } }
.ch-loading-layer { position:fixed; z-index:1090; box-sizing:border-box; display:flex; align-items:center; justify-content:center; padding:8px; overflow:hidden; font-family:'Noto Sans Thai',system-ui,sans-serif; color:#0f172a; }
.ch-loading-layer[hidden] { display:none !important; }
/* Navigation keeps the current page visible, with a small delayed status only. */
.ch-loading-page { z-index:20000; background:transparent; pointer-events:none; align-items:flex-start; justify-content:flex-end; padding:10px 12px; }
.ch-loading-page::before { content:''; position:absolute; top:0; left:0; width:30%; height:3px; background:#ea580c; animation:ch-navigation-slide 1.2s ease-in-out infinite; }
.ch-loading-page .ch-loading-card { max-width:min(360px,85%); padding:6px 10px; gap:6px; font-size:.8rem; }
.ch-loading-scope { background:rgba(248,250,252,.82); cursor:progress; }
.ch-loading-card { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:10px; max-width:min(420px,100%); padding:12px 16px; border:1px solid #dbe3ec; border-radius:12px; background:#fff; box-shadow:0 5px 20px #0f172a16; font-size:.875rem; line-height:1.5; overflow-wrap:anywhere; text-align:center; }
.ch-loading-spinner.spinner-border { display:inline-block; width:18px; height:18px; flex:none; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; color:#ea580c; vertical-align:middle; animation:ch-loading-spin .75s linear infinite; }
.ch-loading-label { min-width:0; }
.ch-loading-status { justify-content:flex-end; pointer-events:none; }
.ch-loading-status .ch-loading-card { padding:8px 12px; }
.ch-loading-retry { z-index:1095; align-items:flex-start; justify-content:center; pointer-events:none; }
.ch-loading-retry .ch-loading-card { pointer-events:auto; border-color:#f5c6b3; background:#fff7ed; }
.ch-loading-retry .ch-loading-card > span { flex:1 1 100%; }
.ch-loading-retry-button,.ch-loading-dismiss { border:1px solid #ea580c; border-radius:8px; padding:6px 12px; background:#ea580c; color:#fff; font:inherit; cursor:pointer; }
.ch-loading-dismiss { background:#fff; border-color:#cbd5e1; color:#475569; }
.ch-loading-retry-button:focus-visible,.ch-loading-dismiss:focus-visible { outline:3px solid #fdba74; outline-offset:2px; }
.btn .ch-loading-spinner { color:inherit; }
@keyframes ch-loading-spin { to { transform:rotate(360deg); } }
@keyframes ch-navigation-slide { from { transform:translateX(-100%); } to { transform:translateX(340%); } }
@media (prefers-reduced-motion:reduce) { .ch-loading-spinner.spinner-border { animation-duration:1.8s; } .ch-loading-page::before { animation:none; width:100%; } }
@media print { .ch-loading-layer { display:none !important; } }
