/* First run, the vault, unlock, start over, the other-tab page and the door's own states (loading, cannot start,
   erased): one panel on the frame's stage (.w-stage, .w-panel in frame.css), without the rail (the canvas "MeshLink
   Web Screens", boards start-*, unlock*, vault-*, elsewhere, erased, loading, cannot-start).
   Every colour, size and type style is a token from design/tokens.json (tokens.css, written by
   `tools/keel gen-tokens`); no literal where a variable exists. Logical properties only. Loaded in index.html's order:
   frame, start, chats, conversation, media, contact, calls, settings. */

/* The stage scrolls when the window is shorter than the panel; the panel stays centred while it fits. */
.start-stage { display: flex; overflow-y: auto; }
.start-stage > .start-panel { margin: auto; }
.start-panel .illo { align-self: center; }
/* Start over, erased, loading, cannot start: everything centred; a note card keeps its words at the start. */
.start-center { align-items: center; text-align: center; }
.start-center .start-note { text-align: start; }
/* Loading stands on the stage itself, with no card around it. */
.start-panel[aria-busy="true"] { background: transparent; box-shadow: none; }

/* The brand: the app's mark (the rail's, without its gap below) and the name. */
.start-brand { display: flex; align-items: center; gap: var(--space-3); }
.start-brand .w-rail__mark { margin: 0; }
.start-brand__name { font: var(--headline-weight) var(--brand-size) / var(--brand-line) var(--brand-family); letter-spacing: var(--brand-tracking); }

/* Steps 2 and 3: Back at the start, "2 of 3" at the end. */
.start-top { display: flex; align-items: center; justify-content: space-between; }
.start-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: none;
  background: none;
  font: var(--callout-strong-weight) var(--body-size) / var(--body-line) var(--body-family);
}
.start-step { font: var(--callout-strong-weight) var(--callout-size) / var(--callout-line) var(--callout-family); color: var(--ink-muted); }

/* Welcome's step dots: the current one long and mesh. */
.start-dots { display: flex; align-items: center; gap: var(--space-2); }
.start-dot { inline-size: var(--space-2); block-size: var(--space-2); border-radius: var(--radius-pill); background: var(--line-strong); }
.start-dot[aria-current] { inline-size: var(--space-5); background: var(--mesh); }
.start-private { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }

/* Step 2: the face is a plain disc (no photo in version 1). */
.start-face { align-self: center; }

/* A field's hint line; the counter keeps its digits still. An empty hint takes no room. */
.start-hint { margin: 0; }
.start-hint:empty { display: none; }
.start-problem { display: inline-flex; align-items: center; gap: var(--space-1); }
.start-problem .icon { flex: none; }
.counter { font-variant-numeric: tabular-nums; }

/* A note on the panel: the lock in ink-muted, then the words in ink (boards start-name, start-over). */
.start-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2-half);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--ink);
  font: var(--callout-weight) var(--callout-size) / var(--callout-line) var(--callout-family);
}
.start-note .icon { flex: none; color: var(--ink-muted); }

/* Loading: a ring in mesh-tint with a mesh arc, turning unless reduced motion is asked for. */
.start-spin {
  display: block;
  inline-size: calc(var(--space-5) + var(--space-1));
  block-size: calc(var(--space-5) + var(--space-1));
  border: 3px solid var(--mesh-tint);
  border-block-start-color: var(--mesh);
  border-radius: var(--radius-pill);
}
@media (prefers-reduced-motion: no-preference) {
  .start-spin { animation: start-spin calc(3 * var(--duration-slow)) linear infinite; }
  @keyframes start-spin { to { transform: rotate(1turn); } }
}

/* The frame's own loading state (shell.tsx draws an empty `main.onboarding` while the core opens): the stage with the
   same ring in its middle. */
.onboarding { display: grid; place-items: center; block-size: 100%; background: var(--surface); }
.onboarding[aria-busy="true"]::before {
  content: "";
  inline-size: calc(var(--space-5) + var(--space-1));
  block-size: calc(var(--space-5) + var(--space-1));
  border: 3px solid var(--mesh-tint);
  border-block-start-color: var(--mesh);
  border-radius: var(--radius-pill);
}
@media (prefers-reduced-motion: no-preference) {
  .onboarding[aria-busy="true"]::before { animation: start-spin calc(3 * var(--duration-slow)) linear infinite; }
}

/* R321's invite code (boards start-invite, start-invite-wrong): the field in the mono face. */
.start-code .w-input { font-family: var(--font-mono); }
