/* Placeholders for everything that is loaded after the page: the app shell for a signed-in visitor,
   prices, history, expenses, dialogs, pictures and the wait for an answer. The shimmer itself is
   .skeleton in base.css; here only the sizes the real content will take. */

/* Profile and balances in the sidebar. */
.avatar.skeleton { border-color: transparent; }
#profile-name.skeleton { width: 100px; max-width: 100%; height: 12px; line-height: 12px; overflow: hidden; margin-top: 2px; }
#profile-caption.skeleton { width: 64px; max-width: 100%; height: 9px; line-height: 9px; overflow: hidden; margin-top: 8px; }
#bonus-balance.skeleton { display: inline-block; min-width: 5ch; }

/* Prices next to the composer and in the mode menu. */
.price-estimate.skeleton { display: inline-block; min-width: 6.5ch; }
.model-menu em.skeleton { display: inline-block; min-width: 6ch; }

/* The expenses page. */
.wallet-summary b.skeleton { display: inline-block; min-width: 6ch; }
.stats b.skeleton { width: 5.5ch; max-width: 100%; }
.stats small.skeleton { display: block; width: 85%; }
#operations-note.skeleton { display: block; width: 70%; }
.transaction-skeleton { height: 58px; margin: 14px 0; border-radius: 10px; }

/* "My conversations". */
.conversation-skeleton { height: 94px; border-radius: 12px; }

/* The wait for an answer: three pulsing dots and a caption, plus a frame for a photo. */
.message-pending { align-items: flex-start; }
.pending-line { display: flex; align-items: center; gap: 10px; color: #6a7759; }
.typing-dots { display: inline-flex; gap: 5px; align-items: center; }
.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.3;
  animation: typing-pulse 1.2s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-pulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.pending-photo { width: min(100%, 320px); aspect-ratio: 1; max-height: 400px; border-radius: 16px; margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: none; opacity: 0.6; }
}

/* The chip that stands in for an attached photo while it is being processed. */
.attachment-skeleton { display: inline-block; min-width: 22ch; padding: 4px 0; }

/* A picture that has not loaded yet keeps a frame, so the message does not jump. */
.photo-loading { min-width: 160px; min-height: 160px; }

/* Lines in a dialog while its content is being fetched. */
.modal-skeleton { display: grid; gap: 10px; margin: 18px 0 8px; }
.modal-skeleton i { display: block; height: 14px; }
.modal-skeleton i:nth-child(2) { width: 82%; }
.modal-skeleton i:nth-child(3) { width: 58%; }

/* The list of prompts by topic that /ideas loads when it is opened from the home page. */
.ideas-index-loading { display: grid; gap: 12px; margin: 34px 0; }
.ideas-index-loading i { display: block; height: 16px; }
.ideas-index-loading i:nth-child(odd) { width: 38%; height: 22px; margin-top: 10px; }
.ideas-index-loading i:nth-child(even) { width: 82%; }

/* A repeat visit changes the example conversation on the home page; until it is chosen, the old one
   is covered by a placeholder of the same size. */
.demo-pending .landing-demo-question,
.demo-pending .landing-demo-answer,
.demo-pending .landing-demo-input {
  border-radius: 12px;
  border-color: transparent;
  color: transparent;
  background: linear-gradient(90deg, #dce3ce 25%, #f1f5e7 50%, #dce3ce 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.demo-pending .landing-demo-question > *,
.demo-pending .landing-demo-answer > *,
.demo-pending .landing-demo-input > * { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .demo-pending .landing-demo-question,
  .demo-pending .landing-demo-answer,
  .demo-pending .landing-demo-input { animation: none; }
}

/* The workspace markup holds defaults (text mode, three fixed example cards, the text placeholder), and the app then
   swaps in the saved request type, the image controls, a random choice of examples and the matching copy. Until it has
   finished (html.app-pending), these blocks are placeholders, so nothing flashes and changes under the reader's eyes. */
.app-pending #workspace .toolbar-selectors .model-button,
.app-pending #workspace #web-search {
  border-color: transparent;
  color: transparent;
  background: linear-gradient(90deg, #dce3ce 25%, #f1f5e7 50%, #dce3ce 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}
.app-pending #workspace .toolbar-selectors .model-button > *,
.app-pending #workspace #web-search > * { visibility: hidden; }
/* The intro changes with the request type, so until the app knows it, it is a placeholder bar. fit-content: the bar
   wraps like the real text, so nothing below it jumps when the text arrives. */
.app-pending #workspace .welcome .intro {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
  color: transparent;
  background: linear-gradient(90deg, #dce3ce 25%, #f1f5e7 50%, #dce3ce 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
/* The line under the cards is plain text, no bar for it: it is only kept invisible, so the space is reserved and
   the text appears in place. */
.app-pending #workspace .welcome .welcome-foot {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  color: transparent;
}
.app-pending #workspace .welcome .welcome-foot > * { visibility: hidden; }
.app-pending #workspace .suggestion {
  border-color: transparent;
  background: linear-gradient(90deg, #dce3ce 25%, #f1f5e7 50%, #dce3ce 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}
.app-pending #workspace .suggestion > * { visibility: hidden; }
.app-pending #workspace #prompt::placeholder { color: transparent; }
@media (prefers-reduced-motion: reduce) {
  .app-pending #workspace .toolbar-selectors .model-button,
  .app-pending #workspace #web-search,
  .app-pending #workspace .welcome .intro,
  .app-pending #workspace .suggestion { animation: none; }
}
