/* Skeletons are restricted to data-backed content slots; page chrome stays live. */
.loading-placeholder {
  --loading-base: #eef0f2;
  --loading-highlight: #fafbfc;
  pointer-events: none;
  overflow: hidden;
}

.loading-line,
.loading-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--loading-base);
}

.loading-line::after,
.loading-thumb::after {
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 42%;
  background: linear-gradient(90deg, transparent, var(--loading-highlight), transparent);
  content: "";
  animation: loading-shimmer 1.55s linear infinite;
}

.loading-line {
  width: 86%;
  height: 10px;
  margin: 10px 0;
  border-radius: 6px;
}

.loading-line.wide { width: 100%; }
.loading-line.short { width: 55%; }

.loading-thumb {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.loading-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 12px;
  background: #fff;
}

.loading-card .loading-thumb {
  width: 100%;
  height: clamp(70px, 10vw, 126px);
  margin-bottom: 15px;
  border-radius: 8px;
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px 16px;
  border: 1px solid rgba(30, 41, 59, 0.07);
  border-radius: 10px;
  background: #fff;
}

.loading-row .loading-line { margin: 0; }
.loading-row .loading-line.short { margin-left: auto; }
.loading-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loading-row-main .loading-line.wide { width: min(260px, 100%); }
.loading-row-main .loading-line.short { width: min(140px, 60%); margin-left: 0; }

.loading-list-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 68px;
  margin: 8px 10px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 41, 59, 0.06);
  border-radius: 10px;
  background: #fff;
}

.loading-list-item .loading-line { height: 8px; margin: 4px 0; }

.loading-chat-row {
  min-height: 32px;
  padding: 8px 12px;
}

body:not(.light-mode) .loading-chat-row {
  --loading-base: #303236;
  --loading-highlight: #494c51;
}

.loading-chat-row .loading-line {
  height: 9px;
  margin: 0;
  opacity: 0.75;
}

.loading-flow-node {
  position: absolute;
  top: 42%;
  left: calc(50% - 110px);
  width: 220px;
  padding: 16px 20px;
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px rgba(30, 41, 59, 0.05);
}

.loading-flow-node + .loading-flow-node {
  top: calc(42% + 94px);
  left: calc(50% + 42px);
}

@keyframes loading-shimmer {
  from { transform: translateX(0); }
  to { transform: translateX(380%); }
}

@media (max-width: 700px) {
  .loading-row { gap: 10px; }
  .loading-row > .loading-line.short { display: none; }
  .loading-card { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-line::after, .loading-thumb::after { animation-duration: 3s; }
}
