/* skeleton.css (TSK-2498, U3): the placeholder shapes of _skeleton.html while
   text, rows and cards load. Values only through var(--token) from tokens.css.
   Shapes: surface fills (--surface-2) and line borders (--divider), the same
   boxes as the final layout (record card, doctor card, trend chart, records
   row), so the content takes their place with no layout shift. The shimmer is
   one sweep per --dur-shimmer; under prefers-reduced-motion: reduce it is still.
   The spiral (spiral.css) is for thinking, page changes and pictures. */

.sk-bank { display: none; }

/* the full width of its place (a message or the records list), as the final box */
.sk, .sk-card, .sk-chart, .sk-docs { inline-size: 100%; }
.sk-shape { display: grid; gap: var(--s-2); }

.sk-fill {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r);
}
.sk-line { block-size: var(--sk-line); inline-size: var(--sk-w-long); }
.sk-title { block-size: var(--sk-title); inline-size: var(--sk-w-mid); }
.sk-w-mid { inline-size: var(--sk-w-mid); }
.sk-w-short { inline-size: var(--sk-w-short); }
.sk-lines { display: grid; gap: var(--s-2); min-inline-size: 0; }

.sk-box { border: var(--stroke-1) solid var(--divider); border-radius: var(--r); }

/* record card: the mx-card box */
.sk-card {
  display: grid;
  grid-template-columns: var(--sk-pic) minmax(0, 1fr);
  align-items: start;
  gap: var(--s-4);
  max-inline-size: var(--chips-max);
  padding: var(--s-4);
}
.sk-pic { aspect-ratio: var(--pic-ratio-tall); }
.sk-body { display: grid; align-content: start; gap: var(--s-2); min-block-size: var(--sk-card-body); }

/* trend chart: the mx-trend head and the mx-tr-svg box */
.sk-chart { display: grid; max-inline-size: var(--chips-max); }
.sk-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); min-block-size: var(--sk-tr-head); }
.sk-plot { aspect-ratio: var(--sk-chart-ratio); inline-size: 100%; margin-block-start: var(--s-3); }
/* the mx-tr-foot dates and the mx-tr-range line under the plot */
/* each stands in one mono label line (--fs-label at line-height 1.4), as the final text */
.sk-foot, .sk-range { margin-block: calc((var(--fs-label) * 1.4 - var(--sk-line)) / 2); }

/* doctor cards: the mx-docs list of mx-doc rows */
.sk-docs { display: grid; gap: var(--s-2); max-inline-size: var(--chips-max); }
.sk-doc {
  display: grid;
  grid-template-columns: var(--s-10) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  min-block-size: var(--sk-doc);
  padding: var(--s-3);
}
.sk-doc .sk-mark { inline-size: var(--s-10); block-size: var(--s-10); }

/* records list: the rc-year head and rc-row rows */
.sk-records { display: grid; }
.sk-year {
  display: block;
  padding-block: 0 var(--s-2);
  border-block-end: var(--stroke-1) solid var(--divider);
}
.sk-row {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  min-block-size: var(--sk-row);
  padding-block: var(--s-2);
  border-block-end: var(--stroke-1) solid var(--divider);
}
.sk-row .sk-mark { inline-size: var(--tap); block-size: var(--tap); }

/* the shimmer: one band crosses each fill in the reading direction */
.sk-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, var(--divider), transparent);
  transform: translateX(-100%);
}
@media (prefers-reduced-motion: no-preference) {
  .sk-fill::after { animation: sk-shimmer var(--dur-shimmer) var(--ease-standard) infinite; }
  [dir="rtl"] .sk-fill::after { animation-direction: reverse; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-fill::after { display: none; }
}
@keyframes sk-shimmer {
  to { transform: translateX(100%); }
}
