/* Scoped to pending regions. The completed interface keeps its existing layout. */
.loading-announcement {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.is-skeleton-loading { position: relative; isolation: isolate; }
.is-skeleton-loading > :not(.skeleton-layer) { visibility: hidden !important; }
.skeleton-layer {
  position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column;
  gap: 20px; padding: inherit; overflow: hidden; border-radius: inherit;
  background: var(--surface); pointer-events: none; user-select: none;
}
.skeleton-block {
  position: relative; display: block; flex: none; overflow: hidden;
  max-width: 100%; border-radius: 6px; background: #eaf0fb;
}
.skeleton-block::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 15%, #ffffffa6 50%, transparent 85%);
  transform: translateX(-100%); animation: skeleton-sheen 1.8s ease-in-out 3;
}
.skeleton-stack { display: flex; flex-direction: column; min-width: 0; gap: 10px; }
.skeleton-line { width: 56%; height: 12px; }
.skeleton-title { width: 46%; height: 19px; }
.skeleton-long { width: 76%; }
.skeleton-short { width: 30%; }
.skeleton-full { width: 100%; }
.skeleton-heading { gap: 11px; padding-block: 2px; }
.skeleton-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.skeleton-chart-header > .skeleton-heading { flex: 1; }
.skeleton-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.skeleton-row > .skeleton-stack { flex: 1; }
.skeleton-circle { width: 36px; height: 36px; border-radius: 50%; }
.skeleton-reading { width: 42px; height: 20px; }
.skeleton-rows { gap: 10px; }
.skeleton-rows > .skeleton-row { min-height: 52px; padding: 10px 12px; border: 1px solid #edf0f8; border-radius: 12px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-account { height: 100%; }
.skeleton-account .skeleton-title { width: 62%; height: 15px; }
.skeleton-account .skeleton-long { width: 82%; height: 10px; }
.skeleton-number { width: 40px; height: 29px; }
.skeleton-large-number { width: 116px; height: 44px; border-radius: 8px; }
.skeleton-select { width: min(215px, 100%); height: 40px; border-radius: 8px; }
.skeleton-input { width: 100%; height: 44px; border-radius: 8px; }
.skeleton-field { gap: 12px; padding-top: 16px; border-top: 1px solid #edf0f8; }
.skeleton-range { width: 100%; height: 10px; border-radius: 8px; }
.skeleton-plot {
  position: relative; flex: 1; min-height: 180px; border-left: 1px solid #e3e8f3;
  border-bottom: 1px solid #e3e8f3;
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #edf0f7 calc(25% - 1px), #edf0f7 25%);
}
.skeleton-plot-band { position: absolute; inset: 22% 0 18%; background: #f0f3fd; border-radius: 8px; }
.skeleton-legend { display: flex; align-items: center; gap: 20px; }
.skeleton-legend > span { width: 100px; height: 10px; }
.skeleton-month { width: 110px; height: 15px; align-self: center; margin-block: 12px; }
.skeleton-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; align-content: space-around; flex: 1; gap: 18px 10px; }
.skeleton-day { width: 23px; height: 16px; border-radius: 5px; }

[data-skeleton="value"].is-skeleton-loading { display: inline-block; width: 40px; min-width: 40px; min-height: 30px; justify-self: start; color: transparent !important; border-radius: 6px; background: #eaf0fb; }
[data-skeleton="value"] > .skeleton-layer { justify-content: center; padding: 0; background: var(--surface); }
[data-skeleton="chart"].is-skeleton-loading { min-height: 430px; }
[data-skeleton="chart"] > .skeleton-layer { gap: 18px; }
[data-skeleton="rows"].is-skeleton-loading { min-height: 304px; }
[data-skeleton="calendar"].is-skeleton-loading { min-height: 536px; }
[data-skeleton="form"].is-skeleton-loading { min-height: 475px; }
[data-skeleton="picker"].is-skeleton-loading { min-height: 440px; }
[data-skeleton="summary"].is-skeleton-loading { min-height: 280px; }
.dashboard-ai-paper.is-skeleton-loading { min-height: 197px; }
.dashboard-ai-paper > .skeleton-layer { gap: 17px; }
.catalog-content.is-skeleton-loading { min-height: 440px; }
.catalog-content > .skeleton-layer { padding: 24px; border: 1px solid var(--soft-border); border-radius: 18px; }
.report-progress:has(.report-result-skeleton.is-skeleton-loading) { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.report-progress > #report-progress-text { grid-area: 1 / 1; }
.report-progress > #report-cancel { grid-area: 1 / 2; align-self: start; }
.report-result-skeleton { grid-area: 2 / 1 / 3 / -1; width: 100%; min-height: 198px; }
.report-result-skeleton:not(.is-skeleton-loading) { display: none; }
.report-result-skeleton > .skeleton-layer { padding: 0; }
.mobile-trends > .skeleton-layer { padding: 0; background: var(--canvas); }
#workspace-account.is-skeleton-loading { width: 274px; min-height: 50px; border: 1px solid var(--soft-border); border-radius: 12px; }
#workspace-account > .skeleton-layer { padding: 6px 12px; gap: 0; }
#workspace-account .skeleton-avatar { width: 36px; height: 36px; }

/* Reserve the member layout without flashing sign-in prompts during the request. */
.is-account-loading :is(#history-guest, #settings-guest-account, #details-empty) { display: none !important; }
.is-account-loading #history-results-panel { display: block !important; }
.is-account-loading #settings-member-account { display: flex !important; min-height: 104px; }
.is-account-loading #settings-profile-card { display: block !important; }
.is-account-loading #history-timeline { display: block !important; min-height: 304px; border-radius: 16px; }
#history-timeline > .skeleton-layer { padding: 20px; }
.is-account-loading #details-content { display: grid !important; }
.is-account-loading #details :is(#details-edit, #details-delete) { visibility: hidden; }

@keyframes skeleton-sheen { to { transform: translateX(100%); } }
@media (max-width: 680px) {
  .skeleton-layer { gap: 16px; }
  .skeleton-title { height: 17px; width: 58%; }
  .skeleton-line { height: 11px; }
  .skeleton-number { width: 34px; height: 26px; }
  [data-skeleton="value"].is-skeleton-loading { width: 34px; min-width: 34px; min-height: 34px; }
  [data-skeleton="chart"].is-skeleton-loading { min-height: 350px; }
  [data-skeleton="calendar"].is-skeleton-loading { min-height: 390px; }
  [data-skeleton="rows"].is-skeleton-loading { min-height: 280px; }
  [data-skeleton="form"].is-skeleton-loading { min-height: 440px; }
  .skeleton-plot { min-height: 170px; }
  .skeleton-select { width: 100%; }
  .skeleton-chart-header { flex-direction: column; align-items: stretch; gap: 20px; }
  .skeleton-calendar { gap: 14px 6px; }
  .skeleton-day { width: 19px; height: 14px; }
  .skeleton-rows > .skeleton-row { min-height: 50px; padding: 9px 10px; }
  .is-account-loading #settings-member-account { min-height: 96px; }
  .is-account-loading #history-timeline { min-height: 280px; }
  #history-timeline > .skeleton-layer { padding: 16px; }
  .catalog-content > .skeleton-layer { padding: 16px; border-radius: 16px; }
  .report-result-skeleton { min-height: 192px; }
  .report-progress:has(.report-result-skeleton.is-skeleton-loading) { grid-template-columns: minmax(0, 1fr); }
  .report-progress > #report-cancel { grid-area: 2 / 1; justify-self: start; }
  .report-result-skeleton { grid-area: 3 / 1; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-block::after { animation: none; background: none; }
}
@media (forced-colors: active) {
  .skeleton-block { background: Canvas; border: 1px solid GrayText; }
  .skeleton-block::after { display: none; }
}
