/* Медиа веб-клиента: плитки загрузки, карусель, просмотр, истории, ролики.
 *
 * Отдельный файл, и подключает его только `web.html`: окно программы
 * (index.html) этих частей не грузит и рисует вложения как раньше. Все
 * селекторы здесь начинаются с `mv-` и ничего из app.css / alpha2.css / pwa.css
 * не перекрывают — кроме полоски хода ролика, которая в вебе становится
 * перемоткой (`.mv-clips .clip-progress.mv-seek`).
 *
 * Цвета — из токенов там, где под ними лежит страница; просмотр, истории и
 * ролики стоят на чёрном в любой теме: снимок на светлом фоне читается хуже,
 * а полоски и подписи поверх кадра — белые с тенью. */

/* ── Плитки вложений в редакторе ─────────────────────────────────────────── */

.mv-tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.mv-tiles[hidden] { display: none; }

.mv-tile {
  position: relative; flex: none;
  width: 104px; height: 104px;
  border: 0; padding: 0;
  border-radius: calc(var(--radius) * 1.1); overflow: hidden;
  background: var(--surface2); color: var(--muted);
  display: grid; place-items: center;
  font: inherit;
}
.mv-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-tile.done { cursor: pointer; }
.mv-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mv-tile-ic { display: grid; place-items: center; width: 100%; height: 100%; }

/* Длительность и знак «видео» в углу плитки и ячейки. */
.mv-badge {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(8, 16, 22, .72); color: #fff;
  font-size: var(--fs-xs); font-weight: 600;
}

/* Ход, ожидание сети, отказ — одной пеленой поверх превью. */
.mv-tile-veil {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; align-content: center; gap: 8px;
  padding: 8px; text-align: center;
  background: rgba(8, 16, 22, .64); color: #fff;
  font-size: var(--fs-xs); line-height: 1.3;
}
.mv-tile.bad .mv-tile-veil { background: color-mix(in srgb, var(--bad) 55%, rgba(8, 16, 22, .75)); }
.mv-tile-veil .btn.tiny { min-height: 30px; }

/* Кольцо хода: доля — в --p (0…100). */
.mv-ring-wrap { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.mv-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#fff calc(var(--p, 0) * 1%), rgba(255, 255, 255, .25) 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
  mask: radial-gradient(circle, transparent 58%, #000 60%);
}
.mv-ring-wrap b { position: relative; font-size: var(--fs-xs); }

.mv-tile-x {
  position: absolute; top: 5px; right: 5px; z-index: 4;
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 13, 16, .62); color: #dce1e6;
  font-size: 14px; line-height: 1;
}
.mv-tile-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 4px 8px; font-size: var(--fs-xs); color: #dce1e6; text-align: left;
  background: linear-gradient(transparent, rgba(10, 13, 16, .7));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mv-tile-add {
  border: 1px dashed var(--line-strong); background: transparent; color: var(--muted);
  cursor: pointer; gap: 4px; align-content: center;
}
.mv-tile-add:hover { background: var(--surface2); }
.mv-tile-add small { font-size: var(--fs-xs); }

/* ── Порядок, обложка, перетаскивание ────────────────────────────────────── */

/* Полоса управления плиткой: «левее · обложка · правее».
 *
 * Внизу плитки, а не поверх снимка: наверху уже стоит крестик, и три кнопки
 * рядом с ним превратили бы плитку в панель приборов. Полоса тёмная в любой
 * теме — она лежит на фотографии, а не на странице. */
.mv-tile-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: stretch;
  background: linear-gradient(transparent, rgba(8, 16, 22, .82) 42%);
}
.mv-bar-btn {
  flex: 1 1 0; min-width: 0; min-height: 28px;
  border: 0; background: transparent; color: #eef2f5;
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  padding: 4px 0 8px;
}
.mv-bar-btn[disabled] { opacity: .3; cursor: default; }
.mv-bar-btn:not([disabled]):hover { background: rgba(255, 255, 255, .14); }
.mv-bar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Отмеченная обложка — залитая звезда, а не «чуть ярче»: это состояние, и
   различать его надо не приглядываясь. */
.mv-bar-btn.mv-cover[aria-pressed="true"] { color: var(--accent); text-shadow: 0 0 10px rgba(0, 0, 0, .6); }

/* Лицо записи. Рамка по всей плитке, потому что вопрос «какая из них
   обложка» задают глядя на всю раскладку, а не на один угол. */
.mv-tile.cover { box-shadow: inset 0 0 0 2px var(--accent); }
.mv-tile.cover::before {
  content: '★'; position: absolute; top: 5px; left: 5px; z-index: 4;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--bg);
  font-size: 12px; line-height: 1;
}

.mv-tile.dragging { opacity: .45; }
.mv-tile.over { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Подпись поднимается над полосой управления, когда полоса есть. Без :has()
   (старые браузеры) она останется под полосой — читается хуже, но ничего не
   ломает: полоса полупрозрачна сверху. */
.mv-tile:has(.mv-tile-bar) .mv-tile-name { bottom: 30px; background: rgba(8, 16, 22, .55); }

/* Телефон: плитки крупнее — палец должен попадать в крестик, «Повторить» и в
   стрелки порядка. Полоса управления тоже выше: 34 пикселя — это минимум,
   в который попадает палец, не задев соседнюю кнопку. */
@media (max-width: 700px) {
  .mv-tile { width: 118px; height: 118px; }
  .mv-bar-btn { min-height: 34px; font-size: 17px; }
  .mv-tile:has(.mv-tile-bar) .mv-tile-name { bottom: 36px; }
}

/* ── Полоса состояния загрузки над кнопками редактора ────────────────────── */

/* Одна строка на весь набор: «идёт 2 из 5» или «один файл не доехал».
 *
 * Плитки говорят каждая за себя, и этого мало: когда их десять, человек не
 * пересчитывает кольца, он хочет знать, можно ли уже публиковать. Повтор здесь
 * трогает **только упавшие** — доехавшие лежат на сервере и второй раз не
 * поедут. */
.mv-upload-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 8px 0 0; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface2); color: var(--muted);
  font-size: var(--fs-sm);
}
.mv-upload-note.bad { border-color: var(--bad); color: var(--text); }
.mv-upload-note .grow { flex: 1 1 120px; }
.mv-upload-note[hidden] { display: none; }


/* ── Вложения в карточке ─────────────────────────────────────────────────── */

.mv-block { margin-top: 12px; border-radius: var(--r-md); overflow: hidden; }
.mv-cell {
  position: relative; display: block; width: 100%;
  border: 0; padding: 0; margin: 0;
  background: var(--surface2); color: var(--text); text-align: left;
  font: inherit;
}
.mv-shot { cursor: zoom-in; overflow: hidden; max-height: 560px; }
.mv-shot img { display: block; width: 100%; height: 100%; max-height: 560px; object-fit: cover; }
/* Форма неизвестна (старая запись) — снимок как есть, но не выше экрана. */
.mv-block .mv-shot:not([style*="aspect-ratio"]) img { height: auto; max-height: 460px; }
.mv-note {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 8px 12px; font-size: var(--fs-sm); color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  pointer-events: none;
}

.mv-video { background: #000; overflow: hidden; }
.mv-video > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mv-video video { display: block; width: 100%; height: 100%; max-height: 560px; background: #000; }
.mv-video-empty { display: grid; place-items: center; width: 100%; height: 100%; min-height: 180px; color: #9aa4ad; }
.mv-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 64px; height: 64px; border: 0; border-radius: 50%;
  background: rgba(8, 16, 22, .62); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.mv-play:hover { background: rgba(8, 16, 22, .82); }
.mv-expand {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(8, 16, 22, .55); color: #fff;
  display: grid; place-items: center;
}
.mv-video .mv-badge { left: auto; right: 8px; bottom: 8px; }

.mv-audio {
  padding: 12px; display: grid; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.mv-audio audio { width: 100%; }
.mv-file {
  min-height: 72px; padding: 12px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); text-decoration: none;
}

/* Карусель: одна на экран, прилипание, точки, стрелки для мыши. */
.mv-car {
  position: relative; margin-top: 12px;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--surface2);
}
.mv-track {
  display: flex; max-height: 560px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  outline: none;
}
.mv-track::-webkit-scrollbar { display: none; }
.mv-track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mv-slide {
  position: relative; flex: 0 0 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; place-items: center;
  background: #0d1418;
}
.mv-slide .mv-cell { width: 100%; height: 100%; }
.mv-slide .mv-shot img,
.mv-slide .mv-video > img,
.mv-slide .mv-video video { object-fit: contain; height: 100%; max-height: none; }
.mv-slide .mv-audio,
.mv-slide .mv-file { align-self: center; width: min(100%, 420px); margin: 12px; border: 0; }
.mv-count {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(8, 16, 22, .62); color: #fff;
  font-size: var(--fs-xs); font-weight: 600;
}
.mv-dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2;
  display: flex; justify-content: center; gap: 4px;
  pointer-events: none;
}
.mv-dot {
  width: 7px; height: 7px; border: 0; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .55); pointer-events: auto;
}
.mv-dot.on { background: #fff; }
.mv-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mv-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(8, 16, 22, .55); color: #fff;
  display: grid; place-items: center;
  opacity: 0; transition: opacity var(--fast) ease;
}
.mv-arrow.prev { left: 8px; }
.mv-arrow.next { right: 8px; }
.mv-car:hover .mv-arrow, .mv-car:focus-within .mv-arrow { opacity: 1; }
.mv-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .mv-arrow { display: none; } }

/* ── Полноэкранный просмотр ──────────────────────────────────────────────── */

/* Без z-index намеренно: слои внутри #modals идут порядком в документе, и
 * подтверждение, открытое из просмотра, обязано лечь поверх него. */
.mv-view {
  position: fixed; inset: 0; pointer-events: auto;
  --veil: 1;
  background: rgba(6, 9, 12, calc(var(--veil) * .96));
  color: #fff;
}
.mv-stage {
  position: absolute; inset: 0;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior: contain;
  /* Горизонталь — браузеру (смахивание между снимками), вертикаль и щипок —
   * нам: потянуть вниз — закрыть, свести пальцы — приблизить. */
  touch-action: pan-x;
}
.mv-stage::-webkit-scrollbar { display: none; }
.mv-stage.zoomed { overflow: hidden; touch-action: none; }
.mv-vslide {
  flex: 0 0 100%; height: 100%; box-sizing: border-box;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; place-items: center;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 0 calc(56px + env(safe-area-inset-bottom, 0px));
}
.mv-zoom { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.mv-full {
  max-width: 100%; max-height: 100%; object-fit: contain;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transform-origin: center; transition: transform .08s linear; will-change: transform;
}
.mv-stage.zoomed .mv-full { transition: none; }
.mv-vfull { max-width: 100%; max-height: 100%; background: #000; }
.mv-view-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent);
}
.mv-icon {
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #fff;
  display: grid; place-items: center; cursor: pointer; text-decoration: none;
}
.mv-icon:hover { background: rgba(255, 255, 255, .2); }
.mv-icon:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mv-view-count { font-weight: 600; font-size: var(--fs-sm); padding: 0 8px; }
.mv-varrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  display: grid; place-items: center;
}
.mv-varrow.prev { left: 12px; }
.mv-varrow.next { right: 12px; }
.mv-varrow[hidden] { display: none; }
@media (hover: none) { .mv-varrow { display: none; } }
.mv-view-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  font-size: var(--fs-sm); line-height: 1.4; pointer-events: none;
}
.mv-view-cap[hidden] { display: none; }
.mv-cap-note { margin: 0; }
.mv-cap-alt { margin: 4px 0 0; opacity: .8; }

/* ── Истории ─────────────────────────────────────────────────────────────── */

.mv-story {
  position: fixed; inset: 0; pointer-events: auto;
  background: #000; color: #fff;
  display: grid; place-items: center;
}
.mv-story-box {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: #000;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
/* На широком экране история стоит телефоном по центру, а не растягивается. */
@media (min-width: 701px) {
  .mv-story { background: rgba(6, 9, 12, .94); }
  .mv-story-box {
    width: min(440px, calc(100vh * 9 / 16)); height: min(100vh, calc(440px * 16 / 9));
    border-radius: var(--r-lg);
  }
}
.mv-story-media { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
/* Размытая подложка из того же снимка: чёрные поля по бокам вертикального
 * кадра выглядят как обрыв, а не как рамка. */
.mv-story-back {
  position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px);
  object-fit: cover; filter: blur(26px) brightness(.5);
}
.mv-story-shot { position: relative; width: 100%; height: 100%; object-fit: contain; }
.mv-story-box.textual .mv-story-media { background: linear-gradient(160deg, #3056C9, #1F2A5F); }
.mv-story-shade { position: absolute; left: 0; right: 0; height: 140px; z-index: 1; pointer-events: none; }
.mv-story-shade.top { top: 0; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.mv-story-shade.bottom { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }

.mv-story-ticks {
  position: absolute; z-index: 3;
  top: calc(8px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px;
  display: flex; gap: 4px;
}
.mv-story-ticks span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.mv-story-ticks span::after {
  content: ""; display: block; height: 100%; background: #fff;
  width: calc(var(--p, 0) * 100%);
}
.mv-story-ticks span.done::after { width: 100%; }

.mv-story-head {
  position: absolute; z-index: 3;
  top: calc(18px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 12px;
}
.mv-story-head .avatar { border: 2px solid rgba(255, 255, 255, .7); flex: none; }
.mv-story-head b, .mv-story-head small { text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.mv-story-who { border: 0; background: transparent; color: inherit; text-align: left; padding: 0; min-width: 0; font: inherit; }
.mv-story-who b { display: block; font-size: var(--fs-sm); }
.mv-story-who small { display: block; opacity: .85; font-size: var(--fs-xs); }

/* Зоны нажатия — кнопки для диктора и клавиатуры, глазу невидимые. */
.mv-story-tap { position: absolute; top: 0; bottom: 0; z-index: 2; border: 0; background: transparent; opacity: 0; }
.mv-story-tap.left { left: 0; width: 30%; }
.mv-story-tap.right { right: 0; width: 70%; }
.mv-story-tap:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: -4px; }

.mv-story-body {
  position: absolute; z-index: 3; left: 14px; right: 14px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 12px; pointer-events: none;
}
.mv-story-body > * { pointer-events: auto; }
.mv-story-text {
  margin: 0; font-size: var(--fs-md); line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 40vh; overflow: auto;
}
.mv-story-text.big { font-size: calc(var(--fs-lg) * 1.3); font-weight: 650; text-align: center; }
.mv-story-box.textual .mv-story-body { top: 50%; bottom: auto; transform: translateY(-50%); }
.mv-story-poll { background: rgba(8, 16, 22, .6); border-radius: var(--r-md); padding: 12px; }
.mv-story-link {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .15); color: #fff;
  text-decoration: none; font-size: var(--fs-sm);
}
.mv-story-foot {
  position: absolute; z-index: 3; left: 12px; right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 8px;
}
.mv-story-reply {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(0, 0, 0, .35); color: #fff; font: inherit; font-size: var(--fs-sm);
}
.mv-story-reply::placeholder { color: rgba(255, 255, 255, .72); }
.mv-story-views { opacity: .9; font-size: var(--fs-sm); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.mv-story-del {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .35);
  color: #fff; font: inherit; font-size: var(--fs-sm);
}
.mv-story-paused {
  position: absolute; inset: 0; z-index: 2; display: none; place-items: center;
  pointer-events: none; color: rgba(255, 255, 255, .85);
}
.mv-story-box.paused .mv-story-paused { display: grid; }
.mv-story-box.paused .mv-story-ticks { opacity: .6; }

/* Создание истории: кадр сверху, полоса настроек снизу. */
.mv-story-make-wrap { width: 100%; height: 100%; display: grid; grid-template-rows: 1fr auto; }
@media (min-width: 701px) {
  .mv-story-make-wrap { width: min(440px, calc(100vh * 9 / 16)); height: 100vh; }
  .mv-story-box.make { width: 100%; height: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}
.mv-story-box.make { touch-action: auto; user-select: auto; -webkit-user-select: auto; }
.mv-story-body.make { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.mv-story-cap {
  width: 100%; box-sizing: border-box; border: 0; border-radius: var(--r-md);
  padding: 12px 12px; background: rgba(0, 0, 0, .45); color: #fff;
  font: inherit; font-size: var(--fs-md); resize: none;
}
.mv-story-cap::placeholder { color: rgba(255, 255, 255, .72); }
.mv-story-box.textual .mv-story-cap {
  background: transparent; text-align: center;
  font-size: calc(var(--fs-lg) * 1.3); font-weight: 650;
}
.mv-story-panel {
  background: var(--surface); color: var(--text);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 12px; border-top: 1px solid var(--line);
  max-height: 46vh; overflow: auto;
}
.mv-story-settings { display: grid; gap: 8px; }
.mv-story-row { display: grid; gap: 4px; }
.mv-story-row > small { color: var(--muted); font-size: var(--fs-xs); }
.mv-story-row .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.mv-story-row .chips::-webkit-scrollbar { display: none; }
.mv-story-row .chip { flex: none; }
.mv-story-hint { margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.mv-story-send {
  min-height: 48px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accentText);
  font: inherit; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.mv-story-send[disabled] { opacity: .6; }
.mv-story-progress {
  position: absolute; z-index: 4; left: 12px; right: 12px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  padding: 12px 12px; border-radius: var(--r-md);
  background: rgba(8, 16, 22, .86); color: #fff; font-size: var(--fs-sm);
  display: grid; gap: 8px;
}
.mv-story-progress[hidden] { display: none; }
.mv-story-progress.bad { background: color-mix(in srgb, var(--bad) 40%, rgba(8, 16, 22, .92)); }
.mv-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.mv-bar i { display: block; height: 100%; background: #fff; transition: width var(--fast) linear; }

/* ── Ролики: управление на телефоне ──────────────────────────────────────── */

.mv-clips { outline: none; }
.mv-clips:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Полоска хода становится перемоткой: выше зона касания, та же тонкая линия. */
.mv-clips .clip-progress.mv-seek {
  height: 18px; background: transparent; cursor: pointer;
  display: flex; align-items: flex-end; touch-action: none; z-index: 3;
}
.mv-clips .clip-progress.mv-seek::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255, 255, 255, .25);
}
.mv-clips .clip-progress.mv-seek i { position: relative; z-index: 1; height: 3px; }
.mv-clips .clip-card.seeking .clip-progress.mv-seek i { height: 6px; }
.mv-clips .clip-progress.mv-seek:focus-visible { outline: 2px solid #fff; }

.mv-clip-center, .mv-clip-spin, .mv-clip-heart {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 2;
}
.mv-clip-center {
  display: none; width: 72px; height: 72px; border-radius: 50%;
  background: rgba(8, 16, 22, .55); color: #fff; place-items: center;
}
.clip-card.paused .mv-clip-center { display: grid; }
.mv-clip-spin {
  display: none; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  animation: mv-spin .9s linear infinite;
}
.clip-card.buffering:not(.paused) .mv-clip-spin { display: block; }
@keyframes mv-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.mv-clip-time {
  position: absolute; z-index: 3; left: 14px;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  padding: 4px 8px; border-radius: 999px;
  background: rgba(8, 16, 22, .7); color: #fff; font-size: var(--fs-xs);
  display: none;
}
.clip-card.seeking .mv-clip-time { display: block; }
.mv-clip-error {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center; align-content: center; gap: 12px;
  padding: 20px; text-align: center;
  background: rgba(8, 16, 22, .8); color: #fff;
}
.mv-clip-error[hidden] { display: none; }
.mv-clip-error p { margin: 0; }
.mv-clip-heart { color: #fff; opacity: 0; }
.mv-clip-heart.go { animation: mv-heart .7s ease-out; }
@keyframes mv-heart {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Создание ролика: превью, кадр обложки рядом с ползунком, ход отправки. */
.mv-clip-make { display: grid; gap: 12px; }
.mv-clip-cover-row { display: flex; gap: 12px; align-items: center; }
.mv-clip-cover-row .clip-cover { width: 84px; height: auto; max-height: 150px; flex: none; }
.mv-range { width: 100%; accent-color: var(--accent); }
.mv-upbar {
  display: grid; gap: 8px; padding: 12px 12px;
  border-radius: var(--r-md); background: var(--surface2); font-size: var(--fs-sm);
}
.mv-upbar[hidden] { display: none; }
.mv-upbar .mv-bar { background: var(--line); }
.mv-upbar .mv-bar i { background: var(--accent); }
.mv-upbar.bad { background: color-mix(in srgb, var(--bad) 18%, var(--surface2)); }

/* ── Вложение как содержимое, а не как приложение к тексту ────────────────────
 *
 * Второй слой того же файла, из той же задачи, что и «плотная лента» в
 * `home.css`: «крупнее полезный медиаконтент», «карточки читаются как
 * содержимое». Разметку и поведение (`media.js`) это не трогает — ни одного
 * нового узла, ни одного нового обработчика.
 *
 * Что изменено и почему:
 *
 *  • Снимок стал выше: 640 вместо 560 в кадре с известной формой и 520 вместо
 *    460 у старой записи без неё. При ленте в 700 точек прежние 560 обрезали
 *    вертикальный кадр ровно посередине — то есть портили именно тот снимок,
 *    ради которого запись и открывают.
 *  • Волосок по краю кадра. В тёмной теме снимок и так отделён от подложки, а
 *    в светлой белое небо втекало в `--surface` без границы, и фотография
 *    теряла форму. Волосок — `inset`, а не рамка: он не двигает раскладку и не
 *    спорит со скруглением. Его толщина и цвет взяты не на глаз: ровно то же
 *    самое фирменный слой делает вложению в окне программы (`brand.css`,
 *    `.post-media::after`), и второе число здесь означало бы два разных края
 *    у одного и того же снимка.
 *  • Подписи, счётчик и длительность — на размытой подложке. Плоская тёмная
 *    плашка поверх пёстрого кадра читалась пятном грязи; размытие отделяет её
 *    от снимка, не затемняя его.
 *  • Точка выбранного кадра — капсулой, а не точкой того же размера: сколько
 *    их всего, видно и так, а какая сейчас — было заметно только цветом.
 *
 * Цвета поверх кадра остаются собственными (белый и почти чёрный): под ними
 * лежит чужая фотография, а не тема. Всё, что лежит на странице — рамки,
 * подложки звука и файла, — берётся из токенов.
 */

.mv-block, .mv-car { margin-top: 8px; }

/* Волосок по краю кадра — отдельным слоем поверх, а не `inset`-тенью самого
 * блока: внутренняя тень рисуется под содержимым, и снимок закрыл бы её
 * целиком. Слой не ловит нажатия и не участвует в раскладке. */
.mv-block { position: relative; }
.mv-block::after, .mv-car::after {
  content: ""; position: absolute; inset: 0; z-index: 4;
  pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
}

.mv-shot { max-height: 640px; }
.mv-shot img { max-height: 640px; }
.mv-block .mv-shot:not([style*="aspect-ratio"]) img { max-height: 520px; }
.mv-video video { max-height: 640px; }
.mv-track { max-height: 640px; }

/* Подпись под кадром — крупнее и с тенью: поверх светлого неба белый текст
 * без тени пропадал, а одной заливки снизу для этого мало. */
.mv-note {
  padding: 12px 16px 12px;
  font-weight: 500; text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}

/* Заливка не ослаблена (те же .62–.72, что и были): размытие добавлено сверх
 * неё, а не вместо — иначе белая цифра над светлым небом теряет контраст
 * ровно там, где её и читают. */
.mv-badge, .mv-count {
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

/* Кнопка воспроизведения: круг того же вида, что и остальные знаки поверх
 * кадра, но крупнее — это главное действие на видео. */
.mv-play {
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.mv-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.mv-expand { backdrop-filter: blur(10px); }

/* Точки карусели: выбранная — капсула. */
.mv-dots { bottom: 10px; gap: 8px; }
.mv-dot { transition: width var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.mv-dot.on { width: 18px; border-radius: 999px; }

/* Звук и файл лежат на странице, а не на кадре: у них подложка темы и тот же
 * ритм полей, что у остальных блоков карточки. */
.mv-audio, .mv-file {
  border-color: transparent;
  background: var(--surface2);
  border-radius: var(--r-md);
}
.mv-file { min-height: 64px; color: var(--text); }
.mv-file:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface2)); }

/* ── Меньше движения ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .mv-full, .mv-bar i, .mv-arrow, .mv-dot, .mv-play { transition: none; }
  .mv-play:hover { transform: translate(-50%, -50%); }
  .mv-clip-heart.go { animation: none; opacity: 1; }
  .mv-clip-spin { animation-duration: 2s; }
}
