/* Shared by the pre-React frame and both genuine workspace boot boundaries.
   Static, opaque layout shapes: no invented content, progress or looping motion. */
.workspace-loading {
  --loading-ground: #fafaf9;
  --loading-surface: #ffffff;
  --loading-shape: #e7e5e4;
  --loading-ink: #57534e;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 64px 296px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 8px;
  background: var(--color-bg, var(--loading-ground));
  color: var(--color-text-secondary, var(--loading-ink));
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html[data-theme="dark"] .workspace-loading {
  --loading-ground: #0c0a09;
  --loading-surface: #1c1917;
  --loading-shape: #44403c;
  --loading-ink: #d6d3d1;
}
/* Before main.jsx applies the saved preference, use the device's appearance.
   Once data-theme exists, it is the sole authority, including an explicit light choice. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .workspace-loading {
    --loading-ground: #0c0a09;
    --loading-surface: #1c1917;
    --loading-shape: #44403c;
    --loading-ink: #d6d3d1;
  }
}
.workspace-loading__intro { display: grid; gap: 16px; width: min(18rem, 100%); align-self: center; margin-bottom: 24px; }
.workspace-loading__intro span { height: 20px; border-radius: 6px; background: var(--color-bg-muted, var(--loading-shape)); }
.workspace-loading__intro span:first-child { width: 60%; height: 24px; justify-self: center; }
.workspace-loading__intro span:last-child { height: 44px; border-radius: 12px; }
html[data-startup-surface="workspace"] .workspace-loading__intro { display: none; }
.workspace-loading__rail { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 16px 0; }
.workspace-loading__rail span { width: 32px; height: 32px; border-radius: 10px; background: var(--color-bg-muted, var(--loading-shape)); }
.workspace-loading__list { min-width: 0; padding: 20px 16px; border-radius: 16px; background: var(--color-surface, var(--loading-surface)); }
.workspace-loading__list-head { display: grid; gap: 16px; margin-bottom: 24px; }
.workspace-loading__list-head span { height: 20px; width: 55%; border-radius: 6px; background: var(--color-bg-muted, var(--loading-shape)); }
.workspace-loading__list-head span + span { height: 40px; width: 100%; border-radius: 10px; }
.workspace-loading__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.workspace-loading__row i { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--color-bg-muted, var(--loading-shape)); }
.workspace-loading__row span { width: 65%; height: 12px; border-radius: 5px; background: var(--color-bg-muted, var(--loading-shape)); }
.workspace-loading__row:nth-child(3) span { width: 50%; }
.workspace-loading__content { display: flex; flex-direction: column; min-width: 0; padding: 16px 24px; }
.workspace-loading__header { display: flex; justify-content: space-between; }
.workspace-loading__header span { width: 100px; height: 28px; border-radius: 14px; background: var(--color-bg-muted, var(--loading-shape)); }
.workspace-loading__header span + span { width: 36px; }
.workspace-loading__status { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 28rem; width: 100%; align-self: center; padding: 24px 0; text-align: center; }
.workspace-loading__status h2 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; margin: 0 0 8px; color: inherit; }
.workspace-loading__status p { font-size: 0.9375rem; line-height: 1.5; margin: 4px 0; color: inherit; }
.workspace-loading__input { height: 84px; max-width: 760px; width: 100%; align-self: center; border: 1px solid var(--color-bg-muted, var(--loading-shape)); border-radius: 24px; background: var(--color-surface, var(--loading-surface)); }
.workspace-loading__mobile-navigation { display: none; }
@media (max-width: 768px) {
  .workspace-loading { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(160px, 1fr) auto; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
  .workspace-loading__rail, .workspace-loading__header, .workspace-loading__input { display: none; }
  .workspace-loading__list { background: transparent; padding: 8px 0; }
  .workspace-loading__list-head span { width: 36%; }
  .workspace-loading__list-head span + span { width: 100%; }
  .workspace-loading__content { padding: 0 16px; }
  .workspace-loading__mobile-navigation { display: flex; justify-content: space-around; padding: 16px; border-radius: 24px; background: var(--color-surface, var(--loading-surface)); }
  .workspace-loading__mobile-navigation span { width: 32px; height: 32px; border-radius: 10px; background: var(--color-bg-muted, var(--loading-shape)); }
}
/* The shared HTML serves both hosts. Workspace chrome may only appear after
   main.jsx positively selects that surface; before JS, show the neutral intro. */
html:not([data-startup-surface="workspace"]) .workspace-loading { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(160px, 1fr); }
html:not([data-startup-surface="workspace"]) .workspace-loading__rail,
html:not([data-startup-surface="workspace"]) .workspace-loading__list,
html:not([data-startup-surface="workspace"]) .workspace-loading__header,
html:not([data-startup-surface="workspace"]) .workspace-loading__input,
html:not([data-startup-surface="workspace"]) .workspace-loading__mobile-navigation { display: none; }
