/* ===========================================================================
   Skeletons
   ---------------------------------------------------------------------------
   Nothing in Candid waits behind a spinner. A wheel says "something is
   happening" and nothing else: the screen stays empty, the layout arrives all
   at once, and everything you were about to read jumps into place under your
   cursor. A skeleton says what is coming and how much of it — the toolbar, the
   six columns, the eight rows — so the page you end up looking at is the page
   you were already looking at, with the grey filled in.

   Every skeleton in this app is built from the *real* containers: .table,
   .corow, .dash, .panel, .convo__row, .members. That is deliberate and it is
   what makes them work on a phone as well as a desktop without a single
   breakpoint of their own — the companies skeleton scrolls sideways at 360px
   because .corow does, and the conversations skeleton narrows to a phone
   because .convo__row does. Only the text inside is replaced.
   =========================================================================== */

/* The sweep runs right to left across a block that is twice its own width, so
   the highlight crosses once per cycle rather than snapping back. */
@keyframes cdShimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

.skel {
  --skel-fill: linear-gradient(90deg, #E8E8E8 24%, #F4F4F4 50%, #E8E8E8 76%);
  background: var(--skel-fill) 200% 0 / 200% 100%;
  border-radius: var(--r-pill);
  animation: cdShimmer 1.5s linear infinite;
  /* A skeleton stands in for a line of text, so a flex parent must not stretch
     it past the height it was given. */
  flex: 0 0 auto;
}

/* On the sidebar, the tab bar, the hero and the billing hero the ground is
   --ink, and a grey block on it reads as a rendering fault. Same shimmer,
   knocked out of the surface colour rather than laid on top of it. */
.skel--ink { --skel-fill: linear-gradient(90deg, rgba(255, 255, 255, .11) 24%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .11) 76%) }

/* The progress tracks fill themselves through `> div`, which is a more
   specific selector than .skel — so a skeleton inside one came out as a solid
   teal bar, which is not a placeholder, it is a reading. Named here so it
   shimmers like every other block. */
.hero__track > .skel,
.barrow__track > .skel,
.prio__track > .skel,
.mbbar > .skel,

/* Marks, avatars and score rings are the three non-pill shapes. */
.skel--mark { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px }
.skel--round { border-radius: var(--r-pill) }
.skel--box { border-radius: 14px }
/* The top bar's search field and Settings button, which a phone folds into
   icons: the boot skeleton draws them on a desktop only. */
@media (max-width: 900px) { .skel--desk { display: none } }

/* The root of any skeleton tree. Nothing inside one is real, so nothing inside
   one should react to a cursor — .corow and .seqcard both light up on hover,
   and a placeholder that responds to the mouse invites a click that goes
   nowhere. Text selection is off for the same reason: there is no text. */
[data-skeleton] { pointer-events: none; user-select: none; -webkit-user-select: none }

/* Drawers: the coral a record's mark waits on would show round the shimmer's
   corners, and a bullet in ink is the only dark thing on a grey screen. */
.drawer__mark:has(> .skel) { background: none }
[data-skeleton] .ovlead__pts li::before { background: #E8E8E8 }

/* The other half of the wait, and the more common one once a screen has been
   opened: the page is already there and readable, and only the data behind it
   is being checked. Nothing is torn down, so the fade is the entire answer to
   the click — enough to say the click landed, not so much that the page stops
   being legible while it waits. The rows on screen are real ones, so they stay
   clickable throughout. Held back for a third of a second, because most
   checks are over by then and a page that dims and brightens for nothing
   looks slower than one that simply stays put. */
.screen { transition: opacity .18s ease }
.screen[aria-busy="true"] { opacity: .55; transition-delay: .3s }

/* Job progress — an import running, a file uploading. Not a skeleton: there is
   no shape to preview, only a length of time nobody knows. An indeterminate
   track says that honestly, and the status line under it says the rest. */
.skeltrack {
  height: 6px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--page); margin: 0 auto 14px; max-width: 320px;
}
.skeltrack > div {
  width: 40%; height: 100%; border-radius: var(--r-pill);
  background: var(--teal);
  animation: cdTrack 1.25s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes cdTrack {
  from { transform: translateX(-100%) }
  to   { transform: translateX(250%) }
}

/* provider tiles on the connect screen */
.provider {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r-input);
  padding: 16px 18px; background: var(--card);
  cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; color: var(--text);
  transition: border-color .16s ease;
}
.provider:hover:not(:disabled) { border-color: var(--teal) }
.provider:disabled { opacity: .5; cursor: not-allowed }
.provider__mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--page);
}
.provider__mark .ms { font-size: 21px }
/* Brand marks come in as inline SVG and should not inherit the mark chip's
   grey plate sizing. */
.provider__mark svg { width: 28px; height: 28px; display: block }
.provider b { display: block; font-size: 14px; font-weight: var(--weight-strong) }
.provider small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px }
