/* Урок Просто — главная кабинета: свои правила поверх файлов макета (up-home.css, up-widgets.css — без правки).
   Только то, чего на макете нет: строки-заглушки, пока данные плитки грузятся; сбой загрузки; задача в работе в
   «Недавних»; уход всплывающих (на макете они исчезают мгновенно) и мелкие переходы состояний. Движение — только
   transform и opacity; prefers-reduced-motion выключает общий выключатель кита (.up * { animation: none }). */

/* ---------- дата в верхней строке: на макете — «Четверг, 5 ноября»; настоящие даты бывают длиннее, на телефоне день
   недели — коротко, а если и так не влезло — многоточие вместо выхода за край ---------- */
.x-home-date-s { display: none; }
@media (max-width: 479px) {
  .x-home-date-l { display: none; }
  .x-home-date-s { display: inline; }
  .up-home .up-home-date { min-width: 0; overflow: hidden; }
  .up-home .up-home-date > span { overflow: hidden; text-overflow: ellipsis; }
  .up-home .up-home-date svg { flex: 0 0 auto; }
}

/* ---------- содержимое плитки проявляется, когда пришли данные ---------- */
.up-wgs .up-wg .up-wg-body { animation: x-home-body .32s var(--ease-out) both; }
@keyframes x-home-body { from { opacity: 0; transform: translateY(4px); } }

/* ---------- строки-заглушки: серые полосы с бегущим бликом ---------- */
.x-home-skel { display: grid; gap: 12px; align-content: start; padding-top: 4px; }
.x-home-skel i { display: block; height: 14px; border-radius: 7px; background: var(--ws-bar); position: relative; overflow: hidden; }
.x-home-skel i:nth-child(1) { width: 72%; height: 18px; }
.x-home-skel i:nth-child(2) { width: 92%; }
.x-home-skel i:nth-child(3) { width: 56%; }
.x-home-skel i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: x-home-sheen 1.4s var(--ease-out) infinite; animation-delay: calc(var(--n, 0) * 120ms); }
.up[data-theme="dark"] .x-home-skel i::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); }
@keyframes x-home-sheen { to { transform: translateX(100%); } }

/* ---------- сбой загрузки данных главной ---------- */
.x-home-error { display: grid; justify-items: start; gap: 8px; padding: 24px; }
.x-home-error .up-pill { margin-top: 4px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); cursor: pointer; }
.x-home-error .up-pill:hover { border-color: var(--ws-accent); color: var(--ws-accent-ink); }

/* ---------- задача в работе в «Недавних»: лист приглушён, по нему идёт блик ---------- */
.x-home-job .up-rc-pv { position: relative; }
.x-home-job .up-rc-pv .up-sh { opacity: .55; }
.x-home-job .up-rc-pv::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, rgba(var(--up-indigo), .14) 50%, transparent 70%); animation: x-home-sheen 1.8s var(--ease-out) infinite; }
.x-home-job .up-rc-s { color: var(--ws-accent-ink); }

/* ---------- ссылка «Как это работает» — та же кнопка-значок, что на макете ---------- */
.up-home a.up-help { text-decoration: none; }

/* ---------- режим настройки: «оседание» плиток (up-wg-settle кита) — один раз при входе в режим (data-settle ставит экран).
   На макете правило анимации висит на плитке всё время режима: его конечный кадр (fill: both) держит transform, и
   плитка не может ехать за курсором, а анимации «Убрать» и появления (у них специфичность ниже) не проигрываются.
   Здесь после входа анимация снимается, уход и появление плитки возвращаются ---------- */
.up-wg-area[data-editing="true"]:not([data-settle="true"]) .up-wg { animation: none; }
.up-wg-area[data-editing="true"] .up-wg[data-leaving="true"] { animation: up-wg-out .2s var(--ease-out) forwards; }
.up-wg-area[data-editing="true"] .up-wg[data-fresh="true"] { animation: up-wg-pop .5s var(--spring) both; }
/* плитка под курсором: выше соседей и без выделения текста, пока её несут */
.up-wg-area[data-editing="true"] .up-wg[data-dragging="true"] { animation: none; user-select: none; -webkit-user-select: none; }

/* ---------- пока тянут уголок, плитка отступает на второй план — видно призрак нового размера ---------- */
.up-wg > .up-wg-in { transition: opacity .18s var(--ease-out); }
.up-wg[data-resizing="true"] > .up-wg-in { opacity: .55; }

/* ---------- уход всплывающих: быстрее, чем пришли ---------- */
.up-wg-pop[data-closing="true"] { animation: x-home-pop-out .16s var(--ease-out) forwards; pointer-events: none; }
@keyframes x-home-pop-out { to { opacity: 0; transform: translateY(-4px) scale(.97); } }
.up-wgal[data-closing="true"] { animation: x-home-gal-out .22s var(--ease-out) forwards; pointer-events: none; }
@keyframes x-home-gal-out { to { opacity: 0; transform: translateX(20px); } }
.up-wg-panel[data-closing="true"] { animation: x-home-fade-out .18s var(--ease-out) forwards; pointer-events: none; }
.up-wg-toast[data-closing="true"] { animation: x-home-toast-out .2s var(--ease-out) forwards; pointer-events: none; }
@keyframes x-home-toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.up-wg-scrim[data-closing="true"] { animation: x-home-fade-out .2s var(--ease-out) forwards; pointer-events: none; }
@keyframes x-home-fade-out { to { opacity: 0; } }
@media (max-width: 639px) {
  .up-wg-pop[data-closing="true"] { animation-name: x-home-sheet-out; }
  .up-wgal[data-closing="true"] { animation-name: x-home-sheet-out; }
  @keyframes x-home-sheet-out { to { opacity: 0; transform: translateY(24px); } }
}

/* ---------- длинная тема в чипе «Следующий урок: …» (Большой «Продолжить подготовку») — одной строкой с многоточием ---------- */
.up-cont-card .up-ctx-chips .up-chip { max-width: 100%; min-width: 0; }
.x-home-clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
