/* Guloxy Cloud — телефон.
   ------------------------------------------------------------------
   Файл подключён через media="(max-width: 900px)", поэтому здесь нет
   ни одной обёртки @media: всё, что написано ниже, физически не
   существует для настольной версии. Десктопные стили не переопределяются
   и не удаляются — просто не применяются.

   Язык мобильной версии отличается от десктопного намеренно:
   1. Управление живёт внизу, в зоне большого пальца, а не в шапке.
   2. Меню и диалоги приезжают снизу листами, а не всплывают у курсора.
   3. Геометрия крупнее и круглее: палец не попадает в 34-пиксельные цели.
   Иконки, палитра и набор функций — те же самые.
   ------------------------------------------------------------------ */

:root {
  --m-gut: 16px;
  --m-rail: 56px;
  --m-dock: 64px;
  --m-r: 20px;
  --m-r-lg: 26px;
  --m-r-sheet: 28px;
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
  /* Док + отступ: ниже этой линии на экране ничего не рисуем. */
  --m-floor: calc(var(--m-dock) + var(--sb) + 18px);
  --m-spring: cubic-bezier(.22, 1.2, .36, 1);
}

.mobile-only  { display: flex !important; }
.desktop-only { display: none !important; }

/* Тап по интерактивному элементу не должен подсвечиваться серым
   прямоугольником поверх собственных состояний. */
body { -webkit-tap-highlight-color: transparent; }

/* То же, что с карточками: доигравшая анимация с fill: both продолжает
   держать кадр с transform, а элемент с transform-анимацией становится
   containing block для position: fixed внутри себя. На телефоне внутри
   #root живут док и фиксированные кнопки, поэтому кадр отпускаем. */
.view-fade { animation-fill-mode: backwards; }

/* Полосы прокрутки на телефоне рисует система. */
::-webkit-scrollbar { width: 0; height: 0; }

/* Те же примитивы, что в base.css, но под палец: цель крупнее, подписи
   читаемее. Всё, что не отличается (спиннер, блок ошибки, знак диалога),
   берётся из общей базы. */
.checkbox { gap: 11px; font-size: 14.5px; }
.checkbox .box { width: 23px; height: 23px; border-radius: 8px; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--m-spring); }
.checkbox .box svg { width: 14px; height: 14px; }
.checkbox input:active + .box { transform: scale(.9); }

.chip { padding: 7px 12px; font-size: 12.5px; font-weight: 550; }
.chip svg { width: 15px; height: 15px; }

/* ================================================================ оболочка */

.app { grid-template-columns: 1fr; }
/* Ящик-меню на телефоне не нужен: всё, что в нём было, разошлось по
   доку и листу профиля. Разметка остаётся ради общих обработчиков. */
.app .side, .app .scrim, .fab { display: none !important; }

.main { min-height: 100dvh; grid-template-rows: auto auto 1fr; }

/* -------- шапка: липкая рейка и крупный заголовок, уезжающий вместе со
   страницей. Липкой остаётся только рейка — её высота постоянна, поэтому
   прокрутка ничего не пересобирает. */

.topbar.mtop {
  display: block; height: auto; padding: 0;
  padding-top: var(--st);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease);
}
body.scrolled .topbar.mtop { border-bottom-color: var(--border); }

/* Справа у кнопок своя внутренняя отбивка (у аватара — 4px, у иконок —
   половина от 38-пиксельной цели), поэтому отступ рейки меньше общего
   поля: иначе аватар визуально стоит ближе к краю, чем логотип слева. */
.mrail {
  position: relative;
  height: var(--m-rail); display: flex; align-items: center; gap: 6px;
  padding: 0 12px 0 var(--m-gut);
}
.mrail .brand { transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.mrail .brand-tx small { display: none; }
.mrail .brand-tx b { font-size: 15.5px; }
.mrail .spacer { flex: 1; }

/* Заголовок раздела переезжает в рейку, когда крупный уехал вверх. */
.mrail-title {
  position: absolute; left: 52px; right: 96px; top: 50%;
  transform: translateY(calc(-50% + 8px)); opacity: 0; pointer-events: none;
  font-family: var(--fd); font-size: 15.5px; font-weight: 600; letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
body.scrolled .mrail-title { opacity: 1; transform: translateY(-50%); }
body.scrolled .mrail .brand { opacity: 0; transform: translateX(-8px); pointer-events: none; }

.m-ava { flex: 0 0 auto; padding: 4px; border-radius: 50%; transition: transform var(--t-fast) var(--m-spring); }
.m-ava:active { transform: scale(.9); }
.m-ava .avatar { width: 32px; height: 32px; font-size: 12.5px; }

.mhead {
  display: grid; gap: 12px;
  padding: 6px var(--m-gut) 13px;
}

/* Хлебные крошки на телефоне сжаты до «назад + текущая папка»: полная
   цепочка открывается листом по нажатию на путь. */
.crumbs { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; overflow: visible; }
.crumbs:not(:has(.m-back)) { grid-template-columns: 1fr; }
.m-back {
  width: 38px; height: 38px; margin-left: -6px; border-radius: 13px;
  display: grid; place-content: center; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border);
  transition: transform var(--t-fast) var(--m-spring), background var(--t-fast);
}
.m-back:active { transform: scale(.88); background: var(--active); }
.m-title { min-width: 0; display: grid; gap: 1px; }
.m-title h1 {
  font-family: var(--fd); font-size: clamp(23px, 6.6vw, 30px); font-weight: 600;
  letter-spacing: -.04em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-title .m-sub, .m-title .m-path {
  font-size: 12.5px; color: var(--text-3); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.m-title .m-path { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--accent-1); font-weight: 550; }
.m-title .m-path svg { width: 13px; height: 13px; flex: 0 0 auto; }
.m-title .m-path span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mtop .search { flex: none; width: 100%; }
/* 16px — не прихоть: при меньшем кегле Safari на iOS увеличивает страницу,
   как только поле получает фокус, и обратно уже не возвращает. */
.mtop .search input {
  height: 46px; border-radius: 16px; padding-left: 44px; font-size: 16px;
  background: var(--panel-2);
}
.mtop .search svg { left: 15px; width: 19px; height: 19px; }

.content {
  padding: 14px var(--m-gut) calc(var(--m-floor) + 14px);
}

/* ================================================================ панель действий */

/* Вместо тесной панели с сегментами — лента «таблеток», которую можно
   пролистать пальцем. Уходит за край экрана, чтобы было видно: их больше. */
.mbar {
  margin: 0 calc(var(--m-gut) * -1) 14px;
  padding: 1px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--m-gut), #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--m-gut), #000 calc(100% - 22px), transparent);
}
.mbar-scroll {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--m-gut); scroll-padding-inline: var(--m-gut);
}
.mchipb {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  height: 38px; padding: 0 15px; border-radius: var(--r-pill);
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--text-2); letter-spacing: -.01em;
  transition: transform var(--t-fast) var(--m-spring), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.mchipb svg { width: 17px; height: 17px; }
.mchipb:active { transform: scale(.94); }
.mchipb.on { background: var(--accent-1); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
.mchipb.danger { color: var(--danger); border-color: rgba(255, 122, 122, .26); }

/* Переключатель вида — не «таблетка» с подписью, а пара иконок: так видно
   оба состояния сразу, как в настольной панели. */
.mseg {
  display: flex; gap: 2px; flex: 0 0 auto; padding: 3px;
  border-radius: var(--r-pill); background: var(--panel-2); border: 1px solid var(--border);
}
.mseg button {
  width: 42px; height: 32px; border-radius: var(--r-pill);
  display: grid; place-content: center; color: var(--text-3);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--m-spring);
}
.mseg button svg { width: 17px; height: 17px; }
.mseg button:active { transform: scale(.92); }
.mseg button.on { background: var(--accent-1); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }

.toolbar { display: none; }

/* ================================================================ карточка хранилища */

.mstore {
  position: relative; overflow: hidden;
  display: grid; gap: 13px; margin-bottom: 18px;
  padding: 17px 17px 15px; border-radius: var(--m-r-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-glow), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 58%),
    var(--bg-2);
}
.mstore-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mstore-fig { display: grid; gap: 2px; min-width: 0; }
.mstore-fig b { font-family: var(--fd); font-size: 27px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.mstore-fig span { font-size: 12.5px; color: var(--text-3); }
.mstore-pct {
  font-family: var(--fd); font-size: 19px; font-weight: 600; letter-spacing: -.03em;
  color: var(--accent-1); display: flex; align-items: baseline; gap: 1px;
}
.mstore-pct i { font-style: normal; font-size: 12px; opacity: .7; }

/* Полоса занятости и разбивка по типам — один и тот же объект: сегменты
   считаются от квоты, остаток — дорожка. Две полосы подряд об одном и том
   же были бы шумом. */
/* Дорожка — вся квота, заполненная часть — занятое место, а уже внутри
   неё сегменты по типам. На почти пустом диске это тонкий цветной штрих
   у левого края, а не радуга во всю полосу. */
.mstore-bar { display: flex; height: 9px; border-radius: 99px; background: var(--border); overflow: hidden; }
.mstore-fill {
  display: flex; height: 100%; min-width: 12px; border-radius: 99px; overflow: hidden;
  animation: barGrow .7s var(--ease-out) both;
}
/* Сегменты стыкуются без зазоров: на почти пустом диске заполненная часть
   занимает считанные пиксели, и просветы между ними превращают полосу в
   рябь вместо одного цветного штриха. */
.mstore-fill i { display: block; height: 100%; min-width: 2px; }
@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } }

.mstore-chips {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -17px; padding: 0 17px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
}
.mstore-chips .mchip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 6px 11px; border-radius: var(--r-pill);
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); white-space: nowrap;
}
.mstore-chips .mchip i { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
.mstore-chips .mchip b { color: var(--text-2); font-weight: 600; }

.mstore-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-3); }
.mstore-foot span { display: inline-flex; align-items: center; gap: 10px; }
.mstore-foot span + span::before { content: ''; width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: .55; }
.mstore-foot b { color: var(--text-2); font-weight: 600; }

/* ================================================================ сетка файлов */

.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Появление карточек и строк описано в app.css как animation ... both.
   fill-mode: both означает, что после конца анимации браузер продолжает
   держать её последний кадр (transform: none), а анимация в каскаде бьёт
   и :active, и inline-стиль. На телефоне это убивает и отклик на нажатие,
   и свайп по строке, поэтому кадр после завершения отпускаем. */
.card, .row, .swipe-wrap { animation-fill-mode: backwards; }

.card {
  border-radius: var(--m-r);
  background: var(--panel-2);
  transition: transform .18s var(--m-spring), border-color var(--t-fast), background var(--t-fast);
}
.card:active { transform: scale(.955); }
.card:hover { transform: none; box-shadow: none; background: var(--panel-2); border-color: var(--border); }

/* place-content: center из настольной версии сжимает дорожку грида под
   высоту картинки — вокруг превью появляются полосы фона. Дорожка должна
   растягиваться, а центрировать нужно только иконку. */
.card-thumb { aspect-ratio: 1 / .84; place-content: stretch; background: color-mix(in srgb, var(--tint) 11%, transparent); }
.card-thumb > svg { width: 38px; height: 38px; place-self: center; color: var(--tint); stroke-width: 1.5; }
.card:hover .card-thumb > svg { transform: none; color: var(--tint); }
.card-thumb.folder > svg { color: var(--accent-1); fill: color-mix(in srgb, var(--accent-1) 18%, transparent); }
/* Ярлык типа поверх превью: на миниатюре видео и картинки иначе неотличимы. */
.card-thumb::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tint) 55%, transparent), transparent);
}

.card-body { padding: 10px 12px 13px; }
.card-name { font-size: 13.6px; line-height: 1.32; }
.card-meta { font-size: 11.4px; margin-top: 2px; }

/* На тач-экране нет наведения — кнопка «ещё» просто всегда на месте. */
.card-actions { opacity: 1; transform: none; top: 7px; right: 7px; }
.card-actions [data-star] { display: none; }
.card-actions [data-star].star-on { display: grid; }
.card-actions button {
  width: 32px; height: 32px; border-radius: 11px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(10px) saturate(150%); -webkit-backdrop-filter: blur(10px) saturate(150%);
  border-color: var(--border-strong);
}
.card-actions button:active { transform: scale(.88); }
.card-pick { width: 26px; height: 26px; border-radius: 9px; top: 7px; left: 7px; }
.card-pick svg { width: 15px; height: 15px; }

/* ================================================================ список файлов */

.list { gap: 4px; }
.list-head { display: none; }

.row {
  grid-template-columns: 1fr auto; gap: 8px;
  padding: 9px 10px; border-radius: 16px;
  position: relative; background: var(--panel-2); border: 1px solid transparent;
  transition: transform .2s var(--m-spring), background var(--t-fast);
}
.row .row-cell { display: none; }
.row:active { transform: scale(.985); }
.row-main { gap: 13px; }
.row-ico {
  width: 46px; height: 46px; border-radius: 15px;
  background: color-mix(in srgb, var(--tint) 13%, transparent);
}
.row-ico svg { width: 22px; height: 22px; color: var(--tint); }
.row-ico.folder svg { color: var(--accent-1); }
.row-name { font-size: 14.8px; }
.row-sub { font-size: 12px; margin-top: 1px; }
.row-end .icon-btn { width: 40px; height: 40px; }

/* Свайп по строке: под ней лежат два действия, сама строка едет по X.
   Жест делает mobile.js, здесь только оправа. */
.swipe-wrap { position: relative; border-radius: 16px; overflow: hidden; }
.swipe-acts {
  position: absolute; inset: 0; display: flex; align-items: stretch; justify-content: space-between;
  border-radius: 16px; overflow: hidden;
}
.swipe-acts button {
  width: 88px; display: grid; place-content: center; gap: 4px; justify-items: center;
  font-size: 11px; font-weight: 600; color: #fff;
}
.swipe-acts svg { width: 21px; height: 21px; }
.swipe-acts .sw-star { background: linear-gradient(135deg, #f5a623, #ffc542); }
.swipe-acts .sw-trash { background: linear-gradient(135deg, #e0454f, #ff7a7a); margin-left: auto; }
.swipe-wrap .row {
  position: relative; z-index: 1; margin: 0; border-radius: 16px;
  background: var(--panel-solid); will-change: transform;
}
.swipe-wrap.swiping .row { transition: none; }

/* ================================================================ пустые состояния */

.empty { padding: 56px 16px; gap: 13px; }
.empty-ico { width: 76px; height: 76px; border-radius: 26px; }
.empty-ico svg { width: 34px; height: 34px; }
.empty h3 { font-family: var(--fd); font-size: 17.5px; letter-spacing: -.03em; }
.empty p { font-size: 13.8px; }

.skel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skel { border-radius: var(--m-r); }

/* ================================================================ док */

/* Плавающая «таблетка» вместо панели во всю ширину: экран остаётся
   виден по краям, и док читается как отдельный предмет над контентом. */
.mnav {
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--sb)); z-index: 40;
  height: var(--m-dock); padding: 0 8px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), inset 0 1px 0 var(--sheen);
  transition: transform .34s var(--m-spring), opacity .22s var(--ease);
}
.mnav button {
  position: relative; flex: 1 1 0; min-width: 0;
  display: grid; justify-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 16px;
  font-size: 10px; font-weight: 600; letter-spacing: -.005em; color: var(--text-3);
  transition: color var(--t-fast), transform var(--t-fast) var(--m-spring);
}
.mnav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mnav button svg { width: 22px; height: 22px; }
.mnav button:active { transform: scale(.9); }
.mnav button.on { color: var(--accent-1); }
/* Точка под активной вкладкой — тише, чем заливка, и не спорит с доком. */
.mnav button.on::after {
  content: ''; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 2px; border-radius: 2px; background: var(--accent-1);
  animation: dotIn .3s var(--m-spring) both;
}
@keyframes dotIn { from { width: 0; opacity: 0; } }

/* Загрузка — центральная кнопка, приподнятая над доком. Отрицательный
   отступ нужен сверху вместе с align-self: у центрированного по флексу
   элемента такой же отступ снизу просто сдвигает кнопку вниз, и она
   свешивается из дока, а не встаёт над ним. */
.mnav .dock-up {
  flex: 0 0 auto; align-self: flex-start;
  width: 56px; height: 56px; margin: -12px 4px 0; padding: 0;
  border-radius: 19px; display: grid; place-content: center;
  background: linear-gradient(160deg, var(--accent-2), var(--accent-1) 62%);
  color: #fff;
  box-shadow: 0 10px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.mnav .dock-up svg { width: 25px; height: 25px; stroke-width: 2; }
.mnav .dock-up:active { transform: scale(.9); }
.mnav .dock-up::after { display: none; }

/* Счётчик корзины: цифру пишет тот же setCounts, что и в боковом меню. */
.dock-badge {
  position: absolute; top: 3px; left: 50%; margin-left: 5px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  display: grid; place-content: center;
  background: var(--accent-1); color: #fff;
  font-size: 9.5px; font-weight: 700; font-style: normal; line-height: 1;
  border: 2px solid var(--panel-solid);
  animation: popIn .3s var(--m-spring) both;
}
.dock-badge:empty { display: none; }

/* Док уходит вниз, когда поверх него что-то открыто или идёт выбор. */
body.no-scroll .mnav,
body.sel-on .mnav { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }

/* ================================================================ выбор */

/* Панель выбора занимает место дока: внизу одновременно живёт что-то
   одно. Первая строка — сколько выбрано, вторая — действия поровну. */
.selbar {
  left: 12px; right: 12px; bottom: calc(10px + var(--sb)); transform: none;
  width: auto; max-width: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 10px 10px; border-radius: 24px; overflow: visible;
  background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--sheen);
  animation: dockIn .34s var(--m-spring) both;
}
@keyframes dockIn { from { opacity: 0; transform: translateY(26px); } }
.selbar [data-clear] { width: 40px; height: 40px; border-radius: 14px; background: var(--panel-2); color: var(--text); }
.selbar b { flex: 1; font-size: 14.5px; padding: 0 2px; }
/* Разделитель из настольной версии здесь работает переносом строки. */
.selbar .sep { display: block; width: 100%; height: 0; background: none; }
.selbar .btn {
  flex: 1 1 0; min-width: 0; height: 46px; padding: 0 6px; gap: 6px;
  border-radius: 16px; font-size: 12.5px; font-weight: 600;
  background: var(--panel-2); border-color: var(--border);
}
.selbar .btn svg { width: 17px; height: 17px; }
.selbar .btn-danger { background: rgba(255, 122, 122, .12); border-color: rgba(255, 122, 122, .26); }

/* ================================================================ листы (меню и диалоги) */

.sheet-back {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: flex-end;
  background: var(--scrim);
  backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%);
  animation: fadeIn .22s var(--ease) both;
  padding: 0 8px calc(8px + var(--sb));
}
.sheet-back.out { animation: fadeOut .2s var(--ease) forwards; }

.sheet {
  width: 100%; display: grid; gap: 8px;
  animation: sheetIn .38s var(--m-spring) both;
  will-change: transform;
}
.sheet-back.out .sheet { animation: sheetOut .2s var(--ease) forwards; }
@keyframes sheetIn  { from { transform: translateY(102%); } }
@keyframes sheetOut { to   { transform: translateY(102%); } }

.sheet-card {
  border-radius: var(--m-r-sheet); overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}
.sheet-grab {
  height: 22px; display: grid; place-content: center; touch-action: none; cursor: grab;
}
.sheet-grab::before { content: ''; width: 38px; height: 4px; border-radius: 99px; background: var(--border-strong); }

/* 20px — та же левая линия, что у пунктов ниже (6px у списка + 14px
   внутри кнопки): иначе значок в шапке стоит на два пикселя левее. */
.sheet-head {
  display: flex; align-items: center; gap: 13px;
  padding: 4px 20px 15px; border-bottom: 1px solid var(--border);
}
.sheet-head .sh-ico {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 15px;
  display: grid; place-content: center;
  background: color-mix(in srgb, var(--tint, var(--accent-1)) 15%, transparent);
  color: var(--tint, var(--accent-1));
  overflow: hidden;
}
.sheet-head .sh-ico img { width: 100%; height: 100%; object-fit: cover; }
.sheet-head .sh-tx { min-width: 0; display: grid; gap: 2px; }
.sheet-head b { font-size: 15px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head span { font-size: 12.5px; color: var(--text-3); }

.sheet-list { padding: 6px; max-height: min(62dvh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.sheet-list button {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: 16px;
  font-size: 15px; font-weight: 550; color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast) var(--m-spring);
}
.sheet-list button:active { background: var(--active); transform: scale(.985); }
.sheet-list button svg { width: 21px; height: 21px; flex: 0 0 auto; color: var(--text-2); }
.sheet-list button.danger, .sheet-list button.danger svg { color: var(--danger); }
.sheet-list button.on svg { color: var(--accent-1); }
.sheet-list hr { border: none; border-top: 1px solid var(--border); margin: 5px 14px; }
.sheet-list .label {
  padding: 12px 14px 6px; font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .07em;
}

.sheet-cancel {
  height: 54px; border-radius: 22px; width: 100%;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  font-size: 15.5px; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--m-spring);
}
.sheet-cancel:active { transform: scale(.975); }

/* Меню-«десктопное» на телефоне не показывается вовсе: его заменяет лист. */

/* -------- диалоги как листы */

.modal-back { padding: 0; align-items: flex-end; overflow: hidden; }
.modal {
  width: 100%; margin: 0;
  border-radius: var(--m-r-sheet) var(--m-r-sheet) 0 0;
  border-bottom: 0;
  padding: 0 18px calc(20px + var(--sb));
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  gap: 16px;
  animation: sheetIn .4s var(--m-spring) both;
  will-change: transform;
}
.modal-back.out .modal { animation: sheetOut .22s var(--ease) forwards; }
.modal.wide { width: 100%; }
/* Хваталка живёт в потоке и прилипает к верху при прокрутке содержимого. */
.modal .m-grab {
  position: sticky; top: 0; z-index: 3; margin: 0 -18px 2px;
  height: 26px; display: grid; place-content: center; touch-action: none;
  background: linear-gradient(180deg, var(--panel-solid) 62%, transparent);
}
.modal .m-grab::before { content: ''; width: 38px; height: 4px; border-radius: 99px; background: var(--border-strong); }
.modal-head h3 { font-family: var(--fd); font-size: 19px; letter-spacing: -.035em; }
.modal-foot { position: sticky; bottom: 0; padding-top: 4px; background: var(--panel-solid); }
.modal-foot .btn { flex: 1; height: 48px; border-radius: 15px; font-size: 15px; }
/* Распорка нужна, только когда кнопок три и одну надо отодвинуть влево. */
.modal-foot:not(:has(.btn:nth-of-type(3))) .spacer { display: none; }
.modal-foot .btn[data-close], .modal-foot .btn:not(.btn-primary):not(.btn-danger) { background: var(--panel-2); }
.modal .input { height: 48px; border-radius: 14px; font-size: 16px; }
.modal .tabs { padding: 4px; border-radius: 16px; }
.modal .tabs button { height: 40px; border-radius: 12px; }
.modal .tree { max-height: 46dvh; }
.modal .tree button { padding: 13px 12px; border-radius: 13px; font-size: 15px; }
.modal .swatch { width: 44px; height: 44px; }
.modal .copybox .input { font-size: 12px; }
.modal .link-row label { font-size: 13.5px; }
.modal .link-row label span { display: block; }
.modal .hint { font-size: 12.5px; }
/* На 390 px имя домена съедает всё поле — оставляем только /s/. */
.modal .slug-pre b { display: none; }
.modal .slug-pre { padding-left: 12px; font-size: 13px; }
.modal .slugbox .input { font-size: 13px; height: 48px; }

/* ================================================================ просмотр файла */

.viewer { grid-template-rows: 1fr; background: #000; }
[data-theme="light"] .viewer { background: var(--bg); }

.viewer-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  padding: calc(10px + var(--st)) 10px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent);
  border-bottom: 0; backdrop-filter: none;
  transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.viewer-bar .tx b, .viewer-bar .tx span { color: #fff; }
.viewer-bar .tx span { color: rgba(255, 255, 255, .62); }
.viewer-bar .icon-btn, .viewer-bar .btn { color: #fff; }
.viewer-bar .icon-btn:active { background: rgba(255, 255, 255, .14); }

.viewer-body { padding: 0; min-height: 100dvh; align-content: center; }
.viewer-body img { max-height: 100dvh; border-radius: 0; box-shadow: none; }
.viewer-body video { max-height: 100dvh; border-radius: 0; }
.viewer-body pre { width: 100%; max-height: 100dvh; border-radius: 0; border: 0; padding: calc(74px + var(--st)) 16px 40px; font-size: 12.5px; }
.viewer-body iframe { width: 100%; height: 100dvh; border-radius: 0; }
.viewer-body .empty { padding-top: calc(90px + var(--st)); }

/* Стрелки прячем: листаем свайпом, кнопки только закрывают кадр. */
.viewer-nav { display: none; }
.viewer.chrome-off .viewer-bar { opacity: 0; transform: translateY(-14px); pointer-events: none; }
.viewer .v-hint {
  position: fixed; left: 0; right: 0; bottom: calc(18px + var(--sb)); z-index: 3;
  text-align: center; font-size: 12px; color: rgba(255, 255, 255, .5);
  transition: opacity var(--t-mid) var(--ease);
}
.viewer.chrome-off .v-hint { opacity: 0; }
.viewer .v-count {
  display: inline-flex; padding: 5px 11px; border-radius: 99px;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px);
}

/* ================================================================ мелочи */

.toasts { top: auto; bottom: calc(var(--m-floor) + 6px); left: 12px; right: 12px; justify-items: stretch; }
.toast { max-width: none; border-radius: 18px; padding: 14px 16px; animation: toastUp .34s var(--m-spring) both; }
.toast.out { animation: toastDown .22s var(--ease) forwards; }
@keyframes toastUp   { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes toastDown { to   { opacity: 0; transform: translateY(20px) scale(.96); } }

/* barIn в app.css заканчивается на translate(-50%, 0) — он рассчитан на
   панель, которую центрируют через left: 50%. Лоток стоит на left/right,
   поэтому ему нужна своя анимация, иначе он уезжает влево на пол-ширины. */
.tray {
  left: 12px; right: 12px; width: auto; bottom: calc(var(--m-floor) + 6px);
  border-radius: 22px; transform: none;
  animation: trayIn .34s var(--m-spring) both;
}
@keyframes trayIn { from { opacity: 0; transform: translateY(24px); } }
.tray-head { padding: 14px 16px; }
.tray-item { padding: 11px 16px; }
/* Облачная синхронизация на телефоне: во время загрузки поднос — это всё,
   что видно, поэтому сцена крупнее, а шапка просторнее. Смещения внутри
   сцены растут вместе с ней, иначе лист влетал бы мимо облака. */
.tray-hero { padding: 22px 18px 18px; gap: 12px; }
.tray-x { top: 11px; right: 11px; }
.usync { width: 148px; height: 124px; }
.usync-cloud { width: 96px; height: 64px; }
.usync-file { bottom: 30px; }
.usync-dot { bottom: 46px; }
.usync-shelf { bottom: 15px; }
.usync-name { font-size: 15px; }
.usync-meta { font-size: 12px; }


/* Тянем вниз — обновляем. Индикатор ведёт mobile.js. */
.ptr {
  position: fixed; top: calc(var(--st) + 6px); left: 50%; z-index: 26;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-content: center; pointer-events: none;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm); color: var(--accent-1);
  opacity: 0; transform: translate(-50%, -16px) scale(.7);
}
.ptr svg { width: 19px; height: 19px; }
.ptr.spin svg { animation: spin .8s linear infinite; }

.dropzone { display: none !important; }

/* ================================================================ витрина */

/* Шапка витрины на 390 px: три блока в одну строку помещаются только
   если ни один не переносится и подписи ужаты. Логотип не сокращаем —
   это единственное место, где вообще написано, чей это сервис. */
.lnav { height: 54px; }
.lnav .wrap { gap: 8px; padding-inline: var(--m-gut); }
/* Якорные ссылки уезжают: те же разделы есть в подвале. */
.lnav-links { display: none; }
.lnav-act { gap: 6px; flex: 0 0 auto; }
.lnav-act .btn { height: 36px; padding: 0 13px; font-size: 13px; border-radius: var(--r-pill); }
.lnav-act .btn-ghost { padding: 0 8px; }
.lnav .brand { flex: 0 1 auto; min-width: 0; gap: 8px; }
.lnav .brand-mark { width: 28px; height: 28px; }
.lnav .brand-tx { min-width: 0; }
.lnav .brand-tx b { font-size: 14px; white-space: nowrap; }
.lnav .brand-tx small { display: none; }

/* Сцена лежит фиксированным слоем на весь экран, поэтому «развести»
   текст и карточки можно только по вертикали: текст занимает верх
   экрана, 3D-облако — низ. */
.hero { min-height: 86dvh; align-items: flex-start; padding-block: 22px 30px; }
.hero::before { left: -30%; top: -22%; width: 130%; }
.hero-grid { gap: 0; }
.hero h1 { font-size: clamp(36px, 10.6vw, 50px); letter-spacing: -.05em; line-height: .98; margin-bottom: 18px; }
.hero .lede { font-size: 15.5px; line-height: 1.58; margin-bottom: 24px; max-width: none; }
.hero-cta { flex-direction: column; gap: 9px; margin-bottom: 26px; }
.hero-cta .btn { width: 100%; height: 52px; border-radius: 16px; font-size: 15.5px; }
/* Вторая кнопка полупрозрачная, и сквозь неё просвечивают карточки сцены. */
.hero-cta .btn:not(.btn-primary) {
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
}

/* Факты — сетка плиток на волосяных линиях: тот же текст, но он держит
   низ первого экрана, а не рассыпается в строку через запятую. */
/* Плитки лежат прямо поверх 3D-сцены, поэтому у них своя подложка:
   иначе цифры читаются сквозь пролетающие карточки. */
.hero-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
}
.hero-facts span { padding: 13px 14px; gap: 9px; font-size: 12.5px; }
.hero-facts span:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.hero-facts span:nth-child(odd) { border-right: 1px solid var(--border); }
.hero-facts b { font-size: 12.5px; }

.act { height: 240vh; }
/* Сетка собирается в нижней половине экрана (см. offsetY в scene.js),
   поэтому подпись занимает верхнюю — иначе она ложится прямо на карточки. */
.act-pin { align-content: start; padding-top: calc(66px + var(--st)); }
.act-cap { padding-inline: var(--m-gut); }
/* Подпись акта — стеклянная карточка: сквозь неё видно сцену, но текст
   остаётся читаемым на любой из четырнадцати карточек. */
.act-steps, .act-track {
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
}
.act-steps {
  min-height: 126px; padding: 18px 18px 12px;
  border-radius: var(--m-r-lg) var(--m-r-lg) 0 0; border-bottom: 0;
}
.act-step { inset: 18px 18px auto; max-width: none; }
.act-step h3 { font-size: 22px; margin-bottom: 7px; }
.act-step p { font-size: 14px; }
.act-track {
  margin: 0; padding: 0 18px 16px; gap: 6px;
  border-radius: 0 0 var(--m-r-lg) var(--m-r-lg); border-top: 0;
}
.act-track i { flex: 1; width: auto; }

.sect { padding-block: 62px; }
.sect-head { margin-bottom: 26px; }
.sect-head .ds-2 { font-size: clamp(27px, 8vw, 38px); letter-spacing: -.045em; }
.sect-head p { font-size: 15px; margin-top: 11px; }

.split, .stack { gap: 12px; }
.panel { border-radius: var(--m-r-lg); padding: 22px 20px; }
.panel h3 { font-size: 17.5px; }
.panel p { font-size: 14.5px; max-width: none; }

/* Внутри панели на телефоне — телефон, а не окно браузера. */
.frame.frame-p {
  margin-top: 24px; border: 0; background: transparent; box-shadow: none;
  max-height: none; -webkit-mask-image: none; mask-image: none;
  display: grid; justify-items: center; overflow: visible; border-radius: 0;
}

.pshot {
  width: min(248px, 76%);
  border-radius: 34px; padding: 7px;
  background: linear-gradient(170deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 42%, rgba(0, 0, 0, .3));
  box-shadow: 0 22px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .07);
  animation: pshotIn .9s var(--ease-out) both .1s;
}
@keyframes pshotIn { from { opacity: 0; transform: translateY(26px) rotate(-2deg); } }
.pshot-scr {
  position: relative; border-radius: 28px; overflow: hidden;
  background: var(--bg); border: 1px solid rgba(255, 255, 255, .06);
  padding: 12px 11px 0; display: grid; gap: 11px;
  aspect-ratio: 9 / 18.5;
}
.pshot-pill {
  position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 6px; border-radius: 99px; background: rgba(0, 0, 0, .6);
}
.pshot-rail { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.pshot-rail .pshot-mark { width: 17px; height: 17px; border-radius: 5px; background: var(--accent-1); flex: 0 0 auto; }
.pshot-rail b { font-size: 9px; font-weight: 600; letter-spacing: -.02em; }
.pshot-rail i { margin-left: auto; width: 15px; height: 15px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); }
.pshot-rail i:last-child { background: var(--accent-1); border-color: transparent; }
.pshot-h { font-family: var(--fd); font-size: 15px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.pshot-h span { display: block; font-family: var(--font); font-size: 8px; font-weight: 400; color: var(--text-3); letter-spacing: 0; margin-top: 3px; }
.pshot-find { height: 22px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); display: flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 7.5px; color: var(--text-3); }
.pshot-find svg { width: 10px; height: 10px; flex: 0 0 auto; }
.pshot-store { border: 1px solid var(--border); border-radius: 13px; padding: 9px; display: grid; gap: 7px; background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent); }
.pshot-store b { font-family: var(--fd); font-size: 11px; font-weight: 600; letter-spacing: -.03em; }
.pshot-store b em { font-style: normal; font-size: 7.5px; color: var(--text-3); font-family: var(--font); font-weight: 400; margin-left: 4px; }
.pshot-bar { display: flex; gap: 1.5px; height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.pshot-bar i { display: block; height: 100%; border-radius: 99px; }
.pshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pshot-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.pshot-card u { display: grid; place-content: center; aspect-ratio: 1 / .8; }
.pshot-card u svg { width: 15px; height: 15px; stroke-width: 1.6; }
.pshot-card em { display: block; font-style: normal; font-size: 7px; color: var(--text-2); padding: 5px 6px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pshot-dock {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  height: 34px; border-radius: 13px; display: flex; align-items: center; justify-content: space-around;
  background: color-mix(in srgb, var(--panel-solid) 84%, transparent);
  border: 1px solid var(--border-strong); backdrop-filter: blur(8px);
}
.pshot-dock i { width: 11px; height: 11px; border-radius: 3px; background: var(--text-3); opacity: .45; }
.pshot-dock i:first-child { background: var(--accent-1); opacity: 1; }
.pshot-dock .up { width: 26px; height: 26px; border-radius: 9px; background: linear-gradient(160deg, var(--accent-2), var(--accent-1)); opacity: 1; margin-top: -9px; box-shadow: 0 4px 10px var(--accent-glow); }

.specs { grid-template-columns: 1fr 1fr; gap: 0; }
.spec { padding: 20px 16px 20px 0; border-bottom: 1px solid var(--border); }
.spec:nth-child(2n) { border-right: 0; padding-right: 0; }
.spec:nth-child(2n+1) { border-right: 1px solid var(--border); padding-right: 16px; }
.spec:nth-last-child(-n+2) { border-bottom: 0; padding-bottom: 0; }
.spec b { font-size: clamp(26px, 8vw, 34px); }
.spec span { font-size: 12.5px; }

.cta-band { border-radius: var(--m-r-lg); padding: 30px 22px 32px; text-align: left; }
.cta-band .ds-2 { font-size: clamp(26px, 8vw, 36px); letter-spacing: -.045em; }
.cta-band .lede { font-size: 15px; margin-block: 12px 22px; }
.cta-band .btn { width: 100%; height: 52px; border-radius: 16px; }

.lfoot { padding-block: 40px calc(30px + var(--sb)); }
.lfoot-grid { grid-template-columns: 1fr 1fr; gap: 26px 20px; margin-bottom: 30px; }
.lfoot-grid > :first-child { grid-column: 1 / -1; }
.lfoot-about { font-size: 13px; max-width: none; }
.lfoot-bot { font-size: 12.5px; }

/* ================================================================ вход и регистрация */

.auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

/* Тёмная витрина остаётся, но превращается в шапку: бренд, обещание и
   три довода лентой. Форма наезжает на неё снизу — как лист в приложении. */
.auth-aside {
  border-right: 0; border-bottom: 0;
  padding: calc(18px + var(--st)) var(--m-gut) 40px;
  background:
    radial-gradient(120% 80% at 82% 0%, var(--accent-glow), transparent 60%),
    linear-gradient(180deg, #0a0b14, #06070a);
}
.auth-aside::before { inset: -46% -30% auto -30%; }
.auth-aside-in { gap: 18px; max-width: none; }
.auth-aside .ds-3 { font-size: clamp(25px, 7.4vw, 32px); letter-spacing: -.045em; line-height: 1.08; }

.auth-points {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--m-gut) * -1); padding: 2px var(--m-gut);
}
.auth-points li {
  flex: 0 0 auto; max-width: 68vw; align-items: center; gap: 9px;
  padding: 9px 14px 9px 11px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
  font-size: 12.5px; line-height: 1.35;
}
.auth-points svg { margin-top: 0; width: 16px; height: 16px; }
.auth-by { font-size: 12px; }

.auth-wrap {
  margin-top: -26px; padding: 26px var(--m-gut) calc(28px + var(--sb));
  background: var(--bg); border-radius: var(--m-r-sheet) var(--m-r-sheet) 0 0;
  border-top: 1px solid var(--border);
  place-items: start stretch;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, .28);
}
.auth-card { width: 100%; gap: 18px; }
.auth-card .head h1 { font-size: 26px; letter-spacing: -.04em; }
.auth-form { gap: 15px; }
.auth-form .input { height: 50px; border-radius: 15px; font-size: 16px; }
.auth-form .btn { height: 52px; border-radius: 16px; font-size: 15.5px; margin-top: 2px; }
.auth-alt { text-align: center; font-size: 14.5px; }
.auth-back {
  position: fixed; top: calc(12px + var(--st)); right: 12px; left: auto; z-index: 10;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px); color: #e9ebf2;
}

/* ================================================================ страница ссылки */

.share-nav { padding: 0 var(--m-gut); height: 58px; }
.share-nav .brand-tx small { display: none; }
.share-main { padding: 0; align-items: start; }
.share-card {
  width: 100%; border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
  background: var(--bg);
}
.share-hero { padding: 30px var(--m-gut) 26px; gap: 13px; }
.share-ico { width: 74px; border-radius: 24px; }
.share-hero h1 { font-size: clamp(19px, 5.4vw, 24px); letter-spacing: -.035em; }
.share-acts { flex-direction: column; gap: 9px; }
.share-acts .btn { width: 100%; height: 50px; border-radius: 16px; font-size: 15px; }
.share-prev { padding: var(--m-gut); }
.share-prev img, .share-prev video { max-height: 46vh; border-radius: 16px; }
.share-prev iframe { height: 58vh !important; border-radius: 16px; }
.share-list { padding: 8px var(--m-gut) var(--m-gut); gap: 4px; }
.share-list .row { background: var(--panel-2); }
.share-foot { padding: 26px var(--m-gut) calc(26px + var(--sb)); font-size: 12.5px; }
