/* Волна 2, визуал кабинета /w/ (сервер подключает файл только при флагах W_SKELETONS / W_UNDO_TOAST / W_PTR_RUNNER / W_SPLASH).
   Цвета — только токены темы widget.css (обе темы, AA). prefers-reduced-motion — без бега, блика и пружин. */
:root { --w2-hi: rgba(255, 255, 255, .07); --w2-bg: var(--raise); --w2-tab: calc(76px + env(safe-area-inset-bottom)); }
:root[data-theme="light"] { --w2-hi: rgba(255, 255, 255, .85); --w2-bg: var(--panel); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]):not(.inapp) { --w2-hi: rgba(255, 255, 255, .85); --w2-bg: var(--panel); } }
:root.inapp-light { --w2-hi: rgba(255, 255, 255, .85); --w2-bg: var(--panel); }

/* ---------- человечек (w2_runner.js): палочки на суставах, коралл ---------- */
.rq { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; color: var(--coral); }
.rq-b path, .rq-far path { stroke: currentColor; stroke-width: 4.6; }
.rq-b .rq-t { stroke-width: 6; }
.rq-far { opacity: .42; }
.rq-h { fill: currentColor; }
.rq-g { stroke: var(--line2); stroke-width: 2; }
.rq-p { stroke: var(--muted); stroke-width: 2.4; }
.rq-p .rq-c { fill: var(--ctl); stroke: none; }
.rq-p .rq-ski { stroke-width: 3; }
.rq-b .rq-bl { fill: currentColor; stroke: currentColor; stroke-width: 3; }
.rq-pie { fill: var(--amber); }

/* ---------- М28: скелеты по форме экрана ---------- */
.sk2 { display: grid; gap: 12px; }
.sk2-b { display: block; height: 12px; border-radius: 7px; background: var(--raise2); }
.sk2-c, .sk2-days, .sk2-bub { position: relative; overflow: hidden; }
.sk2-c { padding: 16px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sk2-c::after, .sk2-days::after, .sk2-bub::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 25%, var(--w2-hi) 50%, transparent 75%); transform: translateX(-100%);
  animation: w2-sweep 1.5s cubic-bezier(.4, 0, .2, 1) infinite; }
.sk2 > :nth-child(2)::after { animation-delay: .08s; } .sk2 > :nth-child(3)::after { animation-delay: .16s; }
.sk2 > :nth-child(4)::after { animation-delay: .24s; } .sk2 > :nth-child(5)::after { animation-delay: .32s; }
@keyframes w2-sweep { to { transform: translateX(100%); } }
.sk2-l { display: grid; gap: 10px; min-width: 0; }
.sk2-t { height: 15px; } .sk2-s { height: 11px; opacity: .75; } .sk2-h { height: 20px; border-radius: 8px; }
.w45 { width: 45%; } .w55 { width: 55%; } .w62 { width: 62%; } .w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; }
/* расписание: полоса дней и строки «время | занятие | места» */
.sk2-days { display: flex; gap: 8px; padding: 2px 0 6px; }
.sk2-day { flex: none; width: 60px; height: 72px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.sk2-day:first-child { background: var(--soft); border-color: var(--soft-line); }
.sk2-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 64px; align-items: center; gap: 14px; min-height: 92px; }
.sk2-tm { height: 26px; border-radius: 8px; transform: skewX(-8deg); }
.sk2-pill { height: 36px; border-radius: 12px; }
/* «Мои записи»: дата-плашка, строки, две кнопки */
.sk2-bk { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 14px 16px; }
.sk2-date { width: 60px; height: 64px; border-radius: 16px; transform: skewX(-6deg); }
.sk2-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sk2-btn { height: 44px; border-radius: 14px; background: none; border: 1.5px solid var(--line2); }
/* абонемент: название, крупное число, полоса остатка, срок */
.sk2-pass { display: grid; gap: 16px; padding: 20px; }
.sk2-ph { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 16px; align-items: start; }
.sk2-num { height: 50px; border-radius: 12px; }
.sk2-prog { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--soft-line) 0 62%, var(--raise2) 62%); }
.sk2-pf { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sk2-chip { width: 104px; height: 28px; border-radius: 99px; }
/* сообщения: аватар + строки; переписка — пузыри */
.sk2-msg { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 14px; }
.sk2-av { width: 48px; height: 48px; border-radius: 50%; }
.sk2-k-chat { gap: 10px; padding: 8px 0; }
.sk2-bub { height: 46px; border-radius: 20px 20px 20px 6px; background: var(--raise2); justify-self: start; }
.sk2-bub.me { justify-self: end; border-radius: 20px 20px 6px 20px; background: var(--soft); }
.sk2-gen { display: grid; min-height: 84px; align-content: center; }
.sk2-boot { margin-top: 4px; }

/* ---------- М29: единая плашка подтверждения ---------- */
.w2t { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(var(--w2-tab) + 10px); max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 10px 12px 14px;
  border-radius: 18px; background: var(--w2-bg); color: var(--text); border: 1px solid var(--line2); box-shadow: var(--shadow-pop);
  overflow: hidden; animation: w2t-in .32s cubic-bezier(.2, .9, .25, 1.2) both; }
.w2t.out { animation: w2t-out .2s ease-in both; }
@keyframes w2t-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes w2t-out { to { opacity: 0; transform: translateY(12px); } }
.w2t-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--coral); color: var(--ink);
  font: 800 18px/1 var(--f-head); transform: skewX(-8deg); }
.w2t-info .w2t-ic { background: var(--raise2); color: var(--text); }
.w2t-err .w2t-ic { background: var(--bad-soft); color: var(--bad); }
.w2t-tx { display: grid; gap: 1px; min-width: 0; }
.w2t-tx b { font: 700 15px/1.25 var(--f-body); }
.w2t-tx small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.w2t-acts { display: flex; align-items: center; gap: 2px; }
.w2t-undo, .w2t-cal { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none;
  color: var(--coral); font: 750 14px/1 var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.w2t-cal { color: var(--text2); font-weight: 650; }
.w2t-cal .ic { width: 18px; height: 18px; }
.w2t-undo:hover, .w2t-cal:hover { background: var(--soft); }
.w2t-undo[disabled] { opacity: .6; }
.w2t-x { width: 36px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 10px; }
.w2t-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--coral); transform-origin: left;
  animation: w2t-bar linear forwards; }
@keyframes w2t-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* узкий экран: подпись под действиями, «В календарь» только значком */
@media (max-width: 400px) {
  .w2t { grid-template-columns: 36px minmax(0, 1fr); }
  .w2t-acts { grid-column: 1 / -1; justify-content: flex-end; margin: 2px -4px -6px 0; }
}
@media (min-width: 768px) { .w2t { bottom: 24px; left: 24px; right: 24px; max-width: 600px; } }
.embed .w2t { bottom: 12px; }

/* ---------- М67: «потянуть — обновить» с бегущим человечком ---------- */
html.w2-ptr-on, html.w2-ptr-on body { overscroll-behavior-y: none; }
.w2-ptr { position: fixed; z-index: 75; left: 50%; top: calc(env(safe-area-inset-top) + 4px); width: 64px; height: 58px; margin-top: -62px;
  display: grid; place-items: center; border-radius: 20px; background: var(--w2-bg); border: 1px solid var(--line2); box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transform: translate(-50%, 0); }
.w2-ptr:not(.show) { transition: opacity .2s, transform .28s cubic-bezier(.2, .9, .25, 1.2); }
.w2-ptr.ready { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 14%, var(--w2-bg)); }
.w2-ptr.spin { opacity: 1 !important; transition: transform .2s; }
.w2-ptr-fig { width: 48px; height: 44px; }

/* ---------- М68: заставка и «нет интернета» ---------- */
.w2-splash { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg);
  opacity: 0; visibility: hidden; transition: opacity .25s ease-out, visibility 0s .25s; }   /* .show ставит w2_splash.js через 0,3 с: быстрый вход заставку не видит */
.w2-splash.show { opacity: 1; visibility: visible; transition: opacity .25s ease-out; }
.w2-splash.out { pointer-events: none; }
.w2-sp-in { display: grid; justify-items: center; gap: 14px; }
.w2-sp-fig { display: block; width: 168px; height: 154px; }
.w2-sp-logo { width: 120px; height: auto; }
.w2-sp-bar { display: block; width: 120px; height: 4px; border-radius: 99px; background: var(--raise2); position: relative; overflow: hidden; }
.w2-sp-bar::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--coral); animation: w2-sp-run 1.1s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes w2-sp-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.w2-off { position: fixed; z-index: 72; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 10px); max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 18px;
  background: var(--w2-bg); border: 1px solid var(--line2); box-shadow: var(--shadow-pop); animation: w2t-in .32s cubic-bezier(.2, .9, .25, 1.2) both; }
.w2-off.out { animation: w2t-out .2s ease-in both; }
.w2-off-fig { width: 72px; height: 66px; }
.w2-off-tx { display: grid; gap: 2px; } .w2-off-tx b { font: 700 15px/1.25 var(--f-body); } .w2-off-tx small { color: var(--muted); font-size: 13px; line-height: 1.35; }

@media (prefers-reduced-motion: reduce) {
  .sk2-c::after, .sk2-days::after, .sk2-bub::after, .w2-sp-bar::after { animation: none; display: none; }
  .w2t, .w2t.out, .w2-off, .w2-off.out { animation-duration: .01s; }
  .w2-ptr:not(.show) { transition: opacity .2s; }
  .w2t-bar { animation-name: none; }   /* полоска не тает — «Отменить» доступно те же 5 секунд */
}
