/* ===== Моменты: гиперкольцо вокруг аватарки, viewer, композер ===== */

/* --- Кольцо --- */
.moment-ring-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
  border-radius: 50%;
}
.moment-ring-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg,
    #7939f2, #b16cff, #72cbf1, #1c58d9, #7939f2);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  opacity: 0;
  transition: opacity 0.25s ease;
}
/* Есть непросмотренные — гиперкольцо крутится. */
.moment-ring-wrap.is-live::before {
  opacity: 1;
  animation: moment-ring-spin 3.6s linear infinite;
}
/* Моменты есть, всё просмотрено — спокойный градиент. */
.moment-ring-wrap.is-viewed::before {
  opacity: 0.55;
}
/* Моментов нет — кольца нет, остаётся обычная аватарка. */
/* Публикация момента: крутящийся синий ореол — загрузка/конвертация в фоне. */
.moment-ring-wrap.is-publishing::before {
  opacity: 1;
  background: conic-gradient(from 0deg, #1c58d9, #72cbf1, #1c58d9);
  animation: moment-ring-spin 1.1s linear infinite;
}
/* Стрелки загрузки, как у медиа в чате, поверх своей аватарки. */
.moment-publish {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: 50%;
}
.moment-publish .msg-upload-hyper {
  width: 100%;
  height: 100%;
  background: rgba(12, 18, 40, 0.34);
}
.moment-publish .hyper-ring {
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 68%);
  mask: radial-gradient(circle, transparent 62%, #000 68%);
}
.moment-publish .hyper-chevrons {
  width: 46%;
  height: 46%;
}
@keyframes moment-ring-spin {
  to { transform: rotate(1turn); }
}
.moment-ring-wrap.is-clickable { cursor: pointer; }
.moment-ring-wrap.is-clickable > .avatar { pointer-events: none; }

/* Плюс на своей аватарке — «добавить момент».
   Центр кружка лежит на середине кольца (нижний правый угол, 45°),
   сам крестик собран из двух полос, чтобы не зависеть от метрик шрифта. */
.moment-ring-add {
  position: absolute;
  left: calc(50% + (50% + 2.25px) * 0.70710678);
  top: calc(50% + (50% + 2.25px) * 0.70710678);
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: #7939f2;
  color: transparent;
  font-size: 0;
  line-height: 0;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(20, 24, 40, 0.85);
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
}
.moment-ring-add::before,
.moment-ring-add::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}
.moment-ring-add::before { width: 8px; height: 1.6px; }
.moment-ring-add::after { width: 1.6px; height: 8px; }

/* --- Viewer --- */
.moments-viewer {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(8, 8, 16, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.moments-stage {
  position: relative;
  width: min(480px, 100vw);
  height: min(88vh, 860px);
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  touch-action: none;
  -webkit-touch-callout: none;
}
@media (max-width: 560px) {
  .moments-stage { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .moment-drop { min-height: 96px; }
  .moment-composer {
    justify-content: flex-end;
    padding-top: calc(8px + var(--sat, 0px));
    padding-bottom: calc(8px + var(--sab, 0px) + max(var(--kb-native, 0px), var(--kb-field-inset, 0px)));
  }
  .moment-composer-card {
    padding: 12px 14px 8px;
    width: 100%;
    border-radius: 18px 18px 14px 14px;
  }
  .moment-composer-card h2 {
    margin: 0 0 8px;
    font-size: 17px;
  }
  .moment-reel-view {
    height: min(148px, 22dvh);
  }
  .moment-field { margin-top: 8px; }
  .moment-field.is-caption { margin-top: 8px; }
  .moment-composer-actions {
    margin-top: 8px;
    padding-top: 8px;
    padding-bottom: 2px;
  }
}
.moments-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.moments-media img,
.moments-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.moments-media video.is-pending {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px !important;
  height: 1px !important;
  max-width: 1px;
  max-height: 1px;
  opacity: 0 !important;
  pointer-events: none;
}
.moments-media video::-webkit-media-controls,
.moments-media video::-webkit-media-controls-start-playback-button,
.moments-media video::-webkit-media-controls-overlay-play-button,
.moments-media video::-webkit-media-controls-panel {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none;
}
.moments-video-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}
.moments-video-poster.is-gone { display: none; }
.moments-pause {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 64px;
  height: 64px;
  margin: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.moments-stage.is-paused .moments-pause { display: flex; }
.moments-pause i {
  width: 5px;
  height: 22px;
  border-radius: 2px;
  background: #fff;
}

/* Прогресс-бары сверху. На телефоне сцена на весь экран и заходит под
   статус-бар: env(safe-area-inset-*) в Android WebView равен 0, рабочий
   отступ — --sat / --sab (их ставит приложение). */
.moments-progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.moments-progress .seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.32);
  overflow: hidden;
}
.moments-progress .seg > i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 2px;
}
.moments-progress .seg.done > i { width: 100%; }

/* Шапка viewer'а: автор и время. */
.moments-head {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  color: #fff;
}
.moments-head .avatar {
  width: 34px;
  height: 34px;
}
.moments-head .who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.moments-head .who b {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.moments-head .who span {
  font-size: 12px;
  opacity: 0.75;
}
.moments-head .spacer { flex: 1; }
.moments-icon-btn {
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.moments-icon-btn:hover { background: rgba(0, 0, 0, 0.55); }

/* Подпись. */
.moments-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}

/* Нижняя панель: огонёк, просмотры. Отодвигаем от системной панели телефона. */
.moments-foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}
/* У зрителя подпись в том же ряду, что и огонёк, на месте строки просмотров. */
.moments-foot .moments-caption {
  position: static;
  flex: 1;
  min-width: 0;
  left: auto;
  right: auto;
  bottom: auto;
}
.moments-views,
.moments-fire { pointer-events: auto; }
.moments-fire {
  margin-left: auto;
  border: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 14px;
  transition: transform 0.12s ease, background 0.2s ease;
}
.moments-fire:hover { background: rgba(0, 0, 0, 0.55); }
.moments-fire:active { transform: scale(1.08); }
.moments-fire .anim-emoji,
.moments-fire .moments-fire-emoji {
  position: relative;
  flex: none;
  font-size: 16px;
  width: 18px;
  height: 18px;
  overflow: hidden;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.moments-fire .anim-emoji-play {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.moments-fire .anim-emoji-play svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.moments-fire.is-on {
  background: rgba(255, 106, 0, 0.28);
  box-shadow: 0 0 0 1.5px rgba(255, 138, 42, 0.85) inset;
}
.moments-views {
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.moments-views:hover { background: rgba(0, 0, 0, 0.55); }

/* Зоны тапа. */
.moments-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
}
.moments-tap.prev { left: 0; width: 30%; }
.moments-tap.next { right: 0; width: 70%; }

/* Всплывающий огонёк при реакции. */
.moments-fire-fly {
  position: absolute;
  z-index: 6;
  font-size: 30px;
  pointer-events: none;
  animation: moment-fire-fly 0.9s ease-out forwards;
}
@keyframes moment-fire-fly {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-160px) scale(1.6); opacity: 0; }
}

/* Список «кто посмотрел». */
.moments-sheet {
  touch-action: pan-y;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  max-height: 55%;
  overflow-y: auto;
  background: rgba(18, 18, 28, 0.98);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 20px;
  color: #fff;
}
.moments-stage.is-views-lock .moments-head,
.moments-stage.is-views-lock .moments-foot,
.moments-stage.is-views-lock .moments-tap,
.moments-stage.is-views-lock .moments-progress {
  pointer-events: none;
}
.moments-sheet.is-views {
  display: flex;
  flex-direction: column;
  height: min(55%, 420px);
  overflow: hidden;
  box-sizing: border-box;
}
.moments-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 32px;
  margin: 0 0 10px;
}
.moments-sheet.is-views .moments-sheet-head h3,
.moments-sheet-head h3 {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 32px;
}
.moments-sheet-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.moments-sheet-back {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: grid;
  place-items: center;
  line-height: 0;
  cursor: pointer;
  flex: none;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.moments-sheet-back svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
}
.moments-sheet h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.moments-sheet .viewer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
}
.moments-sheet .viewer-row .avatar { width: 30px; height: 30px; }
.moments-sheet .viewer-fire { font-size: 16px; line-height: 1; }
.moments-sheet .viewer-row time { margin-left: auto; opacity: 0.6; font-size: 12px; }

/* --- Композер момента --- */
.moment-composer.is-editing {
  visibility: hidden;
  pointer-events: none;
}
.moment-composer {
  position: fixed;
  inset: 0;
  z-index: 900;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: rgba(8, 8, 16, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding:
    calc(12px + var(--sat, 0px))
    12px
    calc(12px + var(--sab, 0px) + max(var(--kb-native, 0px), var(--kb-field-inset, 0px)));
}
.moment-composer-card {
  position: relative;
  container-type: inline-size;
  box-sizing: border-box;
  width: min(430px, 100%);
  max-width: 100%;
  max-height: 100%;
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  background: #fff;
  color: #1a1d26;
  color-scheme: light;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.moment-composer-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  flex: none;
}
.moment-drop {
  border: 2px dashed rgba(121, 57, 242, 0.45);
  border-radius: 14px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(90, 90, 120, 0.85);
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: rgba(121, 57, 242, 0.05);
  padding: 10px;
  flex: 0 0 auto;
}
.moment-drop:hover { background: rgba(121, 57, 242, 0.1); }
.moment-drop-empty { padding: 24px 12px; }
.moment-drop.has-items {
  padding: 0;
  min-height: 0;
}
.moment-reel-view {
  display: none;
  position: relative;
  width: 100%;
  height: min(200px, 32vh);
  overflow: hidden;
  touch-action: pan-y;
}
.moment-drop.has-items .moment-reel-view { display: block; }
.moment-drop.has-items .moment-drop-empty { display: none; }
.moment-reel {
  position: absolute;
  inset: 0;
}
.moment-slide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 86%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.18);
  transform: translate(-50%, -50%);
  transition: transform 0.28s ease;
  pointer-events: none;
}
.moment-slide.is-current {
  width: 44%;
  height: 96%;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.32);
  pointer-events: auto;
}
.moment-slide img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  background: #111;
  border-radius: 0;
  pointer-events: none;
}
.moment-slide .moment-edit {
  right: 8px;
  bottom: 8px;
  left: auto;
  top: auto;
  z-index: 5;
}
.moment-edit,
.moment-add {
  position: absolute;
  z-index: 40;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  background: rgba(20, 24, 40, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.moment-drop.has-items .moment-edit:not([hidden]),
.moment-drop.has-items .moment-add:not([hidden]) { display: inline-flex; }
.moment-edit { pointer-events: auto; }
.moment-add {
  top: 10px;
  right: 10px;
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}
.moment-edit[hidden],
.moment-add[hidden] { display: none !important; }
.moment-field { margin-top: 12px; }
.moment-field.is-caption > label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.moment-field.is-caption input[type="text"] {
  padding: 8px 10px;
}
.moment-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.85;
}
.moment-field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(120, 120, 150, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.35;
  background: #fff;
  color: #1a1d26;
  -webkit-text-fill-color: #1a1d26;
  caret-color: #1c58d9;
  color-scheme: light;
  opacity: 1;
}
.moment-field input[type="text"]::placeholder {
  color: #8b909c;
  -webkit-text-fill-color: #8b909c;
  opacity: 1;
}
.moment-field input[type="text"]:focus {
  outline: none;
  border-color: #7939f2;
  box-shadow: 0 0 0 3px rgba(121, 57, 242, 0.16);
}
/* Клавиатура открыта: превью сжимается, подпись остаётся на экране. */
html.kb-field-open .moment-drop,
.moment-composer.is-kb .moment-drop {
  min-height: 72px;
}
html.kb-field-open .moment-reel-view,
.moment-composer.is-kb .moment-reel-view {
  height: min(88px, 16dvh);
}
html.kb-field-open .moment-slide img,
.moment-composer.is-kb .moment-slide img {
  max-height: none;
}
.moment-field.is-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  min-width: 0;
  flex: none;
}
.moment-field.is-choice > label {
  margin: 0 auto 0 0;
  flex: 0 0 auto;
}
/* Капсула всегда у правого края и растёт влево. Если в строку не влезает — на следующую, тоже вправо. */
.moment-choice {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 100%;
}
.moment-choice-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 4px;
  border-radius: 999px;
  background: #eef1f8;
  border: 1px solid #e3e8f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: box-shadow 0.2s ease, gap 0.25s ease;
}
.moment-choice.is-expanded .moment-choice-bar {
  box-shadow: 0 8px 24px rgba(38, 44, 96, 0.14);
}
.moment-choice.is-collapsed .moment-choice-bar { gap: 0; }
.moment-choice-opt {
  appearance: none;
  border: 0;
  background: transparent;
  color: #4a5568;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, max-width 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}
.moment-choice.is-expanded .moment-choice-opt {
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
}
/* Узкая карточка: раскрытый ряд не помещается рядом с подписью — уходит на свою строку, всё ещё от правого края. */
@container (max-width: 410px) {
  .moment-choice.is-expanded {
    flex: 1 0 100%;
    min-width: 0;
  }
  .moment-choice.is-expanded .moment-choice-opt {
    padding: 7px 8px;
    font-size: 12.5px;
  }
}
.moment-choice.is-collapsed .moment-choice-opt:not(.is-active) {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
button.moment-choice-opt { cursor: pointer; }
.moment-choice-opt.is-active {
  background: #fff;
  color: #1c58d9;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12), 0 4px 12px rgba(28, 88, 217, 0.12);
}
.moment-choice.is-expanded .moment-choice-opt:hover:not(.is-active) {
  color: #1c58d9;
  background: rgba(255, 255, 255, 0.45);
}
.moment-hide-jump {
  margin-left: auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}
.moment-hide-jump .moment-choice-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 168px;
  cursor: pointer;
}
.moment-hide-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.moment-hide-chevron {
  color: #8b93a7;
  font-size: 16px;
  line-height: 1;
}
.moment-section-title {
  margin-top: 8px;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #555b6d;
}
.moment-subfield {
  margin-top: 2px;
  padding-left: 6px;
}
.moment-hide-screen,
.moment-show-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  background: #fff;
  color: #1a1d26;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s ease, visibility 0.28s ease;
}
.moment-hide-section {
  margin: 6px 2px 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b728a;
}
.moment-composer-card.is-hide .moment-hide-screen,
.moment-composer-card.is-show .moment-show-screen {
  transform: none;
  visibility: visible;
  pointer-events: auto;
}
.moment-hide-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.moment-hide-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.moment-hide-back {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef1f8;
  color: #1a1d26;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  cursor: pointer;
  flex: none;
}
.moment-hide-back svg { display: block; }
.moment-hide-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(120, 120, 150, 0.35);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 13px;
  line-height: 1.3;
  background: #fff;
  color: #1a1d26;
  -webkit-text-fill-color: #1a1d26;
  caret-color: #1c58d9;
  color-scheme: light;
}
.moment-hide-search::placeholder {
  color: #8b909c;
  -webkit-text-fill-color: #8b909c;
}
.moment-hide-search:focus {
  outline: none;
  border-color: #1c58d9;
  box-shadow: 0 0 0 2px rgba(28, 88, 217, 0.16);
}
.moment-hide-screen .moment-hide-list {
  flex: 0 1 auto;
  max-height: min(180px, 30vh);
  margin-top: 0;
  border: 1px solid rgba(120, 120, 150, 0.22);
  border-radius: 8px;
  padding: 3px 4px;
}
.moment-hide-empty {
  opacity: 0.6;
  font-size: 12px;
  padding: 5px 4px;
}
.moment-hide-done {
  align-self: flex-end;
  margin-top: 2px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 7px;
}

.moment-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.moment-pill {
  border: 1.5px solid rgba(120, 120, 150, 0.35);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13.5px;
  cursor: pointer;
}
.moment-pill.is-on {
  border-color: #7939f2;
  background: rgba(121, 57, 242, 0.12);
  color: #7939f2;
  font-weight: 600;
}
.moment-hide-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  font-size: 12.5px;
  border-radius: 5px;
  cursor: pointer;
}
.moment-hide-list label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #1c58d9;
}
.moment-hide-list label:hover { background: rgba(28, 88, 217, 0.08); }
.moment-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 10px;
  flex: none;
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0.92));
}
.moment-composer-actions .btn {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 9px;
}
.moment-err {
  margin-top: 10px;
  color: #d24b4e;
  font-size: 13px;
}

/* Телефон: сцена на весь экран, под статус-баром и над жестовой панелью.
   Правило ниже базовых top/bottom, иначе их перебивает. */
@media (max-width: 560px) {
  .moments-progress { top: calc(10px + var(--sat, 0px)); }
  .moments-head { top: calc(22px + var(--sat, 0px)); }
  .moments-caption { bottom: calc(74px + var(--sab, 0px)); }
  .moments-foot { bottom: calc(14px + var(--sab, 0px)); }
  .moments-sheet { padding-bottom: calc(20px + var(--sab, 0px)); }
}

/* Редактор видео для моментов (обрезка, звук) */
.moment-video-editor {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  color: #fff;
}
.mve-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--sat, 0px)) 16px 12px;
  z-index: 10;
}
.mve-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.mve-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.28);
}
.mve-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.mve-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  cursor: pointer;
  overflow: hidden;
  background: #000;
}
.mve-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  transition: opacity 0.2s ease;
}
.mve-video.is-pending {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  max-width: 1px;
  max-height: 1px;
  opacity: 0 !important;
  pointer-events: none;
}
.mve-video::-webkit-media-controls,
.mve-video::-webkit-media-controls-start-playback-button,
.mve-video::-webkit-media-controls-overlay-play-button,
.mve-video::-webkit-media-controls-panel {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none;
}
.mve-still {
  position: absolute;
  inset: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mve-still.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.mve-play-badge {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mve-preview.is-paused .mve-play-badge {
  opacity: 1;
  transform: scale(1);
}
.mve-bottom {
  padding: 12px 16px calc(14px + var(--sab, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.4) 75%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.mve-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}
.mve-timeline-wrap {
  position: relative;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #1b1e28;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  touch-action: none;
  cursor: pointer;
}
.mve-filmstrip {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  pointer-events: none;
}
.mve-thumb {
  flex: 1 1 0;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.mve-range {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  border-top: 3px solid #388bfd;
  border-bottom: 3px solid #388bfd;
  background: rgba(56, 139, 253, 0.18);
  cursor: pointer;
  z-index: 4;
  touch-action: none;
}
.mve-range:active { cursor: grabbing; }
.mve-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  background: #388bfd;
  border-radius: 4px;
  z-index: 6;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  touch-action: none;
}
.mve-handle::after {
  content: "";
  width: 3px;
  height: 16px;
  background: #fff;
  border-radius: 2px;
}
.mve-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  z-index: 5;
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
.mve-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.mve-actions .btn {
  padding: 8px 16px;
  font-size: 15px;
  border-radius: 10px;
}

.mve-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mve-header-tools {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mve-header-tools .mve-sticker-toggle {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  margin-left: -20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-14px) scale(0.88);
  transition:
    opacity 0.22s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
  z-index: 12;
}
.mve-header-tools.is-sticker-out .mve-sticker-toggle {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.mve-btn.is-active {
  background: #388bfd;
  color: #fff;
}
.mve-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mve-tools-panel[hidden] { display: none !important; }
.mve-apps-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
}
.mve-apps-row::-webkit-scrollbar { display: none; }
.mve-app-chip {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}
.mve-app-chip.is-on {
  background: #388bfd;
  color: #fff;
}
.mve-app-body { min-height: 0; }
.mve-app-soon {
  padding: 10px 4px 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}
.mve-filters-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mve-filters-strip::-webkit-scrollbar { display: none; }
.mve-stickers-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mve-stickers-row::-webkit-scrollbar { display: none; }
.mve-sticker-chip {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}
.mve-sticker-chip:active { transform: scale(0.94); }
.mve-sticker-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}
.mve-stickers-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.mve-sticker {
  --mve-sticker-scale: 1;
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: calc(40px * var(--mve-sticker-scale));
  height: calc(40px * var(--mve-sticker-scale));
  font-size: calc(32px * var(--mve-sticker-scale));
  line-height: 1;
  text-align: center;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  z-index: 4;
}
.mve-sticker.is-selected {
  outline: 1.5px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}
.mve-sticker-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mve-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.mve-sticker-rm,
.mve-sticker-resize {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  padding: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.mve-sticker.is-selected .mve-sticker-rm,
.mve-sticker.is-selected .mve-sticker-resize {
  display: inline-flex;
}
.mve-sticker-rm { top: -10px; right: -10px; }
.mve-sticker-resize {
  right: -10px;
  bottom: -10px;
  cursor: nwse-resize;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55);
}
.mve-sticker-resize svg {
  display: block;
  width: 12px;
  height: 12px;
  transform: rotate(35deg);
}
.mve-filter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}
.mve-filter-item:active { transform: scale(0.94); }
.mve-filter-item.is-selected {
  color: #fff;
  font-weight: 600;
}
.mve-filter-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.mve-filter-item.is-selected .mve-filter-bubble {
  border-color: #388bfd;
  box-shadow: 0 0 0 2px #388bfd, 0 3px 10px rgba(56, 139, 253, 0.4);
  transform: scale(1.04);
}
