.msg-video-thumb {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}
.msg-video-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.msg-video-thumb-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.3);
  transition: background .15s;
}
.msg-video-thumb:hover .msg-video-thumb-btn {
  background: rgba(0,0,0,.48);
}
.msg-video-thumb-btn svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.55));
}

#vp-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.93);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  overflow: hidden;
}

.vp-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: min(92vw, 960px);
  width: 100%;
  cursor: default;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
}

.vp-video {
  display: block;
  width: 100%;
  max-height: calc(92vh - 72px);
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.vp-controls {
  background: #141418;
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  user-select: none;
}

.vp-progress-wrap {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.vp-progress-bg {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
  pointer-events: none;
}
.vp-progress-fill {
  height: 100%;
  background: var(--accent, #6366f1);
  border-radius: 2px;
  width: 0%;
  transition: width .05s linear;
}
.vp-progress-buf {
  position: absolute;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  width: 0%;
}
.vp-seek {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
.vp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(99,102,241,.35);
  transition: transform .1s;
}
.vp-seek:hover::-webkit-slider-thumb { transform: scale(1.25); }
.vp-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
}

.vp-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vp-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .8;
  transition: opacity .12s, background .12s;
  flex-shrink: 0;
}
.vp-btn:hover { opacity: 1; background: rgba(255,255,255,.1); }
.vp-btn.active { color: var(--accent, #6366f1); opacity: 1; }

.vp-time {
  color: rgba(255,255,255,.6);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0 4px;
}

.vp-spacer { flex: 1; }

.vp-vol-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vp-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.2);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent, #6366f1);
}

.vp-speed {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  padding: 4px 7px;
  cursor: pointer;
  outline: none;
  transition: background .12s;
}
.vp-speed:hover { background: rgba(255,255,255,.18); }

.vp-top-bar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.vp-top-btn {
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
  transition: opacity .12s, background .12s;
}
.vp-top-btn:hover { opacity: 1; background: rgba(0,0,0,.65); }

@media (max-width: 640px) {
  #vp-lightbox {
    background: #000;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .vp-shell {
    position: relative;
    max-width: 100%;
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  .vp-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .vp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.0) 100%);
    padding: 32px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    transition: opacity .3s ease;
  }

  .vp-top-bar {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 10px;
    transition: opacity .3s ease;
  }

  .vp-shell.vp-ui-hidden .vp-controls,
  .vp-shell.vp-ui-hidden .vp-top-bar {
    opacity: 0;
    pointer-events: none;
  }

  .vp-row { gap: 2px; }

  .vp-progress-wrap { height: 26px; }

  .vp-seek::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .vp-btn { padding: 8px; }

  .vp-vol { width: 56px; }

  .vp-top-btn { width: 44px; height: 44px; }
}

@media (pointer: coarse) {
  .vp-seek { height: 28px; }
  .vp-seek::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
  .vp-btn { min-width: 40px; min-height: 40px; }
}
