/* Twipe 1.8.1: раздел «Видео» — вертикальная лента коротких роликов каналов. */

.sv {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: #000;
  color: #fff;
  font-family: Inter, "DM Sans", system-ui, sans-serif;
  outline: none;
  overscroll-behavior: contain;
}
html.sv-open #confirmSheet, html.sv-open .confirm-sheet { z-index: 100060 !important; }
html.sv-open #overlayBackdrop { z-index: 100050 !important; }
.sv svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.sv-top {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}
.sv-top > * { pointer-events: auto; }
.sv-ib { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; backdrop-filter: blur(8px); }
.sv-ib:active { transform: scale(.94); }
.sv-ib svg { width: 22px; height: 22px; }
.sv-ib[hidden] { visibility: hidden; display: grid; }
.sv-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px); }
.sv-tabs button { height: 34px; padding: 0 16px; border: 0; border-radius: 99px; background: transparent; color: rgba(255, 255, 255, .72); font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; }
.sv-tabs button.is-on { background: #fff; color: #111; }

.sv-feed {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
}
.sv-feed::-webkit-scrollbar { display: none; }

.sv-item {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}
.sv-stage { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.sv-video, .sv-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sv-poster { background: center / contain no-repeat; transition: opacity .25s; }
.sv-item:not(.is-loading) video[src] ~ .sv-poster { opacity: 0; }
.sv-item.is-paused .sv-poster { opacity: 0; }
.sv-tap { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.sv-paused { position: absolute; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: rgba(0, 0, 0, .38); opacity: 0; transform: scale(.8); transition: opacity .18s, transform .18s; pointer-events: none; }
.sv-paused svg { width: 34px; height: 34px; fill: #fff; stroke: none; margin-left: 4px; }
.sv-item.is-paused .sv-paused { opacity: 1; transform: none; }
.sv-item.is-loading .sv-stage::after { content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: svSpin .8s linear infinite; }
.sv-item.is-error .sv-stage::after { content: "Видео не загрузилось"; position: absolute; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .6); font-size: 14px; }
.sv-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .18); z-index: 2; }
.sv-progress i { display: block; height: 100%; width: 0; background: #fff; }

.sv-rail {
  position: absolute;
  z-index: 3;
  right: 8px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.sv-act { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 52px; padding: 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: 12.5px; font-weight: 650; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); cursor: pointer; }
.sv-act svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .45)); }
.sv-act.is-on svg { fill: #ff2d55; stroke: #ff2d55; }
.sv-act.is-pop svg { animation: svPop .38s ease; }
@keyframes svPop { 40% { transform: scale(1.32); } }

.sv-info {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 76px;
  bottom: 3px;
  padding: 40px 14px calc(15px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  pointer-events: none;
}
.sv-info > * { pointer-events: auto; }
.sv-ch { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sv-ch-ava { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%; background: linear-gradient(140deg, #6366f1, #ec4899); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.sv-ch-name { min-width: 0; padding: 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: 15.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); cursor: pointer; }
.sv-sub { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 1.5px solid #fff; border-radius: 9px; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.sv-sub:active { background: rgba(255, 255, 255, .2); }
.sv-cap { margin: 8px 0 0; font-size: 14.5px; line-height: 1.4; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sv-meta { margin-top: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }

.sv-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.sv-state b { font-size: 18px; }
.sv-state span { max-width: 320px; color: rgba(255, 255, 255, .7); font-size: 14.5px; line-height: 1.45; }
.sv-state-ico { font-size: 44px; }
.sv-state--sm { position: static; padding: 30px 16px; }
.sv-state--sm b { font-size: 15px; }
.sv-chip { height: 40px; padding: 0 18px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; }
.sv-chip--primary { background: #ff2d55; }
.sv-chip:disabled { opacity: .45; cursor: default; }
.sv-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff; animation: svSpin .8s linear infinite; }
@keyframes svSpin { to { transform: rotate(360deg); } }

/* ---------- нижние листы: комментарии и публикация ---------- */
.sv-sheet { position: absolute; inset: 0; z-index: 6; }
.sv-sheet[hidden] { display: none; }
.sv-sheet:not(.is-open) { pointer-events: none; }
.sv-sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s; }
.sv-sheet.is-open .sv-sheet-scrim { opacity: 1; }
.sv-sheet-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: 72%;
  min-height: 46%;
  border-radius: 20px 20px 0 0;
  background: var(--bg-elevated, #1c1c1e);
  color: var(--text, #fff);
  transform: translateY(100%);
  transition: transform .22s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sv-sheet.is-open .sv-sheet-card { transform: none; }
.sv-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 18px; }
.sv-sheet-head b { font-size: 16px; }
.sv-sheet-head .sv-ccount { margin-left: 6px; color: var(--muted, #9ca3af); font-weight: 600; }
.sv-sheet-head .sv-ib { background: color-mix(in srgb, var(--text, #fff) 8%, transparent); color: inherit; }
.sv-clist { flex: 1 1 auto; overflow-y: auto; padding: 0 8px; }
.sv-clist .sv-state span { color: var(--muted, #9ca3af); }
.sv-c { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 14px; }
.sv-c-ava { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, #14b8a6, #6366f1); color: #fff; font-weight: 750; font-size: 14px; }
.sv-c-body { flex: 1 1 auto; min-width: 0; }
.sv-c-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.sv-c-top span { color: var(--muted, #9ca3af); font-size: 12px; }
.sv-c-body p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.sv-c-del { flex: 0 0 auto; padding: 4px; border: 0; background: transparent; color: var(--muted, #9ca3af); cursor: pointer; opacity: .7; }
.sv-c-del svg { width: 18px; height: 18px; }
.sv-cform { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid color-mix(in srgb, var(--text, #fff) 10%, transparent); }
.sv-cform input { flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 14px; border: 0; border-radius: 21px; background: color-mix(in srgb, var(--text, #fff) 8%, transparent); color: inherit; font: inherit; font-size: 15px; }
.sv-cform button { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #ff2d55; color: #fff; cursor: pointer; }
.sv-cform button svg { width: 20px; height: 20px; }

.sv-upform { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; overflow-y: auto; }
.sv-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; border: 2px dashed color-mix(in srgb, var(--text, #fff) 22%, transparent); border-radius: 16px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sv-drop b { font-size: 15px; overflow-wrap: anywhere; }
.sv-drop span { color: var(--muted, #9ca3af); font-size: 13px; }
.sv-drop-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #ff2d55; color: #fff; }
.sv-drop.has-file { border-style: solid; }
.sv-drop img { width: 90px; max-height: 160px; object-fit: cover; border-radius: 10px; }
.sv-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.sv-f select, .sv-f textarea { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--text, #fff) 14%, transparent); border-radius: 12px; background: transparent; color: inherit; font: inherit; font-size: 15px; }
.sv-f select option { color: #111; }
.sv-pub { width: 100%; height: 46px; }

/* ---------- компьютер: колонка 9:16 по центру, кнопки справа от неё ---------- */
@media (min-width: 760px) {
  .sv-item { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 64px 0 16px; box-sizing: border-box; }
  .sv-stage { position: relative; inset: auto; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 200px); border-radius: 18px; overflow: hidden; }
  .sv-rail { position: relative; right: auto; bottom: auto; align-self: flex-end; margin-bottom: 40px; }
  .sv-info { right: 0; }
  .sv-sheet-card { left: auto; right: 0; top: 0; bottom: 0; width: 400px; max-height: none; border-radius: 20px 0 0 20px; transform: translateX(100%); }
}

/* Пункт «Видео» в нижнем меню больше не «скоро». */
.dock-btn[data-dock="video"].dock-btn--soon { opacity: 1; }
