/* Loading retains the shell's geometry; skeletons only describe the known list. */
.state-loading, #app > .loading { min-height: calc(100dvh - 160px); }
/* Also cover the static HTML while classic scripts are still loading. */
#app > .loading::before { content: ''; display: inline-block; width: 20px; height: 20px; margin-right: 8px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: state-spin 0.8s linear infinite; }
/* Match the real shell's intrinsic brand/Back geometry, including text size
   and safe areas; four cells match the loaded tab grid at every viewport. */
#topbar:empty { min-height: calc(32px + 1.1rem + env(safe-area-inset-top, 0px)); }
#tabbar:empty { min-height: calc(var(--tab-h) + 1px + env(safe-area-inset-bottom, 0px)); }
.tabbar .state-nav-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; height: var(--tab-h); width: 100%; min-width: 0; font-size: .7rem; font-weight: 600; color: var(--muted); }
@media (max-width: 359px) { .tabbar .state-nav-placeholder { font-size: .64rem; } }
.state-spinner { display: inline-block; width: 20px; height: 20px; margin-inline-end: 8px; vertical-align: middle; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: state-spin 0.8s linear infinite; }
.state-skeleton > div { height: 32px; width: 60%; margin: 24px 0; border-radius: 8px; background: var(--line, #ddd); }
.state-skeleton article { min-height: 144px; margin: 16px 0; border-radius: 12px; background: var(--card); border: 1px solid var(--line, #ddd); }
.state-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.state-actions .btn, .state-refresh .btn { min-height: 44px; white-space: normal; }
#banner [data-state][hidden] { display: none; }
.state-save { padding: 8px 16px; font-size: 0.875rem; }
.state-recovery { display: block; padding: 16px; }
.state-recovery textarea { display: block; width: 100%; min-height: 160px; }
.banner-slot { overflow-wrap: anywhere; }
/* Scroll is explicitly restored by the renderer/resume code. Native anchoring
   must not then move it when the background status above main changes height. */
#app, #banner { overflow-anchor: none; }
@keyframes state-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .state-spinner, #app > .loading::before { animation: none; } }
@media (prefers-color-scheme: dark) { .state-skeleton article { background: var(--card); } .state-skeleton > div { background: var(--line); } }
